• Resolved rjgv

    (@rjgv)


    The feed for the Google Merchant Centre correctly displays the prices of variable products. However, Google rejects most variations because there is a different price on the product page: the so-called “price-range”. This appears to be against the Google rules. Using a plugin you can change this to a display with a “price from”. This will also cause the products to be rejected for display in Google Shopping. After selecting the variable product options, the correct price will be shown on the product page. To avoid confusion for Google, removing the “price (range)” field could be a solution. However, this is undesirable because prices will no longer be displayed on the category pages.Is there a possibility to remove the price (range) field only on the product page, where the price for “simple products” is displayed normally on the product page?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Is there a possibility to remove the price (range) field only on the product page, where the price for “simple products” is displayed normally on the product page?

    Instead of hiding the price range completely, you can show the minimum price only (e.g. From $XXX) by applying the code below:

    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;
    }

    Code Source: https://www.businessbloomer.com/disable-variable-product-price-range-woocommerce/

    I would recommend using a plugin like?Code Snippets?to add the snippet to your site.

    Thread Starter rjgv

    (@rjgv)

    Thank you for your response Maykato. I had already tried this: Google then sees the minimum price on the product page, while the more expensive variations (product pages) have the same minimum price. This is against Google’s rules and Google rejects all product pages with unequal prices.

    Hello,

    This is against Google’s rules and Google rejects all product pages with unequal prices.

    I see, thank you for clarifying. If you need to remove the price range completely, you can try this code: https://stackoverflow.com/questions/44447112/disable-variable-product-price-range-on-the-woocommerce-single-product-pages-onl/#answer-44447363

    Thread Starter rjgv

    (@rjgv)

    I tried, but this doesn’t work. it still shows the pricerange on variable productpages

    Hi @rjgv

    Hmm… that’s strange. I’ve tried the code below on my test site and it worked properly.

    add_action( 'woocommerce_before_single_product', 'my_remove_variation_price' );
    function my_remove_variation_price() {
      global $product;
      if ( $product->is_type( 'variable' ) ) {
        remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_price' );
      }
    }

    https://snipboard.io/sZOdbX.jpg
    https://snipboard.io/O9CJm3.jpg – code applied

    Did you apply the snippet via the Code Snippet plugin?

    Thread Starter rjgv

    (@rjgv)

    i tried, but I got an error-message (blank page). But no worries: in the meantime Google stopped rejecting the products. Don’t know the reason… but it works.

    Hi @rjgv

    in the meantime Google stopped rejecting the products. Don’t know the reason… but it works.

    Oh ok! That’s good news. I’m marking this thread as resolved. If you have any other questions, feel free to open a new topic.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Variable products price-range field in violation with Google rules’ is closed to new replies.