HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: 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_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wppartneramazingsecret/wp-content/themes/themify-ultra/js/modules/sticky-add-cart.js
/**
 * Sticky Buy Button
 */
;
(function(Themify, themify_vars, $){
	'use strict';
	const _init = function(wrap){
			const pr_wrap = document.querySelector('#content .product');
			if(pr_wrap){
				Themify.LoadCss(themify_vars.theme_url + '/styles/wc/modules/single/sticky-add-cart.css', themify_vars.theme_v, null, null, function(){
					const container = document.createElement('div'),
					product = document.createElement('div'),
					summary = document.createElement('div'),
					gallery = document.createElement('div'),
					ind = document.getElementById('tf_sticky_form_wrap');
					container.className = 'tf_box pagewidth tf_clearfix';
					product.id = pr_wrap.id;
					product.className = pr_wrap.classList;
					// Image
					gallery.className = 'images';
					gallery.appendChild(pr_wrap.getElementsByClassName('woocommerce-product-gallery__image')[0].cloneNode(true));
					product.appendChild(gallery);
					summary.className = 'summary entry-summary';
					// Title
					summary.appendChild(document.querySelector('.product .product_title').cloneNode(true));
					// Price
					summary.appendChild(document.querySelector('.product .price').cloneNode(true));
					// Form
					const pr_form = pr_wrap.querySelector('form.cart');
					ind.style.height = pr_form.getBoundingClientRect().height+'px';
					summary.appendChild(pr_form);
					product.appendChild(summary);
					wrap.dataset.url = '';
					container.appendChild(product);
					wrap.appendChild(container);
					wrap.classList.add('tf_st_show');
				});
			}
		},
		_move_form = function(el, act){
			const obs_el = document.getElementById('tf_sticky_form_wrap'),
				form = 'hide' === act ? el.querySelector('form.cart') : document.querySelector('form.cart');
			if(!form){
				return;
			}
			if('hide' === act){
				obs_el.appendChild(form);
				obs_el.style.height = null;
			}else{
				const ind = el.getElementsByClassName('images')[0];
				obs_el.style.height = form.getBoundingClientRect().height+'px';
				ind.parentNode.insertBefore(form, ind.nextSibling);
			}
			const $var_form = $('.variations_form');
			if($var_form.length>0){
				$var_form.trigger( 'check_variations' );
			}
		};
	Themify.on('themify_theme_sticky_add_cart_init', function(el){
		_init(el);
	}).on('themify_theme_sticky_add_cart_switched', function(el, act){
		_move_form(el, act);
	});

})(Themify, themify_vars, jQuery);