Page 3 of 38 FirstFirst 1234513 ... LastLast
Results 21 to 30 of 377
  1. #21
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: Product Extra Fields for text, pdfs and flash

    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?
    The full-time Zen Cart Guru. WizTech4ZC.com

  2. #22
    Join Date
    Sep 2005
    Posts
    460
    Plugin Contributions
    0

    Default Re: Product Extra Fields for text, pdfs and flash

    Quote Originally Posted by delia View Post
    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.

  3. #23
    Join Date
    Sep 2005
    Posts
    460
    Plugin Contributions
    0

    Default Re: Product Extra Fields for text, pdfs and flash

    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.

  4. #24
    Join Date
    Sep 2005
    Posts
    460
    Plugin Contributions
    0

    Default Re: Product Extra Fields for text, pdfs and flash

    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.

  5. #25
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: Product Extra Fields for text, pdfs and flash

    You've got a php error in the do nothing line - use of and instead of && - but I'm not a php wizard!
    The full-time Zen Cart Guru. WizTech4ZC.com

  6. #26
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Product Extra Fields for text, pdfs and flash

    "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.

  7. #27
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,296
    Plugin Contributions
    22

    Default Re: Product Extra Fields for text, pdfs and flash

    thanks Glenn. There's definitely an error there somewhere in his code. Please check it!
    The full-time Zen Cart Guru. WizTech4ZC.com

  8. #28
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Product Extra Fields for text, pdfs and flash

    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 == and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
    // do nothing
    }
    else {
    echo 
    '<li>'.$extra_field '</li>';
    ?>

  9. #29
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Product Extra Fields for text, pdfs and flash

    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 == and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) {
        
    // do nothing
      
    }
      else {
        echo 
    '<li>'.$extra_field '</li>';
      }
    }
    // /if prod_file_1 ?>

  10. #30
    Join Date
    Sep 2005
    Posts
    460
    Plugin Contributions
    0

    Default Re: Product Extra Fields for text, pdfs and flash

    Quote Originally Posted by delia View Post
    You've got a php error in the do nothing line - use of and instead of && - but I'm not a php wizard!
    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.

 

 
Page 3 of 38 FirstFirst 1234513 ... LastLast

Similar Threads

  1. Replies: 1
    Last Post: 10 Sep 2013, 10:09 PM
  2. Can I add two extra fields for inputting time and date delivery wanted?
    By Desjames in forum Managing Customers and Orders
    Replies: 2
    Last Post: 20 Jun 2010, 08:56 PM
  3. Extra pages and flash movie
    By g.nencini in forum General Questions
    Replies: 1
    Last Post: 11 Oct 2009, 11:51 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR