Jump to content

Display product data within module


Vico_b
 Share

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

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More