• i used this code to add shipping bar in header

    0, ‘amount’ => 100, ‘after_text’ => “Congrats! You have free shipping”, ‘before_text’ => “You’re %s away from free shipping.”, ‘tax’ => ‘yes’, ‘hide_full’ => ‘no’, ‘icon’ => ” ), $atts, ‘xoo_wsc_bar’); $id = xoo_wsc_frontend()->barsCount; $freeAmount = $atts[‘amount’]; $reached = false; $amountLeft = 0; $subtotal = WC()->cart->get_subtotal() + WC()->cart->get_subtotal_tax(); if( $subtotal >= $freeAmount ){ $reached = true; } else{ $amountLeft = $freeAmount – $subtotal; $fillPercentage = ( $subtotal – $atts[‘start’] ) < 0 ? 0 : ceil( (( $subtotal – $atts[‘start’] )/($freeAmount – $atts[‘start’])) * 100 ); } if( $reached && $atts[‘hide_full’] === ‘yes’ ) return; $args = array( ‘id’ => ‘xoo-bar-‘.$id, ‘free’ => $reached, ‘amount_left’ => $amountLeft, ‘fill_percentage’ => $reached ? 100 : $fillPercentage, ‘text’ => $reached ? $atts[‘after_text’] : str_replace( ‘%s’, wc_price( $amountLeft ), $atts[‘before_text’] ), ‘icon’ => XOO_WSC_URL. ‘/assets/images/’.$atts[‘icon’] ); xoo_wsc_frontend()->barsCount++; return xoo_wsc_helper()->get_template( ‘global/bar.php’, $args, ”, true ); } add_shortcode( ‘xoo_wsc_bar’, ‘xoo_wsc_bar_shortcode’ ); add_action(‘xoo_wsc_before_shipping_bar’, function(){ ?>

    <div class="xoo-wsc-zc-bars">
    
        <?php echo do_shortcode('[xoo_wsc_bar amount="40" before_text="Plus que %s pour la livraison gratuite!" after_text=""  icon="shipping1.png"]'); ?>
    
        <?php echo do_shortcode('[xoo_wsc_bar start="40" amount="74" before_text="Félicitations! La livraison est offerte. ??<br>Plus que %s pour un cadeau Pokémon ?? (Valeur 15€)" after_text="Bravo! ?? Vous bénéficiez de la livraison offerte ainsi que d\'un cadeau exclusif Pokémon." icon="exclusive-gift-animated.gif"]'); ?>
    
    </div>
    
    <?php

    });

    add_action( ‘wp_enqueue_scripts’, function(){

    wp_enqueue_script( 'confetti', 'https://cdn.jsdelivr.net/npm/[email protected]/tsparticles.confetti.bundle.min.js', array(), '1.0', true ); 

    } );

    add_filter( ‘xoo_wsc_product_args’, function( $args ){

    $args['product_meta'] = str_replace(';', '<br>', $args['product_meta']);
    
    
    
    return $args;

    } );

    add_action( ‘xoo_wsc_after_footer_btns’, function(){
    ?>

    <?php
    } );


    now i want to use new version with same shipping bar
    here is screen short of new and old

    The page I need help with: [log in to see the link]

  • You must be logged in to reply to this topic.