This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(!function_exists('woocommerce_subscription_upfront_allow_for_non_recurring_plan_method')){ | |
| function woocommerce_subscription_upfront_allow_for_non_recurring_plan_method($allow){ | |
| return true; | |
| } | |
| } | |
| add_filter('woocommerce_subscription_upfront_allow_for_non_recurring_plan', 'woocommerce_subscription_upfront_allow_for_non_recurring_plan_method', 10); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(!function_exists('woo_discount_rules_price_strikeout_after_discount_price_method')){ | |
| function woo_discount_rules_price_strikeout_after_discount_price_method($item_price, $product){ | |
| $item_price = 'From: '.$item_price; | |
| $item_price = str_replace('</del> <ins>', '</del> From:<ins>', $item_price); | |
| return $item_price; | |
| } | |
| } | |
| add_filter('woo_discount_rules_price_strikeout_after_discount_price', 'woo_discount_rules_price_strikeout_after_discount_price_method', 10, 2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('woo_discount_rules_cart_rules_after_adding_free_product_to_cart', function (){ | |
| add_action('woocommerce_before_cart', function (){ | |
| ?> | |
| <script type="text/javascript"> | |
| jQuery( document ).ready(function() { | |
| jQuery("[name='update_cart']").removeAttr('disabled'); | |
| jQuery("[name='update_cart']").trigger("click"); | |
| }); | |
| </script> | |
| <?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(!function_exists('woo_discount_rules_price_strikeout_after_discount_price_method')){ | |
| function woo_discount_rules_price_strikeout_after_discount_price_method($item_price, $product){ | |
| if($product->is_type( 'variable' )) { | |
| $item_price = 'From: '.$item_price; | |
| $item_price = str_replace('</del> <ins>', '</del> From:<ins>', $item_price); | |
| } | |
| return $item_price; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * List matched Rules in Table format | |
| * | |
| * This template can be overridden by copying it to yourtheme/plugin-folder-name/discount-table.php | |
| */ | |
| if (!defined('ABSPATH')) exit; // Exit if accessed directly | |
| if (!isset($table_data) || empty($table_data)) return false; | |
| $base_config = (is_string($data)) ? json_decode($data, true) : (is_array($data) ? $data : array()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Email Order Items | |
| * | |
| * This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-items.php. | |
| * | |
| * HOWEVER, on occasion WooCommerce will need to update template files and you | |
| * (the theme developer) will need to copy the new files to your theme to | |
| * maintain compatibility. We try to do this as little as possible, but it does | |
| * happen. When this occurs the version of the template file will be bumped and |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('woocommerce_before_cart', function (){ | |
| ?> | |
| <script type="text/javascript"> | |
| jQuery( document.body ).on( 'updated_cart_totals', function() { | |
| location.reload(); | |
| }); | |
| </script> | |
| <?php | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action('woocommerce_applied_coupon', function (){ | |
| add_action('woocommerce_before_cart', function (){ | |
| ?> | |
| <script type="text/javascript"> | |
| jQuery( document ).ready(function() { | |
| jQuery("[name='update_cart']").removeAttr('disabled'); | |
| jQuery("[name='update_cart']").trigger("click"); | |
| }); | |
| </script> | |
| <?php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(!function_exists('woo_discount_rules_compatible_with_villa_theme_currency_switcher')){ | |
| function woo_discount_rules_compatible_with_villa_theme_currency_switcher($price, $is_cart = false, $discount_type = 'percentage_discount'){ | |
| $process_conversion = true; | |
| if($is_cart === true){ | |
| if($discount_type !== 'percentage_discount'){ | |
| $process_conversion = false; | |
| } | |
| } | |
| if($process_conversion){ | |
| $class_exists = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if(!function_exists('woo_discount_rules_exclude_cart_item_from_discount_method')){ | |
| function woo_discount_rules_exclude_cart_item_from_discount_method($status, $cart_item){ | |
| if(isset($cart_item['composite_item']) && !empty($cart_item['composite_item'])){ | |
| $status = true; | |
| } | |
| return $status; | |
| } | |
| } | |
| add_filter('woo_discount_rules_exclude_cart_item_from_discount', 'woo_discount_rules_exclude_cart_item_from_discount_method', 10, 2); |