RAD-X Posted October 13, 2011 Share Posted October 13, 2011 I need to get product ID in my module. In tpl files it is {$product->id|intval}. But I don't know how to get this value in PHP file. Link to comment Share on other sites More sharing options...
RAD-X Posted October 13, 2011 Author Share Posted October 13, 2011 Got it. $_GET['id_product'] did the work. Link to comment Share on other sites More sharing options...
Runan Posted March 23, 2013 Share Posted March 23, 2013 Got it. $_GET['id_product'] did the work. Hello, If you want to get the reference of your product page in your module ... How sould you do it ? Thanks. Link to comment Share on other sites More sharing options...
vekia Posted March 23, 2013 Share Posted March 23, 2013 $product->reference im not sure but you should check this one :-) Link to comment Share on other sites More sharing options...
Manik Posted May 23, 2013 Share Posted May 23, 2013 (edited) Hi, hope this is what you looking for..this will give the product id. $id_product = (int)Tools::getValue('id_product'); Edited May 23, 2013 by Milky John (see edit history) 1 Link to comment Share on other sites More sharing options...
bilalhussain Posted August 15, 2013 Share Posted August 15, 2013 Got it. $_GET['id_product'] did the work. how did it work for you ? did you added this code in .tpl file? and did you added it exactly like that? I am trying to do the same thing. get the product.reference # in the .tpl file. Thanks Link to comment Share on other sites More sharing options...
bilalhussain Posted August 15, 2013 Share Posted August 15, 2013 Hi, hope this is what you looking for..this will give the product id. $id_product = (int)Tools::getValue('id_product'); if we set this in .php file how would we access it in .tpl file? Link to comment Share on other sites More sharing options...
vekia Posted August 15, 2013 Share Posted August 15, 2013 if we set this in .php file how would we access it in .tpl file? in this case you should append new variable to the smarty array. You can always in .tpl file use a bit different menthod, like this: {$smarty.get.id_product} or just {Tools::getValue('id_product')} Link to comment Share on other sites More sharing options...
mdusamaansari Posted February 28, 2014 Share Posted February 28, 2014 What is the controller file for product-list.tpl? And how to get product_id to display in product-list.tpl? Link to comment Share on other sites More sharing options...
vekia Posted February 28, 2014 Share Posted February 28, 2014 it's a CategoryController.php (controllers/front/CategoryController.php) Link to comment Share on other sites More sharing options...
Lan Nguyen Posted February 6, 2016 Share Posted February 6, 2016 Hi, I ET Urban 21 theme, it includes a "New Product" Block on home page, but it does not allow me to choose more than 1 BIG Product to show on home page. I want to call the specific id of the products that I want to show, how to write those IDs in this code? <!-- The code is here --> {if isset($cs_big_product{$cs_id}) && $cs_big_product{$cs_id[spam-filter] <div class="cs_big_product cs-big-product"> <div class="cs-item" itemscope itemtype="http://schema.org/Product"> {include file="$tpl_dir./product-section-cs.tpl" product=$cs_big_product{$cs_id} image_size='home_default'} </div> </div> {/if} Link to comment Share on other sites More sharing options...
abdess Posted March 5, 2017 Share Posted March 5, 2017 thnx Manik Link to comment Share on other sites More sharing options...
beginner1 Posted April 6, 2018 Share Posted April 6, 2018 This thread is quite old but I am posting my question here since my questions related to the product id too. How can I get product id in BackOffice i.e. in the AdminProductsController? The page I am referring to is the one where the products are edited (name, images, description, prices etc. can be changed). Thanks in advance 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