You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
most of my categories contain the same piece text in the description. Is it possible to use an include instead of having to write the full text, so when I want to make changes I only have to edit the include.php?
I am trying to add something like this:
$this->include_file('ecom','xprodshowdelivery.php');
Offline
PHP in category descriptions is not supported out of the box. To add PHP support to category descriptions:
Edit the file {private}/apps/ecom/ECOM/includes/catshow.php and locate this line:
if (!(empty($has_tags))) {$descfinal .= '<div class="kbotmarginfull">' . $catshow['description'] . '</div>' . $eol;}
Change to:
if (!(empty($has_tags))) {$descfinal .= '<div class="kbotmarginfull">' . $this->include_phptext($catshow['description']) . '</div>' . $eol;}
After you do that, provided {private}/apps/ecom/ECOM/includes/xprodshowdelivery.php exists, you'll be able to include it from your category descriptions with this PHP:
<?php $this->include_file('ecom','xprodshowdelivery.php'); ?>
Offline
thanks Nick, works perfect.
Offline
can I do this with the product description? I have looked at prodshow.php but no sure how to insert the code
Offline
final question (hopefully)
Is it also possible to insert an include into the product options description? I have looked at all the include.php files but can't figure out which one I need to edt.
Last edited by nigel (10-28-2021 10:19:52)
Offline
The options utilize functions that ultimate present a form, so look at {private}/core/CORE/includes/formfield_open.php and use $this->include_phptext() on form field descriptions that have tags in them. That will make PHP available in EVERY form field description presented by the software.
Offline