Skip to content

Instantly share code, notes, and snippets.

View kreamweb's full-sized avatar

Emanuela Antonina Castorina kreamweb

  • Kream di Emanuela Castorina
  • Acicatena (CT) - Italy
View GitHub Profile
<?php
add_filter( 'x_sliders_meta', 'x_revolution_slider_add_slider_meta_tweek', 1 );
function x_revolution_slider_add_slider_meta_tweek( $meta ) {
return array_merge( $meta, x_revolution_slider_get_slider_meta_tweek() );
}
if( !function_exists('x_revolution_slider_get_slider_meta_tweek')){
function x_revolution_slider_get_slider_meta_tweek() {
$rs = new RevSlider();
<?php
add_action('woocommerce_email_footer', 'raq_quote_email', 1);
function raq_quote_email( $email ){
if( is_a( $email, 'YITH_YWRAQ_Send_Quote') && isset( $email->raq) ){
$raq = $email->raq;
$order = wc_get_order($raq['order-id']);
$other_fields = $order->get_meta('ywraq_other_email_fields', true );
foreach ( $other_fields as $key => $value ){
printf( '<p><strong>%s:</strong> %s</p>', $key, esc_html( $value ) );
}
<?php
if( class_exists('YITH_WC_Points_Rewards_Frontend')){
add_filter('ywpar_get_product_point_earned', 'ywpar_get_product_point_earned_gift_card', 10, 2 );
function ywpar_get_product_point_earned_gift_card( $points, $product ){
if( $product->is_type('gift-card')){
$points = 0;
}
return $points;
}
<?php
add_action( 'woocommerce_applied_coupon', 'change_subscription_next_payment_due_date' );
add_action( 'woocommerce_removed_coupon', 'change_subscription_next_payment_due_date_on_remove_coupon' );
function change_subscription_next_payment_due_date( $coupon_code ) {
if ( 'famille' === strtolower( $coupon_code ) ) {
replace_recurring_price( $coupon_code, 'add');
}
}
if ( ! function_exists( 'yith_pos_customization_show_print_items_link' ) ) {
add_action( 'wp_enqueue_scripts', 'yith_pos_customization_show_print_items_link', 99 );
function yith_pos_customization_show_print_items_link() {
$js = "wp.hooks.addFilter('yith_pos_header_links', 'yith-pos/customization', (links) => {
let newLinks = [];
links.forEach( link => {
if( link.className === 'register-logout-link' ){
link.show = true;
<?php
add_action( 'woocommerce_applied_coupon', 'change_subscription_next_payment_due_date' );
add_action( 'woocommerce_removed_coupon', 'change_subscription_next_payment_due_date_on_remove_coupon' );
function change_subscription_next_payment_due_date( $coupon_code ) {
if ( 'bundle' === strtolower( $coupon_code ) ) {
change_next_billing_date( 90 );
}
}
<?php
if( defined('YITH_WCAS_VERSION')){
remove_action( 'storefront_header', 'storefront_product_search', 40 );
add_action( 'storefront_header', 'ywcas_product_search', 40 );
function ywcas_product_search(){
?>
<div class="site-search">
<?php echo do_shortcode('[yith_woocommerce_ajax_search]'); ?>
<?php if( function_exists('YWSBS_Subscription_Order')){
add_filter('ywsbs_renew_order_status', 'ywsbs_put_woo_stripe_renew_in_pending', 10, 2);
function ywsbs_put_woo_stripe_renew_in_pending( $status, $subscription ){
if( $subscription && 'stripe'===$subscription->payment_method){
$status = 'pending';
}
return $status;
}
<?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 (
<?php
if ( defined( 'YITH_WCAS_PREMIUM' ) ) {
add_action( 'ywcas_before_do_the_request', 'yith_wcas_query_fix' );
function yith_wcas_query_fix() {
global $yith_wcas, $wp_the_query;
remove_filter( 'posts_where', array( $yith_wcas, 'extend_search_where' ) );
remove_filter( 'posts_join', array( $yith_wcas, 'extend_search_join' ) );