Jump to content

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

How To Show Specific Html Depends Of Features Value Rate Topic   - - - - -

 
  • HareRama
  • Advanced Member
  • Trial users
  • Join Date: 10-Mar 19
  • 72 posts

Posted 05 June 2019 - 08:37 AM #1

Hi,

I am new with CS-Cart but quiet experienced with open-source WP. I want to learn how to show specific HTML code depends of features value (product listing). For example some if I feature "Code" has value: "XYZ" show on website this information: "ABC". I want to connect it with tabs, so use Smarty for that?

 



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

Posted 05 June 2019 - 02:00 PM #2

Hi,

I am new with CS-Cart but quiet experienced with open-source WP. I want to learn how to show specific HTML code depends of features value (product listing). For example some if I feature "Code" has value: "XYZ" show on website this information: "ABC". I want to connect it with tabs, so use Smarty for that?

 

Yes, you should use smarty (for example, create HTML block with Smarty support and put it to the product tab). All features can be found in the $product.product_features and $product.header_features arrays


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


 
  • HareRama
  • Advanced Member
  • Trial users
  • Join Date: 10-Mar 19
  • 72 posts

Posted 18 August 2019 - 04:37 AM #3

I found some examples on forums but it doesn't work. So edited: modern_template.tpl and injected:

{foreach from=$product.product_features item="my-feature1"}
	
		<strong>This is my: $my-feature1.value</strong>
	
{/foreach}

What I have done wrongly?



 
  • HareRama
  • Advanced Member
  • Trial users
  • Join Date: 10-Mar 19
  • 72 posts

Posted 18 August 2019 - 06:10 AM #4

Should be:

 {$features = $product|fn_get_product_features_list}
    {foreach from=$features item="feature"}
        {if $feature.description == "my-feature1"}
            {$feature.variant}    
        {/if}
    {/foreach}

Btw. clearing cache doesn't work with Unitheme - you have to remove files from cache localization, otherwise no updates if you editing template / override or replace..



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

Posted 19 August 2019 - 06:21 AM #5

Btw. clearing cache doesn't work with Unitheme - you have to remove files from cache localization, otherwise no updates if you editing template / override or replace..

 

Such issues usually caused by wrong permissions or ownership


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