Forums / General Questions / Use of if statement in product_info_display

Use of if statement in product_info_display

Views: 604

Results 1 to 3 of 3
20 Jun 2014, 6:55 PM
#1
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Use of if statement in product_info_display

How do use an if statement in tpl_product_info_display.php to display Product URL for certain manufacturers (by manufacturer ID)? The manufacturer ID could be hard coded in tpl_product_info_display.php file!

Using Zen Cart 1.5.1

20 Jun 2014, 7:53 PM
#2
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,110
Plugin Contributions:
56

Re: Use of if statement in product_info_display

You could make changes similar to below:

<!--bof Product URL -->
<?php
  // -----
  // Edit the comma-separated list to identify the manufacturers_id values for which the products URL should be displayed.
  //
  $manufacturers_to_show = explode (',', '5,7,13');
  if (zen_not_null($products_url) && zen_not_null($product_info->fields['manufacturers_id']) && in_array ($product_info->fields['manufacturers_id'], $manufacturers_to_show)) {
    if ($flag_show_product_info_url == 1) {
?>
    <p id="productInfoLink" class="productGeneral centeredContent"><?php echo sprintf(TEXT_MORE_INFORMATION, zen_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($products_url), 'NONSSL', true, false)); ?></p>
<?php
    } // $flag_show_product_info_url
  }
?>
<!--eof Product URL -->
20 Jun 2014, 8:06 PM
#3
kevin205 avatar

kevin205

Totally Zenned

Join Date:
Dec 2012
Posts:
607
Plugin Contributions:
0

Re: Use of if statement in product_info_display

Great. Thanks.

Using Zen Cart 1.5.1