You can add other categories to the no-show list with just a few characters for each one.
I'll tell you how tomorrow.
You can add other categories to the no-show list with just a few characters for each one.
I'll tell you how tomorrow.
Glenn, as you mentioned in this quasi-related thread:
http://www.zen-cart.com/forum/showth...514#post373514
(Thread summary: To have a single category within a store that is Showcase-only. The rest of the store operates normally, displaying prices & cart)
This same logic does seem like it could be applied. However, it's way out of my league to do so. Could I trouble you to point me in the right direction?
It does seem that the ability to do this would be quite helpful to a number of people. (My self-serving way of being benevolent )
Thanks - Tim
Will do, Tim. First, the logic to include other categories/subcategories in this list:
(!ereg("(^1$|^1_)",$cPath))
You can find a full description of the PHP function ereg() in online tutorials like w3schools. For present purposes, there are three elements to understand.
^1$ means"the string is exactly 1".
^1_ means "the string starts with 1_".
| means "or".
And of course $cPath is the variable that holds the current category path, visible in the address bar.
For any top category (##) with or without subcategories, ^##$ will specify that top category.
For any top category with subcategories, ^##_ will specify all of its subcategories (and sub-subs etc.).
One step more detailed, for any subcategory (23_42), ^23_42$ will specify only that subcategory. THis can be extended as desired.
You can string any number of these specifications together with | between them, and if any one of them is true, ereg will return true.
Since in this case we want to execute if not in these categories, we add ! in front of ereg which says "f ereg is false, return true; if ereg is true, return false".
THis bit of logic can be embedded in any PHP statement where true or false is being evaluated on a category/product page.
is that something I have to understand TOO!!!
I knew, when I 'finished" my store in less then a week, it was too good to be true!
If you're online and have some time, please email me and let me know if you have any sort of IMs. If I can just wrap my blonde brain around it, I will get it eventually. I'm just SOOOO scared to mess with what is already working that it kept me awake all last night .
I try to calm down, we have new kittens in the house, so I go and hold one, but the minute I live the "nursery", I break out in a cold sweat cause I'm worried about getting this to work correctly.
I was so happy that I thought all I had to do was just start adding stock.... I was wrong .
I'm going to go read over your posts (again and again) and see if anything starts to gel.
Thanks!
Lalla
www.LilleyPadGifts.com
www.NothingButRomance.com
OK, Tim, don't worry! Bite-size chunks coming up ;)
I included the full explanation for those who want to apply the logic to other situations; for you both, you can use what I have posted essentially as is.
Working in /includes/templates/your_template/templates/tpl_product_info_display.php, find this sectionand addPHP Code:
<!--bof Product Price block -->
<h2 id="productPrices" class="productGeneral">
<?php
// base price
if ($show_onetime_charges_description == 'true') {
$one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
} else {
$one_time = '';
}
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></h2>
<!--eof Product Price block -->
<?php if (!ereg("(^23$|^23_)",$cPath)) { ?>
and
<?php } ?>
to getChange 23 to your gallery category id, and the price will not be shown on any product viewed in the gallery.PHP Code:
<!--bof Product Price block -->
<?php if (!ereg("(^23$|^23_)",$cPath)) { ?><!--no price in gallery -->
<h2 id="productPrices" class="productGeneral">
<?php
// base price
if ($show_onetime_charges_description == 'true') {
$one_time = '<span >' . TEXT_ONETIME_CHARGE_SYMBOL . TEXT_ONETIME_CHARGE_DESCRIPTION . '</span><br />';
} else {
$one_time = '';
}
echo $one_time . ((zen_has_product_attributes_values((int)$_GET['products_id']) and $flag_show_product_info_starting_at == 1) ? TEXT_BASE_PRICE : '') . zen_get_products_display_price((int)$_GET['products_id']);
?></h2>
<?php } ?><!--/no price in gallery -->
<!--eof Product Price block -->
Last edited by gjh42; 13 May 2007 at 10:47 PM.
were we typing at the same time or what? LMAO!
Lalla, if you post a list of the category ids you want to skip the qty on, I will show you how the full testing list will look. You can take that as an example when you want toadd another category to the list.
The other categories besides Comics don't have subcats, so I will include the simplest form of the test.
(^1$|^1_|^2$|^3$|^22$)
If you want to include another top cat which has subcats (say id 27), you would add it to the above list like this:PHP Code:
<?php echo (((!ereg("(^1$|^1_|^2$|^3$|^22$)",$cPath)) and $flag_show_product_info_quantity == 1 and $products_quantity >0) ? '<li>' . $products_quantity . TEXT_PRODUCT_QUANTITY . '</li>' : '') . "\n"; ?>
(^1$|^1_|^2$|^3$|^22$|^27_)
Bookmarks