Jump to content

Display product data within module


Vico_b

Recommended Posts

Hello everyone,

I'm learning how to dev modules so I try some stuff.

I saw this piece of code on the forum

                        public function hookDisplayCartExtraProductActions($params)
                        {
                            $product = new Product((int)Tools::getValue('id_product'), true, $this->context->language->id, $this->context->shop->id);
                            $this->context->smarty->assign(array(
                             'product' => $product
                            ));
                              return $this->display(__FILE__, 'patcher.tpl');
                        }

So I tried it and made a patcher.tpl like so

 

<input type='hidden' class='xoxoxo' value='{$product->name}'>
<div>
{$product->name}
</div>

The input and the div does appears in my cart code,

but {$product->name} display nothing

Thank you for your help

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...