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_POS_VERSION')) { | |
add_action( 'wp_enqueue_scripts', 'yith_pos_add_new_stylesheet', 12 ); | |
function yith_pos_add_new_stylesheet(){ | |
global $yith_pos_styles; | |
wp_enqueue_style('yith-pos-override-frontend', get_stylesheet_directory_uri().'/pos.css', array('yith-pos-frontend'), YITH_POS_VERSION); | |
yith_pos_enqueue_style('yith-pos-override-frontend'); | |
} |
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_pos_customization_barcode_field' ) ) { | |
add_filter( 'yith_pos_barcode_custom_field', 'yith_pos_customization_barcode_field' ); | |
function yith_pos_customization_barcode_field() { | |
return "your_barcode_custom_field"; | |
} | |
} |
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_pos_customization_css' ) ) { | |
add_action( 'wp_enqueue_scripts', 'yith_pos_customization_css', 99 ); | |
function yith_pos_customization_css() { | |
$css = ".yith-pos-product-list__list .product, .yith-pos-product-category-list__list .product-cat{ | |
height: 150px; | |
}"; | |
wp_add_inline_style( 'yith-pos-frontend', $css ); |
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_pos_customization_order_status_to_complete' ) ) { | |
add_filter( 'woocommerce_payment_complete_order_status', 'yith_pos_customization_order_status_to_complete', 10, 3 ); | |
function yith_pos_customization_order_status_to_complete( $status, $order_id, $order ) { | |
if ( absint( $order->get_meta( '_yith_pos_order' ) ) ) { | |
$status = 'completed'; | |
} | |
return $status; | |
} |
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 | |
remove_filter( 'woocommerce_'.YITH_WC_Dynamic_Pricing_Frontend()->get_product_filter.'get_price', array( YITH_WC_Dynamic_Pricing_Frontend(), 'get_price' ) ); | |
remove_filter( 'woocommerce_' . YITH_WC_Dynamic_Pricing_Frontend()->get_product_filter . 'variation_get_price', array( YITH_WC_Dynamic_Pricing_Frontend(), 'get_price' ) ); | |
$tax_display_mode = get_option( 'woocommerce_tax_display_shop' ); | |
if ( $label_table != '' ): | |
?> | |
<p class="ywdpd-table-discounts-label"><strong><?php echo $label_table ?></strong> | |
<?php if ( $until != '' ) { | |
echo "<span>$until</span>"; |
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( 'ywdpd_round_total_price', 'ywdpd_round_price_for_single_product' ); | |
function ywdpd_round_price_for_single_product(){ | |
return 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
<?php | |
if ( isset( $_GET['ywpar_fix_points8'] ) ) { | |
add_action( 'init', 'start_the_script7' ); | |
function start_the_script7() { | |
global $wpdb; | |
$table_name = $wpdb->prefix . 'yith_ywpar_points_log'; | |
$limit = 10; | |
$users = $wpdb->get_col( "select distinct point.user_id from $table_name as point WHERE NOT EXISTS ( |
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 | |
function ywpar_calculate_rewarded_points( $user_id ){ | |
global $wpdb; | |
$table_name = $wpdb->prefix . 'yith_ywpar_points_log'; | |
$query = "SELECT SUM(ywpar_points.amount) as rewarded_points FROM $table_name as ywpar_points where user_id = $user_id AND action = 'redeemed_points'"; | |
$res = $wpdb->get_row( $query ); |
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_WC_Subscription' ) ) { | |
add_action( 'ywsbs_renew_subscription', 'ywsbs_renew_subscription_add_custom_field', 10, 2 ); | |
function ywsbs_renew_subscription_add_custom_field( $order_id, $subscription_id ) { | |
$subscription = ywsbs_get_subscription( $subscription_id ); | |
$parent_order = $subscription->get_order(); | |
$renew_order = wc_get_order( $order_id ); | |
$meta_list = array( | |
'_billing_birthdate', |
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( 'ABSPATH' ) ) { | |
exit; // Exit if accessed directly | |
} | |
/** | |
* The core plugin class. | |
* | |
* This is used to define internationalization, general hooks, and |