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 | |
if ( class_exists( 'YITH_YWRAQ_Order_Request' ) ) { | |
add_action( 'ywraq_add_order_meta', 'ywraq_add_order_meta', 10, 2 ); | |
function ywraq_add_order_meta( $order_id, $raq ) { | |
if ( ! isset( $raq['other_email_fields'] ) ) { | |
return; | |
} |
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 | |
if ( defined( 'YITH_WCAS_PREMIUM' ) ) { | |
add_filter( 'yith_wcas_suggestion', 'yith_wcas_suggestion' ); | |
function yith_wcas_suggestion( $suggestions ) { | |
if ( isset( $suggestions['url'] ) ) { | |
$suggestions['url'] = add_query_arg( 'click', 'true', $suggestions['url'] ); | |
} | |
return $suggestions; |
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 | |
//you can add this code in the file functions.php of your theme | |
if ( class_exists( 'YWSBS_Subscription' ) ){ | |
add_filter( 'ywsbs_cancel_recurring_payment', '__return_true', 99 ); | |
} |
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 | |
add_filter('ywpar_calculate_product_max_discounts','ywpar_calculate_product_max_discounts', 10, 2); | |
function ywpar_calculate_product_max_discounts( $price, $product_id ){ | |
foreach( WC()->cart->get_cart() as $cart_item_key => $values ) { | |
$_product = $values['data']; | |
if( $product_id == $_product->id ) { | |
return $_product->get_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 | |
/** ticket 113379 */ | |
if ( class_exists( 'YITH_WC_Points_Rewards_Redemption' ) ) { | |
add_filter( 'ywpar_calculate_rewards_discount_max_discount', 'ywpar_calculate_rewards_discount_max_discount' ); | |
function ywpar_calculate_rewards_discount_max_discount( $max_discount ) { | |
return floatval( intval( $max_discount ) ); | |
} | |
add_filter( 'ywpar_calculate_rewards_discount_max_points', 'ywpar_calculate_rewards_discount_max_points', 10, 3 ); |
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 | |
/** ticket 113379 */ | |
if ( class_exists( 'YITH_WC_Points_Rewards_Redemption' ) ) { | |
add_filter( 'ywpar_calculate_rewards_discount_max_discount', 'ywpar_calculate_rewards_discount_max_discount' ); | |
function ywpar_calculate_rewards_discount_max_discount( $max_discount ) { | |
return floatval( intval( $max_discount ) ); | |
} | |
add_filter( 'ywpar_calculate_rewards_discount_max_points', 'ywpar_calculate_rewards_discount_max_points', 10, 3 ); |
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 | |
if( defined('YITH_YWRAQ_PREMIUM') ){ | |
add_action('yith_ywraq_quote_template_after_content', 'ywraq_bigfooter'); | |
function ywraq_bigfooter(){ | |
if( get_option('ywraq_pdf_footer_content') != '' ){ | |
echo '<div class="footer" style="position:absolute;bottom:0px">'; | |
echo get_option('ywraq_pdf_footer_content'); | |
echo '<div>'; |
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 | |
if ( function_exists( 'YITH_YWRAQ_Order_Request' ) ) { | |
add_action( 'wp_loaded', 'ywraq_upsell_in_cart', 11); | |
function ywraq_upsell_in_cart() { | |
remove_filter( 'woocommerce_add_to_cart_validation', array( | |
YITH_YWRAQ_Order_Request(), | |
'cart_validation' | |
), 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
<?php | |
add_filter('yith_wcas_suggestion', 'yith_wcas_suggestion', 10, 2); | |
function yith_wcas_suggestion( $suggestion, $product ){ | |
$sku = $product->get_sku(); | |
if( ! empty( $sku ) ){ | |
$suggestion['sku'] = '<span class="sku">SKU: '. $product->get_sku().'</span>'; | |
} | |
return $suggestion; |
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 | |
if ( defined( 'YITH_YWPAR_PREMIUM' ) ) { | |
function ywpar_print_my_inline_script() { | |
?> | |
<script type="text/javascript" charset="utf-8"> | |
jQuery(document).find('form.ywpar_apply_discounts').on('submit', function (e) { | |
var max = jQuery('input[name="ywpar_points_max"]').val(), | |
input_t = jQuery('#ywpar-points-max').val(); |