Jump to content

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

How To Add Product Brand Name Under Each Product Name In Product Listing Page Rate Topic   - - - - -

 
  • Armita84
  • Member
  • Trial users
  • Join Date: 27-Sep 16
  • 42 posts

Posted 24 July 2017 - 11:20 AM #1

Hello,
I want to show brand name for each product in Product Listing Page (Category view). I'm using cs-cart 4.6.1.
At First, I added 'show_features=true' in products_multicolumns.tpl under 'templates/blocks/product_list_templates' folder. 
Then in tmplates/blocks/list_templates path I added following code in  grid_list.tpl  file:

 

{hook name="products:main_info_title"}
 
          {hook name="products:brand"}
                  <div class="brand">
                      <div class="title">{__("brand")} : </div>
                      <span>{include file="views/products/components/product_features_short_list.tpl"                                                     features=$product.header_features}
                      </span>
                     </div>
          {/hook}
 
 {/hook}
 
 
But It doesn't work. Please help me how to figure this out. 
 
Thanks
 
 
 


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

Posted 24 July 2017 - 01:46 PM #2

app/controllers/frontend/categories.php

 

try to replace

fn_gather_additional_products_data($products, array(
            'get_icon' => true,
            'get_detailed' => true,
            'get_additional' => true,
            'get_options' => true,
            'get_discounts' => true,
            'get_features' => false
        ));

with

fn_gather_additional_products_data($products, array(
            'get_icon' => true,
            'get_detailed' => true,
            'get_additional' => true,
            'get_options' => true,
            'get_discounts' => true,
            'get_features' => true
        ));

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 руб.


 
  • Armita84
  • Member
  • Trial users
  • Join Date: 27-Sep 16
  • 42 posts

Posted 25 July 2017 - 05:14 AM #3

 

app/controllers/frontend/categories.php

 

try to replace

fn_gather_additional_products_data($products, array(
            'get_icon' => true,
            'get_detailed' => true,
            'get_additional' => true,
            'get_options' => true,
            'get_discounts' => true,
            'get_features' => false
        ));

with

fn_gather_additional_products_data($products, array(
            'get_icon' => true,
            'get_detailed' => true,
            'get_additional' => true,
            'get_options' => true,
            'get_discounts' => true,
            'get_features' => true
        ));

Thanks for your answer. I've done that but nothing happened! Should I keep the code I've wrote in grid_list.tpl for brand(I mean brand hook and so on)?

What is the exact code (or variable) I must use in grid_list.tpl to show the brand name after enabling the get_features in controller?

Regards 



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

Posted 25 July 2017 - 07:48 AM #4

Looks like header_features array is used on the product details page only. So revert all changes in the  categories.php and use the following code in the template:

{$product.header_features = $product|fn_get_product_features_list:'H'}
    {include file="views/products/components/product_features_short_list.tpl" features=$product.header_features}

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 руб.


 
  • Armita84
  • Member
  • Trial users
  • Join Date: 27-Sep 16
  • 42 posts

Posted 25 July 2017 - 11:20 AM #5

 

Looks like header_features array is used on the product details page only. So revert all changes in the  categories.php and use the following code in the template:

{$product.header_features = $product|fn_get_product_features_list:'H'}
    {include file="views/products/components/product_features_short_list.tpl" features=$product.header_features}

Thank you so much. The code Works like a charm!  :grin:



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

Posted 25 July 2017 - 01:51 PM #6

You are welcome!


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 руб.