תיאור
ADIDAS HOODIES MEN
// Enqueue styles for child theme add_action('wp_enqueue_scripts', 'child_theme_enqueue_styles', 1000); function child_theme_enqueue_styles() { wp_enqueue_style('child-style', get_stylesheet_directory_uri() . '/style.css', array('zorka_style-min')); } // Removes Order Notes Title - Additional Information & Notes Field add_filter('woocommerce_enable_order_notes_field', '__return_false', 9999); // Remove Order Notes Field add_filter('woocommerce_checkout_fields', 'remove_order_notes'); function remove_order_notes($fields) { unset($fields['order']['order_comments']); return $fields; } // Move product summary under woocommerce product meta end remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20); add_action('woocommerce_product_meta_end', 'woocommerce_template_single_excerpt', 60); // Cookies set and delete function wpb_cookies_tutorial2() { $visit_time = date('F j, Y g:i a'); if (isset($_COOKIE['wpb_visit_time'])) { function visitor_greeting() { $lastvisit = $_COOKIE['wpb_visit_time']; $string = 'You last visited our website ' . $lastvisit . '. Check out whats new'; unset($_COOKIE['wpb_visit_time']); return $string; } } else { function visitor_greeting() { $string = 'New here? Check out these resources...'; return $string; } } add_shortcode('greet_me', 'visitor_greeting'); setcookie('wpb_visit_time', $visit_time, time() + 315); } add_action('init', 'wpb_cookies_tutorial2'); // Change "FREE SHIPPING" to "משלוח חינם" with debugging add_filter('gettext', 'change_shipping_text_debug', 20, 3); function change_shipping_text_debug($translated_text, $text, $domain) { if ($translated_text === 'Free Shipping') { $translated_text = 'משלוח חינם'; } return $translated_text; } add_filter('woocommerce_cart_shipping_method_full_label', 'change_free_shipping_label_full_debug', 10, 2); function change_free_shipping_label_full_debug($label, $method) { if (strpos($label, 'Free Shipping') !== false) { $label = str_replace('Free Shipping', 'משלוח חינם', $label); } return $label; } // Add products to cart from URL parameters and handle cart redirection add_action('template_redirect', 'add_cart_items_from_url'); function add_cart_items_from_url() { // Check if the URL has "add-to-cart" and "quantity" parameters if (isset($_GET['add-to-cart']) && isset($_GET['quantity'])) { $product_id = (int) $_GET['add-to-cart']; $quantity = (int) $_GET['quantity']; // Add the product to the cart WC()->cart->add_to_cart($product_id, $quantity); // Redirect to the secondary website with the added product $secondary_url = 'https://www.danmordiamonds.co.il/?add-to-cart=' . $product_id . '&quantity=' . $quantity; wp_redirect($secondary_url); exit; } } // Add products to cart on the secondary site from URL parameters add_action('init', 'add_products_from_url_to_cart'); function add_products_from_url_to_cart() { if (isset($_GET['add-to-cart']) && isset($_GET['quantity'])) { $product_id = (int) $_GET['add-to-cart']; $quantity = (int) $_GET['quantity']; // Ensure WooCommerce is active before adding to the cart if (class_exists('WooCommerce')) { // Make sure the cart is initialized before attempting to add the product if (!WC()->cart) { WC()->cart = new WC_Cart(); } WC()->cart->add_to_cart($product_id, $quantity); } } } ?>
ADIDAS HOODIES MEN