![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/store.cartinsight.co/wp-content/themes/woodmart/js/scripts/wc/ |
/* global woodmart_settings */ (function($) { woodmartThemeModule.productRecentlyViewed = function() { $('.wd-products-element .products, .wd-carousel-container.products').each( function () { var $this = $(this); var attr = $this.data('atts'); if ( 'undefined' === typeof attr || 'undefined' === typeof attr.post_type || 'recently_viewed' !== attr.post_type || 'undefined' === typeof attr.ajax_recently_viewed || 'yes' !== attr.ajax_recently_viewed ) { return; } $.ajax({ url : woodmart_settings.ajaxurl, data : { attr : attr, action: 'woodmart_get_recently_viewed_products' }, dataType: 'json', method : 'POST', success : function(data) { if (data.items) { woodmartThemeModule.removeDuplicatedStylesFromHTML(data.items, function(html) { if ( $this.hasClass('wd-carousel-container') && $this.parents('.elementor-widget-container').length ) { $this.replaceWith(html); } else { $this.parent().replaceWith(html); } woodmartThemeModule.$document.trigger('wdRecentlyViewedProductLoaded'); woodmartThemeModule.$document.trigger('wood-images-loaded'); }); } }, error : function() { console.log('ajax error'); }, }); }) }; $(document).ready(function() { woodmartThemeModule.productRecentlyViewed(); }); })(jQuery);