Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2007
    Posts
    34
    Plugin Contributions
    0

    Default php help with tpl_product_info_display.php

    Is there an if function I can use if a product is on Special?

    I'd like to display a different background image for Special items without being forcing to change product type.

    eg,

    If product is on sale, display fancy new background
    else display normal background.

    Thanks :)

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: php help with tpl_product_info_display.php

    You could try
    if (zen_get_products_special_price($products_id, true) != false) {
    -- Your code in here --
    }
    If you leave out the 2nd parameter it will detect both specials and products with sale prices.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jan 2007
    Posts
    34
    Plugin Contributions
    0

    Default Re: php help with tpl_product_info_display.php

    Thanks for the quick response...

    Code:
    <?php if (zen_get_products_special_price($products_id, true) != false) { ?>
    <div>TEST</div>
    <?php } ?>
    I tried this in tpl_product_info_display.php, but nothing changed on normal priced products, Sales or Specials when viewing those products.



    About the 2nd parameter too, sorry, but my php knowledge is pretty much 0, so I'll need a little help with that lol would I remove ", true" ?

    Thanks again :)

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: php help with tpl_product_info_display.php

    I apologize. I didn't intend the condition to be used literally, but should have made that clear. You need to substitute something for $products_id. In tpl_product_info_display that would probably be $_GET['products_id'].
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Jan 2007
    Posts
    34
    Plugin Contributions
    0

    Default Re: php help with tpl_product_info_display.php

    oooooh, thank you so much :)

    Its working for Specials perfectly, and thats exactly what I need, so a bit thumbs up for you

    Out of interest though, can it be done for Sales too? (not working atm)

    Code:
    <?php if (zen_get_products_special_price($_GET['products_id'], true) != false) { ?>
    <div>TEST</div>
    <?php } ?>

  6. #6
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: php help with tpl_product_info_display.php

    Sorry, didn't answer your 2nd question, but you were right on the money with your theory. Do exactly as you suggested or change the "true" to "false" to also include sales.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  7. #7
    Join Date
    Jan 2007
    Posts
    34
    Plugin Contributions
    0

    Default Re: php help with tpl_product_info_display.php

    hmmm, it doesn't seem to be working for any product under these categories:

    Sale Percentage &#187;
    Sale Deduction &#187;
    Sale New Price &#187;

    Which I guess are the Sale price items... Am I missing something?

  8. #8
    Join Date
    Sep 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: php help with tpl_product_info_display.php

    Hello!
    Love Zen Cart, but my Add to Cart buttons just disappeared and I can't seem to figure out what the issue is. I do know it's most likely an error in tpl_product_info_display.php page. They were showing but also had "products_qty_box_status == 0 or $products_quantity_order_max== 1" above the Add to Cart button. When I placed "//" in line 38, it went away along with the Add to Cart button. Now my site is showing, "Quantity: Contact Us" where the Add to Cart button should be.

    I'm using version 1.3.9b

    Any suggestions? I'd greatly appreciate it!!

    Wendy

 

 

Similar Threads

  1. v139h need help with tpl_product_info_display.php - reward points
    By dmagic in forum General Questions
    Replies: 12
    Last Post: 6 Feb 2014, 12:48 AM
  2. tpl_product_info_display - php help
    By alexhigh in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 26 Apr 2010, 06:25 PM
  3. Changing tpl_product_info_display.php with custom attributes
    By DigitalGuard in forum General Questions
    Replies: 0
    Last Post: 23 Mar 2010, 10:11 PM
  4. $_POST & tpl_product_info_display.php, help?
    By NooNe in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 28 Jun 2009, 10:57 PM
  5. product_music_info_display.php to tpl_product_info_display.php
    By mrmeech in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 3 Dec 2006, 12:07 AM

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