What's New
This topic contains 4 replies, has 2 voices, and was last updated by cygnet.rdmehta May '19.
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.
Tagged: stattributes module
This topic contains 4 replies, has 2 voices, and was last updated by cygnet.rdmehta May '19.
Hello Support Team- Hope you guys are doing well!
I need one help from your end, I’m using your module stattribute on listing page. On your demo page you have demonstrated on click on color swatcher its redirecting to product details page with combination link. Can you please help us to know how to get variant links on color swatcher. Looking forward for your valuable response.
Note : we are using prestashop version 1.7.5.1
Thanks in Advance.
Regadrs,
Rahil Mehta
Hello,
That’s a native feature of PrestaShop, it’s achieved by this code in the 7\themes\classic\templates\catalog\_partials\miniatures\product.tpl file.
{block name='product_variants'}
{if $product.main_variants}
{include file='catalog/_partials/variant-links.tpl' variants=$product.main_variants}
{/if}
{/block}
Hey Jonny! Good Morning! Thanks for your prompt reply!
I already have your shared code in my product.tpl file, can you please help me to know, how I can get on in color swatcher <Span>? Its code is given below.
<span class=”st_attr_list_swatch” title=”{$group_attribute}” style=”{if $group.colors[$id_attribute][‘type’]}background-image: url(‘{$group.colors[$id_attribute][‘value’]}’);{else}background-color:{$group.colors[$id_attribute][‘value’]};{/if}”></span>
I want code on /modules/stattributelist/views/templates/hook/front.tpl.
Regards,
Rahil Mehta
Then I guess, you must have knowledge of php.
But I don’t understand, why don’t you just use $product.main_variants to display colors out? Because colors in the $product.main_variants variable come with links by default.
It requires quite a lot work to add links to the colors generated by the stattributelist module.
There is an alternative way to make stattributelist module be able to use links in the $product.main_variants variable. You need to modify the \src\Core\Product\ProductPresenter.php file for a little to don’t unset the “id_attribute”, see attached pic. The colors generated by the stattributelist module also have “id_attribute”.
You must be logged in to reply to this topic.