Welcome to MyPresta.eu – Your reliable partner in the e-commerce world. Find innovative modules that will take your business to a new level.
Today i want to show you simple tutorial about adding product categories to each product added to cart on shopping cart page in your prestashop store.
Product categories and shopping cart

In this case you have to open shopping-cart-product-line.tpl file located in your theme directory. Open this file and search for line:
<p class="s_title_block"><a href="{$link->getProductLink($product.id_product, $product.link_rewrite, $product.category, null, null, $product.id_shop, $product.id_product_attribute)|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'}</a>
Right after this line add code:
<br/>
<span style="font-size:10px;">
{foreach from=Product::getProductCategoriesFull($product.id_product) item=cat}
<a href="{$link->getCategoryLink({$cat.id_category})}" title="{$cat.name}">{$cat.name}</a>,
{/foreach}
</span>
This code send query to the database for all categories associated to the product. Then foreach loop select categories one by one and displaying them as a link to the category.
Artykuł napisany przez Milosza Myszczuka, eksperta PrestaShop i oficjalnego moderatora społeczności PrestaShop. CEO i założyciel agencji interaktywnej VEKIA. Dowiedz się więcej.
If you like this article, support our work!

The Currency Exchange Module offers unparalleled flexibility in managing international sales. Regard...
19.99 €

Integrate your store with the Central Bank of the Republic of Turkey (TCMB) using this module. It au...
19.99 €

Automatic National Bank of Ukraine (NBU) currency rates integrator. The module guarantees precise pr...
19.99 €

Automatic Bank of Spain (Banco de España - BdE) currency rates integrator. The module guarant...
19.99 €