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 | |
/** | |
* Override path: [TEMPLATE_FOLDER]/html/plugins/j2store/app_booking/profile_tab.php | |
* */ | |
defined('_JEXEC') or die('Restricted access'); | |
?> | |
<li> | |
<a href="#appbooking-tab" class="nav-link" id="appbooking-tab-id" data-bs-toggle="tab" data-bs-target="#appbooking-tab" role="tab" aria-controls="address-tab" data-toggle="tab" style="display: block;" aria-selected="false"><i class="fa fa-calendar"></i> | |
<?php echo JText::_('J2STORE_APP_BOOKING_PROFILE_TAB'); ?> | |
</a> |
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(class_exists('\Wdr\App\Router')){ | |
$manage_discount = \Wdr\App\Router::$manage_discount; | |
$calculator = $manage_discount::$calculator; | |
$used_coupons = $calculator::getUsedCoupons(); | |
//$used_coupons -> here you get used coupon names in discount rules as an 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
global $awdr_addon_commpatible_products; | |
add_filter('advanced_woo_discount_rules_product_price_on_before_calculate_discount', function($product_price, $product, $quantity, $cart_item){ | |
global $awdr_addon_commpatible_products; | |
if(!empty($cart_item)){ | |
if(isset($cart_item) && isset($cart_item['wcpa_data']) && !empty($cart_item['wcpa_data'])){ | |
if (method_exists($product, 'get_id') && function_exists('wc_get_product')) { | |
$product_id = $product->get_id(); | |
if(isset($awdr_addon_commpatible_products[$product_id])){ | |
$product = $awdr_addon_commpatible_products[$product_id]; | |
} else { |
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
add_action('advanced_woo_discount_rules_before_loaded', function (){ | |
if(class_exists('\WDRPro\App\Rules\BuyXGetY')){ | |
remove_all_filters( 'woocommerce_cart_collaterals', 9 ); | |
add_action( 'woocommerce_after_cart', array('\WDRPro\App\Rules\BuyXGetY', 'loadCrossSellDisplay'), 9 ); | |
} | |
}); |
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(class_exists('\Wdr\App\Router')) { | |
global $product; | |
$discountManager = \Wdr\App\Router::$manage_discount; | |
$discountCalculator = $discountManager::$calculator; | |
$is_variant = false; | |
$bulk_discounts_ranges = $discountCalculator->getDefaultLayoutMessagesByRules($product, $is_variant); | |
//$bulk_discounts_ranges Here you get rule range info | |
} |
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
add_filter('woocommerce_after_add_to_cart_form', function (){ | |
?> | |
<script> | |
jQuery( document ).ready( function() { | |
jQuery( ".single_variation_wrap" ).on( "show_variation", function ( event, variation, purchasable ) { | |
jQuery(this).closest('form').find('input[name="quantity"]').trigger('change'); | |
}); | |
jQuery('input[name="quantity"]').trigger('change'); | |
}); | |
</script> |
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
add_filter('advanced_woo_discount_rules_on_sale_badge_html', function ($html, $post, $_product){ | |
if (strpos($html, 'Sale!') !== false) { | |
$percentage = 0; | |
$reg_p = floatval( $_product->get_regular_price() ); | |
$sale_p = floatval( $_product->get_sale_price() ); | |
if ( $reg_p && $sale_p) { | |
$percentage = - round( ( ( $reg_p - $sale_p ) / $reg_p ) * 100 ); | |
} elseif ( 'variable' == $_product->get_type() && $_product->get_variation_regular_price() && $_product->get_variation_sale_price() ) { | |
$percentage = - round( ( ( $_product->get_variation_regular_price() - $_product->get_variation_sale_price() ) / $_product->get_variation_regular_price() ) * 100 ); | |
} |
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 | |
/** | |
* Discount table | |
* | |
* This template can be overridden by copying it to yourtheme/advanced_woo_discount_rules/discount_table.php. | |
* | |
* HOWEVER, on occasion Discount rules 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 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_filter('advanced_woo_discount_rules_check_purchase_history_based_on_email_and_user_id', '__return_true'); | |