| Server IP : 38.190.208.107 / Your IP : 216.73.217.2 Web Server : nginx/1.28.1 System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64 User : root ( 0) PHP Version : 8.2.28 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/wp.4/wp-content/themes/woodmart/js/scripts/wc/ |
Upload File : |
(function($) {
// WooCommerce update fragments fix.
$(document).ready(function() {
$('body').on('added_to_cart removed_from_cart', function(e, fragments) {
if (fragments) {
$.each(fragments, function(key, value) {
$(key.replace('_wd', '')).replaceWith(value);
});
}
});
});
$('body').on('wc_fragments_refreshed wc_fragments_loaded', function() {
if (typeof wd_cart_fragments_params !== 'undefined' && 'undefined' !== typeof Cookies) {
var wc_fragments = JSON.parse(sessionStorage.getItem(wd_cart_fragments_params.fragment_name)),
cart_hash_key = wd_cart_fragments_params.cart_hash_key,
cart_hash = sessionStorage.getItem(cart_hash_key),
cookie_hash = Cookies.get('woocommerce_cart_hash'),
cart_created = sessionStorage.getItem('wc_cart_created'),
day_in_ms = ( 24 * 60 * 60 * 1000 );
if (cart_hash === null || cart_hash === undefined || cart_hash === '') {
cart_hash = '';
}
if (cookie_hash === null || cookie_hash === undefined || cookie_hash === '') {
cookie_hash = '';
}
if (cart_hash && (cart_created === null || cart_created === undefined || cart_created === '')) {
throw 'No cart_created';
}
if (cart_created) {
var cart_expiration = ((1 * cart_created) + day_in_ms),
timestamp_now = (new Date()).getTime();
if (cart_expiration < timestamp_now) {
throw 'Fragment expired';
}
}
if (wc_fragments && wc_fragments['div.widget_shopping_cart_content'] && cart_hash === cookie_hash) {
$.each(wc_fragments, function(key, value) {
$(key.replace('_wd', '')).replaceWith(value);
});
}
}
});
})(jQuery);