Hot To Get Product Vendor, Category Name And Currency In Added To Cart Popup

Hi,

Can you help me in how to get vendor name, categoy name and currency in added to cart notification. I have tried something like this:

{$product.main_category|fn_get_category_name}

{$product.seo_snippet.price_currency}

{$product.company_name}

The above works on product page but not int he notification when product is added to the cart.

Thank you in advance.

Regards,

You can use the following code (note: it can slow down page loading time)

{$_product_data = $product.product_id|fn_get_product_data:$auth:$smarty.const.CART_LANGUAGE:'':false:false:false:false:false:false}
{$_product_data.main_category|fn_get_category_name}
{$smarty.const.CART_SECONDARY_CURRENCY}
{$_product_data.company_id|fn_get_company_name}

(!) Not tested

You can use the following code (note: it can slow down page loading time)

{$_product_data = $product.product_id|fn_get_product_data:$auth:$smarty.const.CART_LANGUAGE:'':false:false:false:false:false:false}
{$_product_data.main_category|fn_get_category_name}
{$smarty.const.CART_SECONDARY_CURRENCY}
{$_product_data.company_id|fn_get_company_name}

(!) Not tested

Thanks eComLabs. Works perfectly. However, I would reconsider including these information since there is an impact on page loading time.

Regards,

Alaa

Anyway, this data is not retrieved from database even in controller. So you should make additional requests to database

Anyway, this data is not retrieved from database even in controller. So you should make additional requests to database

Do you mean that retrieving this data from the database is better and won't slow the page?

The mentioned functions do the same actions (retrieve data from the database). But they take into account additional parameters (like shared product data, product and category statuses, prices, selected store-front, etc)

The mentioned functions do the same actions (retrieve data from the database). But they take into account additional parameters (like shared product data, product and category statuses, prices, selected store-front, etc)

It is clear now. I will retrieve the data from the database using Smarty. Thanks alot eComLabs.