This file contains 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 | |
/** | |
* Custom code shortcode | |
* | |
* This template can be overridden by copying it to yourtheme/plugin-folder-name/woo_mail/custom_code.php. | |
* @var $order WooCommerce order | |
* @var $email_id WooCommerce email id (new_order, cancelled_order) | |
* @var $sent_to_admin WooCommerce email send to admin | |
* @var $plain_text WooCommerce email format | |
* @var $email WooCommerce email object |
This file contains 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 | |
/** | |
* Order details table shown in emails. | |
* | |
* This template can be overridden by copying it to yourtheme/woocommerce/emails/email-order-details.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 the readme will list any important changes. |
This file contains 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 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_run_variation_strikeout_through_ajax_method')){ | |
function woo_discount_rules_run_variation_strikeout_through_ajax_method($do_ajax){ | |
return false; | |
} | |
} | |
add_filter('woo_discount_rules_run_variation_strikeout_through_ajax', 'woo_discount_rules_run_variation_strikeout_through_ajax_method'); | |
if(!function_exists('woo_discount_rules_run_variation_strike_out_with_ajax_method')){ | |
/** |
This file contains 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_rule_check_in_all_selected_attributes_method')){ | |
/** | |
* Rule based on all attributes | |
* | |
* @param boolean $in_all_attribute | |
* @param int $rule_order_id | |
* @return boolean | |
* */ | |
function woo_discount_rules_price_rule_check_in_all_selected_attributes_method($in_all_attribute, $rule_order_id){ | |
return true; |
This file contains 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_has_price_override_method')){ | |
function woo_discount_rules_has_price_override_method($has_price_override, $product, $on_apply_discount){ | |
if($on_apply_discount == 'on_apply_discount') $has_price_override = true; | |
return $has_price_override; | |
} | |
} | |
add_filter('woo_discount_rules_has_price_override', 'woo_discount_rules_has_price_override_method', 10, 3); | |
function woo_discount_rules_price_rule_final_amount_applied_method($discountedPrice, $price, $discount, $additionalDetails, $product, $product_page){ | |
if($discountedPrice < 0) $discountedPrice = 0; |
This file contains 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_remove_event_woocommerce_before_calculate_totals_method')){ | |
function woo_discount_rules_remove_event_woocommerce_before_calculate_totals_method($remove_event){ | |
return true; | |
} | |
} | |
add_filter('woo_discount_rules_remove_event_woocommerce_before_calculate_totals', 'woo_discount_rules_remove_event_woocommerce_before_calculate_totals_method'); | |
if(!function_exists('woo_discount_rules_has_price_override_method')){ | |
function woo_discount_rules_has_price_override_method($hasPriceOverride, $product){ | |
return true; |
This file contains 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
function woo_discount_rules_accepted_taxonomy_for_category_method($taxonomy){ | |
$taxonomy[] = 'product_brand'; | |
return $taxonomy; | |
} | |
add_filter('woo_discount_rules_accepted_taxonomy_for_category', 'woo_discount_rules_accepted_taxonomy_for_category_method', 10); | |
function woo_discount_rules_load_additional_taxonomy_method($categories, $product_id){ | |
$brands = get_the_terms( $product_id, 'product_brand' ); | |
if(!empty($brands)){ |
This file contains 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_skip_discount_for_free_product_method')){ | |
function woo_discount_rules_skip_discount_for_free_product_method($skip_free_product, $cart_item){ | |
$_product = $cart_item['data']; | |
//Example | |
if(!empty($_product)){ | |
$price = $_product->get_price(); | |
if($price == 0){ | |
if(!empty($cart_item['thwepo_options'])) return true; | |
} | |
} |
OlderNewer