Jump to content

Edit History

dysmant

dysmant

5 hours ago, ventura said:

I didn't understand it well

 

try this

'page' => $this->_getProductID($params['product']->id)

 

However, I need to get the value after {foreach} on the .tpl page, like this example:

{foreach from=$countries item=c} 
	{assign var='id_country' value=$page->_getCountID($c.id_country)} 
{/foreach} 
{foreach from=$products item=p} 
	{assign var='id_product' value=$page->_getProductID($p.id_product)} 
{/foreach}

and, on the smarty array in .php file

$this->context->smarty->assign([
			'countries' =>$countries,
			'products' =>$products,
			'page' =>$this,
        ]);
return $this->display(__FILE__, 'product.tpl');

this script causes an error

'page' =>$this,

 

BAD ENGLISH, Sorry

 

dysmant

dysmant

5 hours ago, ventura said:

I didn't understand it well

 

try this

'page' => $this->_getProductID($params['product']->id)

 

However, I want to get the value after {foreach} on the .tpl page, like this example:

{foreach from=$countries item=c} 
	{assign var='id_country' value=$page->_getCountID($c.id_country)} 
{/foreach} 
{foreach from=$products item=p} 
	{assign var='id_product' value=$page->_getProductID($p.id_product)} 
{/foreach}

and, on the smarty array in .php file

$this->context->smarty->assign([
			'countries' =>$countries,
			'products' =>$products,
			'page' =>$this,
        ]);
return $this->display(__FILE__, 'product.tpl');

this script causes an error

'page' =>$this,

 

BAD ENGLISH, Sorry

 

dysmant

dysmant

4 hours ago, ventura said:

I didn't understand it well

 

try this

'page' => $this->_getProductID($params['product']->id)

 

However, I want to get the value after {foreach} on the .tpl page, like this example:

{foreach from=$countries item=c} 
	{assign var='id_countries' value=$page->_getCountID($c.id_country)} 
{/foreach} 
{foreach from=$products item=p} 
	{assign var='id_Product' value=$page->_getProductID($p.id_product)} 
{/foreach}

and, on the smarty array in .php file

$this->context->smarty->assign([
			'countries' =>$countries,
			'products' =>$products,
			'page' =>$this,
        ]);
return $this->display(__FILE__, 'product.tpl');

this script causes an error

'page' =>$this,

 

BAD ENGLISH, Sorry

 

dysmant

dysmant

4 hours ago, ventura said:

I didn't understand it well

 

try this

'page' => $this->_getProductID($params['product']->id)

However, I want to get the value after {foreach} on the .tpl page, like this

{foreach from=$countries item=c}
     {assign var='id_countries' value=$page->_getCountID($c.id_country)}
{/foreach}

{foreach from=$products item=p}
     {assign var='id_Product' value=$page->_getProductID($p.id_product)}
{/foreach}

 

×
×
  • Create New...