Support » Plugin: WooCommerce » Variable product showing price at from $0.00

  • I have a variable product that is showing the price as from $0.00. It should say from $750. I can’t quite figure out why it is not picking up the price correctly. None of the variations are listed at $0.00 (I checked more than once!!).

    Where should I be looking to try and figure this out?

    Cheers
    Meg

Viewing 7 replies - 1 through 7 (of 7 total)
  • What is the main product price set to?

    Hi James, what do you mean by main product price?

    What I have is a variable product, with several variations (in this case pack sizes). Each variation has a price.

    Cheers
    Meg

    This is only happening with new variable products that I enter since I updated WooCommerce. Anything I entered pre 3.0 is displaying fine and simple products display correctly.

    @kiwimeg – I just noticed this when I duplicated a variable product in WC 3.2.1. Did you ever find a solution?

    Hi @linux4me2 …to be quite honest I can’t remember how I resolved this. Sorry I can’t be more help!

    I found a workaround, but it will be a hassle for anyone who adds a lot of variable products.

    I compared a previously entered variable product without the issue to the current one, and found that there are a number of records missing in the table postmeta for the affected product. Among the missing records was one with the meta_key “_min_variation_price”. I added a record for the affected product with that meta_key and the lowest variation price, and it fixed the problem.

    I found the cause of the problem in our case. When I set up the site, I had added the following function to change how the price range of variable products displayed:

    
    add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
    
    function custom_variation_price( $price, $product ) {
      $price = '';
      if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) {
        $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>';
        $price .= woocommerce_price($product->min_variation_price) . '*';
      }
      return $price;
    }
    

    Evidently, that no longer works with WC 3.2.1, and was causing the “from” price to show up as “$0.00”. I commented out the filter line, and everything works as it should.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Variable product showing price at from $0.00’ is closed to new replies.