View functions.php
<?php
function get_total_user_point( $order ) {
$user_id = false;
if ( !$order instanceof WC_Order ) {
$order = wc_get_order( $order );
}
$user_id = $order->get_user_id();
View functions.php
<?php
add_filter('ywpar_calculate_rewards_discount_max_discount_fixed','ywpar_calculate_rewards_discount_max_discount_fixed', 10, 1);
function ywpar_calculate_rewards_discount_max_discount_fixed( $subtotal ){
return floatval( WC()->cart->get_total('edit') );
}
View functions.php
<?php
add_filter( 'woocommerce_get_price_html', 'ywsbs_woocommerce_get_variation_price_html', 99, 2 );
add_filter( 'woocommerce_get_variation_price_html', 'ywsbs_woocommerce_get_variation_price_html', 99, 2 );
function ywsbs_woocommerce_get_variation_price_html( $price, $product ){
if ( ! $product->is_type('variable') ){
return $price;
}
$prefix = sprintf('%s: ', __('From', 'iconic'));
View functions.php
<?php
if ( defined( 'YITH_YWRAQ_PREMIUM' ) ) {
function ywraq_print_my_inline_script() {
?>
<script type="text/javascript" charset="utf-8">
jQuery(document).on('ywraq_table_reloaded', function ($) {
jQuery(document).find( 'div.quantity:not(.buttons_added), td.quantity:not(.buttons_added)' ).addClass( 'buttons_added' ).append( '<input type="button" value="+" class="plus" />' ).prepend( '<input type="button" value="-" class="minus" />' );
View functions.php
<?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;
}
View functions.php
<?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;
}
View functions.php
<?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;
View functions.php
<?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 );
}
View functions.php
<?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();
}
View functions.php
<?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 );