Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

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

 
  • alaa
  • Senior Member
  • Members
  • Join Date: 18-Mar 18
  • 168 posts

Posted 30 April 2019 - 08:51 AM #1

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, 

 

 

 



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19833 posts

Posted 30 April 2019 - 01:51 PM #2

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alaa
  • Senior Member
  • Members
  • Join Date: 18-Mar 18
  • 168 posts

Posted 01 May 2019 - 07:55 AM #3

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



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19833 posts

Posted 03 May 2019 - 05:50 AM #4

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


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alaa
  • Senior Member
  • Members
  • Join Date: 18-Mar 18
  • 168 posts

Posted 03 May 2019 - 10:50 PM #5

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?



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 19833 posts

Posted 04 May 2019 - 05:22 AM #6

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)


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • alaa
  • Senior Member
  • Members
  • Join Date: 18-Mar 18
  • 168 posts

Posted 04 May 2019 - 10:54 AM #7

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.