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

edited May 2024 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

  • 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.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.