Refactor CSS and JavaScript for product comparison and wishlist functionality
- Updated `dr_materac.scss` to hide the compare/wishlist button by default. - Enhanced JavaScript in `detail1526395446.tpl` to safely add an event listener for the opinions section link, ensuring it only attaches if the element exists. - Cleaned up the `product-add-to-cart.tpl` by uncommenting the compare/wishlist button section for better visibility in the UI.
This commit is contained in:
@@ -48,47 +48,6 @@
|
||||
});
|
||||
|
||||
{else if ($tagType === 'cart')}
|
||||
|
||||
console.log('Fired up event GA4: begin_checkout');
|
||||
if (window.location.hostname === "lulandia.pl") {
|
||||
gtag('event', 'conversion', {
|
||||
'send_to': 'AW-11243281264/Gs-KCNqSsesYEPC2m_Ep',
|
||||
'value': {$content_value|escape:'htmlall':'UTF-8'},
|
||||
'currency': 'PLN'
|
||||
});
|
||||
console.log( 'Fired up event GADS begin_checkout conversion lulandia.pl' );
|
||||
}
|
||||
gtag('event', 'begin_checkout', {
|
||||
coupon: '{$content_coupon|escape:'htmlall':'UTF-8'}',
|
||||
currency: '{$currency|escape:'htmlall':'UTF-8'}',
|
||||
items: [
|
||||
{foreach from=$content_products item=product name=products}
|
||||
{
|
||||
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
|
||||
item_name: '{$product.name|escape:'htmlall':'UTF-8'}',
|
||||
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
|
||||
discount: {$product.discount|escape:'htmlall':'UTF-8'},
|
||||
index: {$smarty.foreach.products.index},
|
||||
item_list_name: 'Cart products',
|
||||
item_list_id: 1,
|
||||
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
|
||||
item_brand: '{$product.manufacturer_name|escape:'htmlall':'UTF-8'}',
|
||||
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
|
||||
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
|
||||
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
|
||||
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
|
||||
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
|
||||
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
|
||||
price: {$product.price|escape:'htmlall':'UTF-8'},
|
||||
currency: '{$currency|escape:'htmlall':'UTF-8'}',
|
||||
quantity: '{$product.cart_quantity|escape:'htmlall':'UTF-8'}'
|
||||
},
|
||||
{/foreach}
|
||||
],
|
||||
value: {$content_value|escape:'htmlall':'UTF-8'}
|
||||
});
|
||||
|
||||
|
||||
console.log('Fired up event GA4: view_cart');
|
||||
gtag('event', 'view_cart', {
|
||||
currency: '{$currency|escape:'htmlall':'UTF-8'}',
|
||||
@@ -159,37 +118,6 @@
|
||||
],
|
||||
value: {$content_value|escape:'htmlall':'UTF-8'}
|
||||
});
|
||||
|
||||
console.log('Fired up event GA4: view_cart');
|
||||
gtag('event', 'view_cart', {
|
||||
currency: '{$currency|escape:'htmlall':'UTF-8'}',
|
||||
items: [
|
||||
{foreach from=$content_products item=product name=products}
|
||||
{
|
||||
item_id: '{$product.content_ids|escape:'htmlall':'UTF-8'}',
|
||||
item_name: '{$product.name|escape:'htmlall':'UTF-8'}',
|
||||
coupon: '{$product.content_coupon|escape:'htmlall':'UTF-8'}',
|
||||
discount: {$product.discount|escape:'htmlall':'UTF-8'},
|
||||
index: {$smarty.foreach.products.index},
|
||||
item_list_name: 'Cart products',
|
||||
item_list_id: 1,
|
||||
affiliation: '{$http_referer|escape:'htmlall':'UTF-8'}',
|
||||
item_brand: '{$product.manufacturer_name|escape:'htmlall':'UTF-8'}',
|
||||
item_category: '{$product.content_category|escape:'htmlall':'UTF-8'}',
|
||||
{if !empty($product.content_category2)}item_category2: '{$product.content_category2|escape:'htmlall':'UTF-8'}',{/if}
|
||||
{if !empty($product.content_category3)}item_category3: '{$product.content_category3|escape:'htmlall':'UTF-8'}',{/if}
|
||||
{if !empty($product.content_category4)}item_category4: '{$product.content_category4|escape:'htmlall':'UTF-8'}',{/if}
|
||||
{if !empty($product.content_category5)}item_category5: '{$product.content_category5|escape:'htmlall':'UTF-8'}',{/if}
|
||||
item_variant: '{if isset($product.variant)}{$product.variant}{/if}',
|
||||
price: {$product.price|escape:'htmlall':'UTF-8'},
|
||||
currency: '{$currency|escape:'htmlall':'UTF-8'}',
|
||||
quantity: '{$product.cart_quantity|escape:'htmlall':'UTF-8'}'
|
||||
},
|
||||
{/foreach}
|
||||
],
|
||||
value: {$content_value|escape:'htmlall':'UTF-8'}
|
||||
});
|
||||
|
||||
{else if ($tagType === 'category')}
|
||||
|
||||
console.log('Fired up event GA4: view_item_list > Category products list page');
|
||||
|
||||
Reference in New Issue
Block a user