Clickable Product Features For Cs-Cart 4.2X

Hi all, I was wondering if anybody happens to have this piece of code ready?



Like the code here posted by Brandon, for cs-cart 2: How to do this - Questions - CS-Cart Forums



Might make a nice add-on too!

I'm interested as well. Def need this.

Good day



Unfortunately, no links work in that thread. Please give us more details about the required functionality. Most possibly we will be able to help you.

It's real simple. Under the features tab is usually a list with features of the products, right? For example you're looking at a running shoe. Features could be:



Leather

Suitable for running marathon



Now if one would click on “leather” they would get a page that describes the feature, like:



LEATHER

The shoes below are made from genuine leather. Leather is the most comfortable fabric for shoes, because it breaths and it is strong.



And then a list with products that shows all products with that feature starts.



That's it. Great SEO stuff and used to be pretty simple to make for version 2.

Floris,



It is pretty much the same thing. In design/themes/your-theme/templates/views/products/components/product_features.tpl



Replace the whole file with"


{foreach from=$product_features item="feature"}
{if $feature.feature_type != "G"}


{if $feature.full_description|trim}{include file="common/help.tpl" text=$feature.description content=$feature.full_description id=$feature.feature_id show_brackets=true wysiwyg=true}{/if}


{if $feature.feature_type == "M"}
{assign var="hide_affix" value=true}
{else}
{assign var="hide_affix" value=false}
{/if}

{strip}

{if $feature.prefix && !$hide_affix}{$feature.prefix}{/if}
{if $feature.feature_type == "C"}
{if $feature.value == "Y"}{/if}
{elseif $feature.feature_type == "D"}
{$feature.value_int|date_format:"`$settings.Appearance.date_format`"}
{elseif $feature.feature_type == "M" && $feature.variants}

{elseif $feature.feature_type == "E"}

{elseif $feature.feature_type == "S"}
{foreach from=$feature.variants item="var"}
{if $var.selected}{$var.variant}{/if}
{/foreach}
{elseif $feature.feature_type == "N" || $feature.feature_type == "O"}
{$feature.value_int|floatval|default:"-"}
{else}
{$feature.value|default:"-"}
{/if}
{if $feature.suffix && !$hide_affix}{$feature.suffix}{/if}

{/strip}

{/if}
{/foreach}

{foreach from=$product_features item="feature"}
{if $feature.feature_type == "G" && $feature.subfeatures}
{include file="common/subheader.tpl" title=$feature.description tooltip=$feature.full_description text=$feature.description}
{include file="views/products/components/product_features.tpl" product_features=$feature.subfeatures}
{/if}
{/foreach}




I hope that helps.



Thanks,



Brandon

Thanks Brandon!! :)

Argh I clicked the red button by mistake… I can’t undo that?!

[quote name=‘Flow’ timestamp=‘1409817003’ post=‘191436’]

Thanks Brandon!! :)

Argh I clicked the red button by mistake… I can’t undo that?!

[/quote]



I vote it up so it’s even now. :)

[quote name=‘cscartrocks’ timestamp=‘1409817692’ post=‘191439’]

I vote it up so it’s even now. :)

[/quote]



Yay

There are some bugs in the code above:

It makes the feature 'brand' show as a list instead of a single line

It adds line breaks between feature name and feature value.

It makes html show up.

It empties the question mark popup on product pages.



If anyone is up for it, I would be interested to pool together to get the above as an addon with the bugs fixed. .

just sharing what i did for 4.2.x. I wanted the brand name in the product header to link to the variants page.





under templates / views / products / components / product_features_short_list.tpl



i replaced this

$product.main_category&features_hash=$feature.features_hash”|fn_url}”>



with

$feature.variant_id”|fn_url}”>



so far works fine for me

The clickable variant links work nicely except I'm noticing that the page load time is rather long.



Are such pages currently being cached by CS-Cart?