• Resolved vimal05

    (@vimal05)


    HI..superb plugin!! one quick question, the snippet to display the price in fiat + crypto does not work if the product has a variation. it ETH price is zero. Using default code. any help ?

    // Show product prices in fiat + crypto
    function mcc_woocommerce_get_price_html( $text, $product )
    {
        // Is MCC installed?
        if ( ! function_exists( 'mycryptocheckout' ) )
            return $text;
        // Retrieve all of our currencies.
        $currencies = MyCryptoCheckout()->currencies();
        // Change this to your preferred currency symbol
        $show_currency = 'ETH';
        $currency = $currencies->get( $show_currency );
        // Is this currency known?
        if ( ! $currency )
            return $text;
        $new_price = $currency->convert( get_woocommerce_currency(), $product->get_price() );
        return $text . ' | ' . $new_price  . ' ' . $show_currency;
    }
    add_filter( 'woocommerce_get_price_html', 'mcc_woocommerce_get_price_html', 100, 2 );
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author edward_plainview

    (@edward_plainview)

    Is there a functiona available to fetch the current variation?

    Thread Starter vimal05

    (@vimal05)

    Hi Thanks. But guess i solved it as it was clashing with another woocommerce plugin. Disable that and its working fine now. Have the prices of variable now showing the converted crypto equivalent.

    Plugin Author edward_plainview

    (@edward_plainview)

    For the sake of other people reading, would it not be a good idea to say exactly which plugin you disabled?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Variable price’ is closed to new replies.