beginner1 Posted November 19, 2017 Share Posted November 19, 2017 Hi everyone I have created a custom front controller. I have a button in the displayreassurance hook inside the product page that calls that front controller. I want to send the product data to that controller. $product = new Product( (int)Tools::getValue('id_product'), true, $this->context->language->id, $this->context->shop->id ); Media::addJsDef(array( 'product_name' => $product->name, )); If I write this in my front controller I get null. Any idea how I can get the product details in the front controller? Link to comment Share on other sites More sharing options...
bellini13 Posted November 19, 2017 Share Posted November 19, 2017 Tools::getValue('id_product'), You can only use this if you are passing id_product as a parameter to your front controllers URL as a GET or POST parameter. Are you doing that? Link to comment Share on other sites More sharing options...
beginner1 Posted November 28, 2017 Author Share Posted November 28, 2017 On 11/19/2017 at 4:49 PM, bellini13 said: Tools::getValue('id_product'), You can only use this if you are passing id_product as a parameter to your front controllers URL as a GET or POST parameter. Are you doing that? I have just added this code inside the header and was trying to pass the product name to a controller through javascript file by assigning it. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now