Jump to content

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

Amazon Search Widget In Cs-Cart Block Rate Topic   - - - - -

 
  • imago
  • Advanced Member
  • Members
  • Join Date: 18-Oct 18
  • 116 posts

Posted 02 December 2018 - 06:47 AM #1

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

<script type="text/javascript">amzn_assoc_ad_type ="responsive_search_widget"; amzn_assoc_tracking_id ="myaffid-21"; amzn_assoc_marketplace ="amazon"; amzn_assoc_region ="GB"; amzn_assoc_placement =""; amzn_assoc_search_type = "search_widget";amzn_assoc_width ="auto"; amzn_assoc_height ="auto"; amzn_assoc_default_search_category ="Books"; amzn_assoc_default_search_key ="$parent_category, $category";amzn_assoc_theme ="light"; amzn_assoc_bg_color ="FFFFFF"; </script><script src="//z-eu.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1&Marketplace=GB"></script>

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



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

Posted 03 December 2018 - 06:02 AM #2

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}
<script type="text/javascript">
amzn_assoc_ad_type ="responsive_search_widget"; 
amzn_assoc_tracking_id ="myaffid-21"; 
amzn_assoc_marketplace ="amazon"; 
amzn_assoc_region ="GB"; 
amzn_assoc_placement =""; 
amzn_assoc_search_type = "search_widget";
amzn_assoc_width ="auto"; 
amzn_assoc_height ="auto"; 
amzn_assoc_default_search_category ="Books"; 
amzn_assoc_default_search_key ="{if $parent_keywords}{$parent_keywords},{/if} {$meta_keywords|default:$location_data.meta_keywords}";
amzn_assoc_theme ="light"; 
amzn_assoc_bg_color ="FFFFFF"; 
</script>
<script src="//z-eu.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&Operation=GetScript&ID=OneJS&WS=1&Marketplace=GB"></script>

(!) Not tested


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


 
  • imago
  • Advanced Member
  • Members
  • Join Date: 18-Oct 18
  • 116 posts

Posted 03 December 2018 - 07:50 AM #3

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! 



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

Posted 03 December 2018 - 01:13 PM #4

Please take a look

 

https://docs.cs-cart...pt_display.html


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


 
  • imago
  • Advanced Member
  • Members
  • Join Date: 18-Oct 18
  • 116 posts

Posted 03 December 2018 - 01:42 PM #5

 

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



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

Posted 04 December 2018 - 05:18 AM #6

Please check PM :)


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