���� JFIF fdasasfas213sdaf
Server IP : 93.127.173.53 / Your IP : 216.73.216.222 Web Server : LiteSpeed System : Linux in-mum-web669.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64 User : u479334040 ( 479334040) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/u479334040/domains/advertsphere.in/public_html/wp-content/themes/woodmart/ |
Upload File : |
<?php /** * * The framework's functions and definitions */ update_option( 'woodmart_is_activated', '1' ); define( 'WOODMART_THEME_DIR', get_template_directory_uri() ); define( 'WOODMART_THEMEROOT', get_template_directory() ); define( 'WOODMART_IMAGES', WOODMART_THEME_DIR . '/images' ); define( 'WOODMART_SCRIPTS', WOODMART_THEME_DIR . '/js' ); define( 'WOODMART_STYLES', WOODMART_THEME_DIR . '/css' ); define( 'WOODMART_FRAMEWORK', '/inc' ); define( 'WOODMART_DUMMY', WOODMART_THEME_DIR . '/inc/dummy-content' ); define( 'WOODMART_CLASSES', WOODMART_THEMEROOT . '/inc/classes' ); define( 'WOODMART_CONFIGS', WOODMART_THEMEROOT . '/inc/configs' ); define( 'WOODMART_HEADER_BUILDER', WOODMART_THEME_DIR . '/inc/header-builder' ); define( 'WOODMART_ASSETS', WOODMART_THEME_DIR . '/inc/admin/assets' ); define( 'WOODMART_ASSETS_IMAGES', WOODMART_ASSETS . '/images' ); define( 'WOODMART_API_URL', 'https://xtemos.com/wp-json/xts/v1/' ); define( 'WOODMART_DEMO_URL', 'https://woodmart.xtemos.com/' ); define( 'WOODMART_PLUGINS_URL', WOODMART_DEMO_URL . 'plugins/' ); define( 'WOODMART_DUMMY_URL', WOODMART_DEMO_URL . 'dummy-content-new/' ); define( 'WOODMART_TOOLTIP_URL', WOODMART_DEMO_URL . 'theme-settings-tooltips/' ); define( 'WOODMART_SLUG', 'woodmart' ); define( 'WOODMART_CORE_VERSION', '1.0.44' ); define( 'WOODMART_WPB_CSS_VERSION', '1.0.2' ); if ( ! function_exists( 'woodmart_load_classes' ) ) { function woodmart_load_classes() { $classes = array( 'class-singleton.php', 'class-api.php', 'class-config.php', 'class-layout.php', 'class-autoupdates.php', 'class-activation.php', 'class-notices.php', 'class-theme.php', 'class-registry.php', ); foreach ( $classes as $class ) { require WOODMART_CLASSES . DIRECTORY_SEPARATOR . $class; } } } woodmart_load_classes(); new XTS\Theme(); define( 'WOODMART_VERSION', woodmart_get_theme_info( 'Version' ) ); add_action('wp_enqueue_scripts', function() { // Make sure jQuery is loaded wp_enqueue_script('jquery'); // Add dummy handle for our custom inline JS wp_register_script('custom-size-pricing', '', [], false, true); wp_enqueue_script('custom-size-pricing'); $price_per_sqft = floatval(get_option('custom_price_per_sqft', 100)); $currency_symbol = get_woocommerce_currency_symbol(); $inline_js = <<<JS jQuery(document).ready(function($) { var pricePerSqFt = {$price_per_sqft}; var currencySymbol = '{$currency_symbol}'; var originalPrice = parseFloat($('.price bdi').text().replace(/[^\\d.]/g, '')) || 0; function formatPrice(price) { return currencySymbol + price.toFixed(2); } function updatePrice() { var selectedSize = $('#custom_size_select').val(); var area = 0; if (selectedSize === 'custom') { var width = parseFloat($('#custom_width').val()) || 0; var height = parseFloat($('#custom_height').val()) || 0; area = width * height; } else { var dims = selectedSize.split('x'); if (dims.length === 2) { var w = parseFloat(dims[0]); var h = parseFloat(dims[1]); if (!isNaN(w) && !isNaN(h)) { area = w * h; } } } if (area > 0) { var newPrice = pricePerSqFt * area; $('.price bdi').text(formatPrice(newPrice)); } else { $('.price bdi').text(formatPrice(originalPrice)); } } $('#custom_size_select').on('change', function() { if ($(this).val() === 'custom') { $('#custom_size_fields').show(); } else { $('#custom_size_fields').hide(); } console.log('Dropdown changed'); updatePrice(); }); $('#custom_width, #custom_height').on('input', updatePrice); // Trigger once on page load $('#custom_size_select').trigger('change'); }); JS; wp_add_inline_script('custom-size-pricing', $inline_js); }); add_filter('woocommerce_get_price_html', 'add_per_sq_unit_to_loop_price', 20, 2); function add_per_sq_unit_to_loop_price($price, $product) { if (is_shop() || is_product_category() || is_product_tag()) { $price .= ' <span class="per-sq-unit">/per sq unit</span>'; } return $price; }