diff --git a/clerk.php b/clerk.php index f5a97b9..c82d869 100644 --- a/clerk.php +++ b/clerk.php @@ -12,7 +12,7 @@ public function __construct() { $this->name = 'clerk'; $this->tab = 'advertising_marketing'; - $this->version = '1.4.4'; + $this->version = '1.4.5'; $this->author = 'Clerk'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.5', 'max' => _PS_VERSION_); diff --git a/config.xml b/config.xml index 022e478..cde5a49 100644 --- a/config.xml +++ b/config.xml @@ -2,7 +2,7 @@ clerk - + diff --git a/controllers/front/product.php b/controllers/front/product.php index 2942682..64cd999 100644 --- a/controllers/front/product.php +++ b/controllers/front/product.php @@ -23,13 +23,16 @@ public function __construct() return (bool) $product['on_sale']; }); - $this->addFieldHandler('url', function($product) { - return $this->context->link->getProductLink($product['id_product']); + //Needed for PHP 5.3 support + $context = $this->context; + + $this->addFieldHandler('url', function($product) use($context) { + return $context->link->getProductLink($product['id_product']); }); - $this->addFieldHandler('image', function($product) { + $this->addFieldHandler('image', function($product) use($context) { $image = Image::getCover($product['id_product']); - return $this->context->link->getImageLink($product['link_rewrite'], $image['id_image'], 'home_default'); + return $context->link->getImageLink($product['link_rewrite'], $image['id_image'], 'home_default'); }); $this->addFieldHandler('price', function($product) {