Jump to content

Edit History

Apar

Apar

12 hours ago, slimbl said:

protected function assignSupplier()
    {
        $supplierVar = $this->objectPresenter->present($this->supplier);

        $filteredSupplier = Hook::exec(
            'filterSupplierContent',
            array('object' => $supplierVar),
            $id_module = null,
            $array_return = false,
            $check_exceptions = true,
            $use_push = false,
            $id_shop = null,
            $chain = true
        );
        if (!empty($filteredSupplier['object'])) {
            $supplierVar = $filteredSupplier['object'];
        }

        $this->context->smarty->assign(array(
            'supplier' => $supplierVar,
        ));
    }

For your requirement you need to override assignSupplier function by default $supplierVar variable does not have supplier image link. So either you can add it in the same variable or you can create a new smarty variable for the image link.

I can give you code for it if you need it.

And for overriding you need to do that in the override folder in your prestashop installation directory. You can take help of documentation link given by JBW.

On 2/26/2019 at 3:38 PM, JBW said:

There is further information in Presta docu (it's in module chapter, but no module required if you do it in your override folder directly)

https://devdocs.prestashop.com/1.7/modules/concepts/overrides/#class-controller-override

Feel free to contact if you need help with it.

Apar

Apar

11 hours ago, slimbl said:

protected function assignSupplier()     {         $supplierVar = $this->objectPresenter->present($this->supplier);         $filteredSupplier = Hook::exec(             'filterSupplierContent',             array('object' => $supplierVar),             $id_module = null,             $array_return = false,             $check_exceptions = true,             $use_push = false,             $id_shop = null,             $chain = true         );         if (!empty($filteredSupplier['object'])) {             $supplierVar = $filteredSupplier['object'];         }         $this->context->smarty->assign(array(             'supplier' => $supplierVar,         ));     }

For your requirement you need to override assignSupplier function by default $supplierVar variable does not have supplier image link. So either you can add it in the same variable or you can create a new smarty variable for the image link.

I can give you code for it if you need it.

And for overriding you need to do that in the override folder in your prestashop installation directory. You can take help of documentation link given by JBW.

On 2/26/2019 at 3:38 PM, JBW said:

There is further information in Presta docu (it's in module chapter, but no module required if you do it in your override folder directly)

https://devdocs.prestashop.com/1.7/modules/concepts/overrides/#class-controller-override

Feel free to contact if you need help with it.

×
×
  • Create New...