Jump to content

[SOLVED] How to get product ID in PHP


Recommended Posts

  • 1 year later...
  • 1 month later...
  • 2 months later...

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

  • 6 months later...
  • 1 year later...

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

  • 1 year later...
  • 1 year later...

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

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...