Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / tpl_product_info_display - php help

tpl_product_info_display - php help

Locked

Views: 707

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
21 Apr 2010, 3:11 PM
#1
alexhigh avatar

alexhigh

New Zenner

Join Date:
Nov 2009
Posts:
27
Plugin Contributions:
0

tpl_product_info_display - php help

Hi, I usually just have the following bit of code within my tpl_product_info_display.php as a bit of extra info about the price of the product:

<div id="priceinfo">Total price excluding delivery</div>

Here's a link to a typical product page: http://www.trymarket.com/index.php?main_page=product_info&products_id=256

Only now I am thinking of adding some free delivery products and am trying to get a conditional statement to work:

<?php

  if(zen_get_product_is_always_free_shipping($products_id_current) && $flag_show_product_info_free_shipping) { 
    <div id="priceinfo">Total price with free delivery</div>;

} else {
<div id="priceinfo">Total price excluding delivery</div>;
}

?>

This code, however, is giving me a blank product page - it looks 'right' to me but then again I have pretty limited php knowledge. Is there anyone around that could help fix this for me?

26 Apr 2010, 5:25 PM
#2
alexhigh avatar

alexhigh

New Zenner

Join Date:
Nov 2009
Posts:
27
Plugin Contributions:
0

Re: tpl_product_info_display - php help

Found the solution to this in the end:

<?php

  if(zen_get_product_is_always_free_shipping($products_id_current)) 
    { ?> <div id="priceinfo"><font color="#63941e">Total price with FREE delivery</font></div> <?php }

else 
{ ?> <div id="priceinfo">Total price excluding delivery</div>< <?php } 
?>

I hadn't seperated out the <div> elements from the php.