can you give me examples of what you found? And did you use one in the contribution section or one I hosted briefly on my website?
can you give me examples of what you found? And did you use one in the contribution section or one I hosted briefly on my website?
In the admin -> includes -> modules -> product, I had too many edited files, so I removed all of them and put from the standard copy of ZC the original ones and then I replaced them by using your package from the Add-ons.
I have the copies of your links as well but I used here the Add-on (contribution) package made by you.
Also the database had still the product_extra_description_extra table that was not needed anymore and I removed it. It hadn't got removed earlier because I didn't realise to put my prefix in the sql in phpmyadmin.
Now looking the idea for hiding the extra field when having the price hidden with the idea you said earlier. Is it the template file where this "switch" should be?
I may be blond but at least I found Zen.
For hiding the extra field (or any of these extras would be ok for now) when having the customer detail for authorization in "2" or "3" and the customer shop status as "2" as well, I tried to change the code like this for tpl_product_info_display.php:
- -
<div class="files">
<?php if(isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field)) {
echo '<div class="filesHead">'.TEXT_PRODUCT_MORE_INFO.'</div><ul>';
}?>
<?php if(isset($extra_field)) and (CUSTOMERS_APPROVAL == 2 and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
// do nothing
}
else {
echo '<li>'.$extra_field . '</li>';
} ?>
- -
But now my product part of the page goes blank, so there is some error in this structure.
I noted that the hiding prices (standard solution) is not done inside the template file, so maybe there is another way to do this as well.
Last edited by ellivir; 7 Jul 2009 at 02:16 PM.
I may be blond but at least I found Zen.
I still get a blank page issue with my code, couldn't find what is wrong with that.
There must be some error in this structure. I haven't changed anything else than the above part for the file tpl_product_info_display.php.
Any ideas to solve this?
Thanks!
Elli
I may be blond but at least I found Zen.
You've got a php error in the do nothing line - use of and instead of && - but I'm not a php wizard!
"and" and "&&" are practically interchangeable, as are "or" and "||". There are subtle differences in precedence, but they will both work. Depending on precedence rules for organizing multiple logic tests is not generally a good idea anyway - better to make the order explicit with parentheses.
thanks Glenn. There's definitely an error there somewhere in his code. Please check it!
Looking at the posted code with PHP highlighting...PHP Code:
<div class="files">
<?php if(isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field)) {
echo '<div class="filesHead">'.TEXT_PRODUCT_MORE_INFO.'</div><ul>';
}?>
<?php if(isset($extra_field)) and (CUSTOMERS_APPROVAL == 2 and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
// do nothing
}
else {
echo '<li>'.$extra_field . '</li>';
} ?>
There is one PHP error:
if(isset($extra_field)) and (CUSTOMERS_APPROVAL == 2 and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
has an extra ) that makes PHP think the conditional test is done too soon.
There is also a logic error that could result in outputting a bare <li> with null content. Moving the $extra_field code to inside the products_file_1_link loop should eliminate that possibility.
PHP Code:
<div class="files">
<?php if(isset($products_file_1_link) || isset($products_file_2_link) || isset($products_file_3_link) || isset($products_file_4_link) || isset($video_file_link) || isset($extra_field)) {
echo '<div class="filesHead">'.TEXT_PRODUCT_MORE_INFO.'</div><ul>';
?>
<?php
if(isset($extra_field) and (CUSTOMERS_APPROVAL == 2 and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
// do nothing
}
else {
echo '<li>'.$extra_field . '</li>';
}
}// /if prod_file_1 ?>
hmmm... tried that too, no success so far but definitely it is some structural error in the php.
That line of "do nothing" has been used elsewhere in the ZC itself. It can be found via developers tool.
Elli
Editing: I got all the other answers after Delia's only after posting that even if I have refreshed the forum. Funny.
But thanks very much. Time to go to sleep but I'll try tomorrow! :)
Last edited by ellivir; 15 Jul 2009 at 11:05 PM. Reason: Not seen other posts
I may be blond but at least I found Zen.
Bookmarks