How can we improve WooCommerce?

Add Filter before displaying prices (to allow hiding prices)

I need to hide prices for some countries in the front-end. In Woocommerce I just add a filter like add_filter('woocommerce_get_price_html', 'do_stuff') and in do_stuff I check if the user country is a pre-defined blacklisted country and if so, I return '' so that the price won't be displayed. Works just fine.

In Product Add-Ons Plugin there is no filter before the price is displayed in the frontend so I have to use CSS to hide the prices there which is not the best solution.

I understand that the Add-On prices are not only displayed via PHP but can also change via JavaScript by the plugin. So this whole approach would be in for revision and should possibly be changed in order to get more control over what is actually displayed to the user.

8 votes
Vote
Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
You have left! (?) (thinking…)
seitenwind shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

1 comment

Sign in
(thinking…)
Sign in with: Facebook Google
Signed in as (Sign out)
Submitting...
  • Anonymous commented  ·   ·  Flag as inappropriate

    We have a related case.
    Adding more markup to make the shop multi-currency. Using the wc_price filter we are able to do that around Woo and Woo Bookings.

    Products Add-On Plugin runs the whole sub-total calculation in JS. Would be great if the add-ons cost/subtotal would be fetched like the bookings cost via AJAX to allow modification.

WooCommerce: Extension - WooCommerce Product Add-ons

Feedback and Knowledge Base