Remove price from "Shop Products" element and clean up HTML output

edited May 20 in BeBuilder

Hello,

I have a requirement to remove the HTML Price of products with a zero price.

This is no problem in the regular WC loop, but I'm looking to understand how to achieve the same in a BeBuilder "Shop Products" element.

Additionally, could you be more selective with your HTML output for items that are disabled?

For example, the "Add to cart" button is set to be hidden... rather than adding CSS to do this, can you please omit it from the HTML? I also have an empty "mfn-after-shop-loop-item-title" <div>.

It will provide a cleaner output and a smaller DOM on what is an already complex page.


Thank you.

Comments

  • Hi,

    I have passed it to the dev team and we will take a look at the things you mentioned.


    Best regards

  • Thanks

  • We have simplified HTML construction with the price, but we cannot remove it while the price is equal to zero. That is because some plugins are using this place and dynamically recalculate the price, so this element must exist even when starting value might be zero.

    This will be introduced in the upcoming update.


    Best regards

  • Thanks - will it be done honouring regular WC filters?

    i.e. If I hook into woocommerce_get_price_html, can I return a blank string?

    Could you even add a option NOT to display the price (like is there for description etc) - I can think of quite a few use-cases where this would be beneficial even if there was a price set.

  • This will be done with next theme update. We just sorted it out in theme files.

  • OK, thanks - keep me posted with progress!

  • Thank you i also need to hide prices in the woocommerce featured items area


  • Hi @xsiv,

    Please always attach a link to your website so we can check it out. If the page is offline(localhost), then our help will be limited. You will have to contact us when the page is online. Also, please make sure that the page is not under maintenance before you provide us with the link.

    Thanks

Sign In or Register to comment.