HEX
Server: Apache
System: Linux c119.dattaweb.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: c1190199 (57165)
PHP: 7.4.33
Disabled: mail, system, shell, exec, system_exec, shell_exec, mysql_pconnect, passthru, popen, proc_open, proc_close, proc_nice, proc_terminate, proc_get_status, escapeshellarg, escapeshellcmd, eval, dl, imap_mail, libvirt_connect, gnupg_init, unsetenv, apache_setenv, pcntl_exec, 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_getpriority, pcntl_setpriority, pcntl_async_signals, opcache_get_status, opcache_reset, opcache_get_configuration
Upload Files
File: /home/c1190199/public_html/_alex/wp-content/themes/portada/class/Theme.WooCommerce.class.php
<?php

/******************************************************************************/
/******************************************************************************/

class Portada_ThemeWooCommerce
{
	/**************************************************************************/
	
	function __construct()
	{
		
	}
	
	/**************************************************************************/
	
	function addAction()
	{
		remove_action('woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title');
		remove_action('woocommerce_single_product_summary','woocommerce_template_single_price');
		remove_action('woocommerce_single_product_summary','woocommerce_template_single_rating');

		add_action('woocommerce_shop_loop_item_title',array($this,'shopLoopItemTitle'));	
		add_action('woocommerce_single_product_summary','woocommerce_template_single_price',5);	
		add_action('woocommerce_single_product_summary','woocommerce_template_single_rating',10);	
		
		add_action('wp_enqueue_scripts',array($this,'wpEnqueueScripts'));
		
		add_action('wp_ajax_cart_count_get',array($this,'getCartCount'));
		add_action('wp_ajax_nopriv_cart_count_get',array($this,'getCartCount'));
	}
	
	/**************************************************************************/
	
	function addFilter()
	{
		add_filter('loop_shop_columns',array($this,'loopColumn'));
		add_filter('loop_shop_per_page',array($this,'loopShopPerPage'));
		add_filter('woocommerce_single_product_image_html',array($this,'woocommerceSingleProductImageHtml'));
		add_filter('woocommerce_single_product_image_thumbnail_html',array($this,'woocommerceSingleProductImageHtml'));
		add_filter('wc_add_to_cart_message_html',array($this,'wcAddToCartMessageHtml'));
	}
	
	/**************************************************************************/
	
	function wpEnqueueScripts()
	{
		wp_dequeue_style('woocommerce_prettyPhoto_css');
        wp_dequeue_script('prettyPhoto');
        wp_dequeue_script('prettyPhoto-init');
        
        wp_dequeue_style('select2');
        wp_deregister_style('select2');
        wp_dequeue_script('select2');
        wp_deregister_script('select2');
	}
	
	/**************************************************************************/
	
	function woocommerceSingleProductImageHtml($html)
	{
		$html=str_replace('data-rel="prettyPhoto','',$html);
		return('<div class="pb-image-type-image pb-image-box pb-image-preloader-enable">'.$html.'</div>');
	}
	
	/**************************************************************************/
 
	function wcAddToCartMessageHtml($message) 
	{
		$message='<span class="theme-wc-add-to-cart-notice">'.$message.'</span>';
		return($message);
	}
	
	/**************************************************************************/
	
	function loopColumn()
	{
		return(3);
	}
	
	/**************************************************************************/
	
	function loopShopPerPage()
	{
		return(6);
	}
	
	/**************************************************************************/
	
	function shopLoopItemTitle()
	{
		echo '<h3>'.get_the_title().'</h3>';
	}

	/**************************************************************************/
	
	function isWooCommercePost()
	{
		if(!Portada_ThemePlugin::isActive('WooCommerce')) return(false);		
		return((is_woocommerce()) || (is_cart()) || (is_checkout()) || (is_account_page()));
	}
	
	/**************************************************************************/
	
	function isWooCommerceSingleProduct()
	{
		if(!Portada_ThemePlugin::isActive('WooCommerce')) return(false);
		return(get_post_type()=='product');
	}
	
	/**************************************************************************/
	
	function getProductListLayout()
	{
		global $portada_sidebarEnable;
		return($portada_sidebarEnable ? '50x50' : '33x33x33');
	}
	
	/**************************************************************************/
	
	function getCartCount()
	{
		global $woocommerce;
		
		$response=array('count'=>(int)$woocommerce->cart->cart_contents_count);
		
		echo json_encode($response);
		exit;
	}
	
	/**************************************************************************/
}

/******************************************************************************/
/******************************************************************************/