Support » Plugin: WooPrice Calculator » Show range of prices instead of basic price

  • Resolved leandroprz

    (@leandroprz)


    I have some variable products and the price for them is, well, variable, as you can see here: https://leandroperez.com.ar/tienda/categoria/copias-fine-art/los-seismiles-cfa/
    They have a range of prices, from min to max.

    Is it possible to show that in products with Woo Price Calculator applied?

    Right now I only see basic prices for those kind of products, as you can see here: https://leandroperez.com.ar/tienda/categoria/timelapse/los-seismiles/

    I’d like to show min and max as well on those.

    Edit: I’m thinking maybe even adding the min and max prices manually to templates/loop/price-php just to products with the calculator.

    This is my code right now:

    
    <?php if ( $product->is_type( 'variable' ) && $price_html = $product->get_price_html() ) : ?>
    	<span class="price"><?php echo $price_html; ?></span>
    <?php elseif ( $product->is_type( 'simple' ) && $price_html = wc_price($product->get_price() ) ) : ?>
    	<span class="price"><?php echo $price_html; ?></span>
    <?php endif; ?>
    

    Is there a way to tell if a product has a calculator enabled so I can use it in an if statement?

    Thank you

    • This topic was modified 1 year, 1 month ago by leandroprz.
    • This topic was modified 1 year, 1 month ago by leandroprz.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • I managed to fix this with a workaround for now with this code:

    <?php elseif ( is_product_category( array( 'los-seismiles', 'loro-huasi', 'laguna-verde', 'tinogasta', 'campo-de-piedra-pomez', 'antofagasta-de-la-sierra', 'salta', 'la-rioja', 'cordoba', 'otros' ) ) ) : ?>
    	<span class="price">US$ 145 &ndash; US$ 350</span>

    But that’s not exactly what I need, because in the tag archives it doesn’t show up.

    Plugin Author Altos

    (@sefin)

    Actually with the free version there’s not an easy solution for this.
    Anyway you can write on our forum for more details.

    There’s no way to know if a product is using a calculator?

    Plugin Author Altos

    (@sefin)

    what do you mean?
    when?

    If you go to the products panel you will see that if the product is using our calculator, you don’t see the price but “woo price calculator”.

    what do you mean?

    WooCommerce let you check if a product is simple:

    $product->is_type( 'simple' )

    Or variable:

    $product->is_type( 'variable' )

    I’m asking if there’s a way to know, via PHP, if a product has a Woo Price Calculator added to it.

    Plugin Author Altos

    (@sefin)

    Hi,

    WooPriceCalculator works only with simple products. If you want to output data to your product page, with the PRO version you can create output
    fields and set them statically or dynamical in base of your needs.

    There is no directly way to find if a product has a calculator assign, but check this link above:
    https://altoswebsolutions.com/manual/woo-price-calculator/change-the-price
    https://altoswebsolutions.com/manual/woo-price-calculator/16-5-hide-calculator-form

    You can use this hooks to determine if a specific product has a calculator.
    Best regards,
    Naidi
    AT789

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show range of prices instead of basic price’ is closed to new replies.