• Resolved bettogian

    (@bettogian)


    Hi,

    i´ve just pasted a snippet code to delete range price to show only the low price. See here
    but when i change the currency appear an odd strike price

    Why??, or maybe is the snippet code??

    Greetings

    • This topic was modified 5 years, 5 months ago by bettogian.
    • This topic was modified 5 years, 5 months ago by bettogian.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support mediawebster

    (@mediawebster)

    Hello

    please drop me the snippet you are using

    Thread Starter bettogian

    (@bettogian)

    Now it dissapear when i change currency

    add_filter( 'woocommerce_variable_price_html', 'bbloomer_variation_price_format_min', 9999, 2 );
      
    function bbloomer_variation_price_format_min( $price, $product ) {
       $prices = $product->get_variation_prices( true );
       $min_price = current( $prices['price'] );
       $price = sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $min_price ) );
       return $price;
    }
    • This reply was modified 5 years, 5 months ago by bettogian.
    Plugin Support mediawebster

    (@mediawebster)

    Hello

    Try to use

    add_filter( 'woocommerce_variable_price_html', 'bbloomer_variation_price_format_min', 9999, 2 );
      
    function bbloomer_variation_price_format_min( $price, $product ) {
       $prices = $product->get_variation_prices( true );
       $min_price = current( $prices['price'] );
            if (class_exists('WOOCS')) {
                global $WOOCS;
                if ($WOOCS->is_multiple_allowed) {
                    $currrent = $WOOCS->current_currency;
                    if ($currrent != $WOOCS->default_currency) {
                        $currencies = $WOOCS->get_currencies();
                        $rate = $currencies[$currrent]['rate'];
                        $min_price = $min_price / $rate;
                    }
                }
            }
       $price = sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $min_price ) );
       return $price;
    }
    • This reply was modified 5 years, 5 months ago by mediawebster.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Strike through price when I change currency’ is closed to new replies.