Jump to content

Add button Add to cart in the block of new products (position displayleftcolumn)


restaller

Recommended Posts

Hello everyone,
 
I am trying to insert an Add to cart button into the block of new products of the displayleftcolumn position, which is displayed on the category pages.
 
A "Product not found" message is displayed.
 
But you can not get the value of the product id in the attribute data-id-product = "..."
The code is located in prestashop\themes\default-bootstrap\modules\blockviewed\blockviewed.tpl:
 

<a class="button ajax_add_to_cart_button btn btn-default" href="{$link->getPageLink('cart, true')}" rel="nofollow"
                        title="{l s='Add to Cart'}" data-id-product="..." data-id-product-attribute="0">    
                        <span>{l s='Add to cart'  mod='blockviewed'}</span>
</a>

 
The data-id-product value is empty because I do not know what to use inside.
 
Would anyone know what to use to get the product id?

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