Jump to content

Display Carrier Transit Time at Product Page


Recommended Posts

I want to display Carrier Transit time at product page and I changed Product.php from classes, ProductController.php from controller->front and product.tpl from theme.

 

ProductConroller.php

 

protected function assignCarrierDelay()
{
 $carriers = Product::getProductCarrier($this->product->id,$this->context->language->id);
 //echo $carriers;
 $this->context->smarty->assign('carrier_delay', $carriers);
}

 

Product.php

 

public function getProductCarrier($id_product,$id_lang)
{
 return Db::getInstance()->getValue('SELECT cl.`delay`
  FROM `'._DB_PREFIX_.'carrier_lang` AS cl
LEFT JOIN`'._DB_PREFIX_.'product_carrier` AS pc
 ON pc.`id_carrier_reference` = cl.`id_carrier`
WHERE pc.`id_product` = '.(int)$id_product.' AND cl.`id_lang`='.(int)$id_lang);
}

 

Product.tpl

{$carrier_delay}

 

 

But nothing happened. Could someone please help me to get this?

Link to comment
Share on other sites

  • 11 months later...
×
×
  • Create New...