zen cart 158 fresh install
PHP Version: 7.4.33 (Zend: 3.4.0)
Mods: clone a template, display logs, OPC, Bootstrap 3.4
@swguy
I receive 2 error logs when inserting the 2 PHP file within the zen cart structure from your website installition instructions.
HTML Code:
[26-Nov-2022 18:53:03 America/Denver] PHP Notice: Undefined variable: descr_stringlist in /includes/templates/boot_horn/templates/tpl_product_info_display.php on line 117
HTML Code:
[26-Nov-2022 18:53:03 America/Denver] Request URI: /index.php?main_page=product_info&cPath=302_305_312&products_id=328, IP address: 216.177.186.199, Language id 1
#1 require(/includes/templates/boot_horn/templates/tpl_product_info_display.php) called at [/includes/modules/pages/product_info/main_template_vars.php:156]
#2 require(/includes/modules/pages/product_info/main_template_vars.php) called at [/includes/templates/boot_horn/common/tpl_main_page.php:202]
#3 require(/includes/templates/boot_horn/common/tpl_main_page.php) called at [/index.php:94]
--> PHP Warning: Invalid argument supplied for foreach() in /includes/templates/boot_horn/templates/tpl_product_info_display.php on line 117.
Website instructions:
HTML Code:
Create a customized copy of includes/templates/custom/templates/tpl_product_info_display.php (from includes/templates/template_default/templates/tpl_product_info_display.php)
You will be defining your boilerplate strings in a file called includes/languages/english/extra_definitions/my_defines.php Each string will have a PHP "define" statement, and all the strings will be listed in an array. In this way, users can simply add and delete strings by editing this one file, rather than having to dig into the internals of Zen Cart.
We'll use a simple example:
<?php $descr_stringlist = array("PHP_ONE_WEEK_DELAY", "PHP_TWO_WEEK_DELAY", "PHP_THREE_WEEK_DELAY"); define('PHP_ONE_WEEK_DELAY', 'These decals will be shipped in one week after receiving your order.'); define('PHP_TWO_WEEK_DELAY', 'These decals will be shipped in two weeks after receiving your order.'); define('PHP_THREE_WEEK_DELAY', 'These decals will be shipped in three weeks after receiving your order.'); ?>
We've defined three constants and added each one to a list called descr_stringlist.
Now go back to includes/templates/custom/templates/tpl_product_info_display.php Change <!--bof Product description --> <?php if ($products_description != '') { ?> <div id="productDescription" class="productGeneral biggerText"><?php echo stripslashes($products_description); ?></div> <?php } ?> <!--eof Product description --> to
<!--bof Product description --> <?php if ($products_description != '') { ?> <div id="productDescription" class="productGeneral biggerText"> <?php $stripped_products_description = $products_description; foreach ($descr_stringlist as $varname) { $stripped_products_description = str_replace($varname, constant($varname), $stripped_products_description); } ?> <?php echo stripslashes($stripped_products_description); ?></div> <?php } ?> <!--eof Product description -->
Bookmarks