Amazon Search Widget In Cs-Cart Block

Amazon search widget is a small js script that shows relevant Amazon products on your pages with affiliate links back to them.

I need it to be shown in the categories content frame and to have as default search keywords my CS-Cart parent category and the current category, separated by coma

This is the script


Please, send me your quotes in a personal message here on site.

Try to add HTML block with SMARTY support to the Categories layout page

{$parent_keywords = ''}
{if $category_data.parent_id}
    {$parent_category = $category_data.parent_id|fn_get_category_data}
    {if $parent_category.meta_keywords}
        {$parent_keywords = $parent_category.meta_keywords}
    {/if}
{/if}

(!) Not tested

Try to add HTML block with SMARTY support to the Categories layout page

.....

(!) Not tested

It works like a charm, only I have to tweak my meta keywords, as now they include by default all parent categories

{{ parent_categories|join(", ") }}

and there are many repetitions, depending on the category depth. But if I change category_data to category_name, repetitions disappear and only the meta keywords of the proper child category are displayed.

The only problem is that the script goes to the bottom of the page as all inline scripts seem to be moved there by CS-Cart. Sent you a PM...

In any case, a big Thank you!

Please take a look

https://docs.cs-cart.com/4.9.x/user_guide/look_and_feel/changing_attributes/script_display.html

"data-no-defer" worked fine, added it two times

This time I have to buy you a box of Guinnes. Please, send me your PayPal mail.

Please check PM :)