How To Show Specific Html Depends Of Features Value

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?

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

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"}
	This is my: $my-feature1.value

{/foreach}

What I have done wrongly?

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..

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

What about features excluded from: Show in product list - how can I get their value?

What about features excluded from: Show in product list - how can I get their value?

On the product listing features are not retrieved from database regardless of the setting value

Mhm.. how to get them from code?

$product|fn_get_product_features_list

Seems not working.

Try

{$features = $product|fn_get_product_features_list:'C'}
{$features|fn_print_r}