Jump to content

php code in product description


Recommended Posts

Hello,

 

I assume that the normal way would be to edit the controller (ProductController.php), then assign variables for Smarty to pass to the template (product.tpl).

 

You must also edit code anywhere else the long and short descriptions are used.

 

Here's an example

 

In ProductController.php, inside initContent(), look for:

$this->context->smarty->assign(array(

 

Add this:

'productDescriptionShort' => 'This is the short description: '.$this->product->description_short

 

In product.tpl, look for:

{$product->description_short}

 

Change into this:

{$productDescriptionShort}

 

Result

2s8r7k2.jpg

Link to comment
Share on other sites

×
×
  • Create New...