-1

I have found some great answers to my question on StackOverFlow like "Replace product zero displayed price with a custom text in Woocommerce 3" answer thread, but unfortunately none of them seem to be working on my site for Variable Products.

I can see in WP Admin that POA is displaying:

enter image description here

But on the live site it's not making any change, see it in here or in here.

Does anyone know why this code snippet wouldn't be working on my site? I have tried switching to default WP theme with the same result.

Any help is highly appreciated.

LoicTheAztec
  • 229,944
  • 23
  • 356
  • 399
Banter
  • 7
  • 2
  • What code or plugin are you using to get the "POA" feature on backend… It's mandatory to give that in your question itself. You want to have that working for Variable Products, do you mean the price range on variable products I suppose… – LoicTheAztec Mar 11 '19 at 12:46
  • I have just retested [my answer code](https://stackoverflow.com/a/49242192/3730754) liked in your question and it's working just fine for Variable products. Now all variations prices of the variable product need to be equal to zero if you want the displayed price range to be replaced by a custom text, which is logical… – LoicTheAztec Mar 11 '19 at 13:07
  • Thanks so much, and my apologies if I didn't go about asking this question correctly - I haven't used this forum before! I have added a Code Snippet as per your link above, but I'm still not seeing POA for the $0 products, for example https://freshbydesign.bantergroup.com.au/product-category/drum-filters/ I can see POA in the Products list in WP Admin. Any ideas what I'm doing wrong, or could this be a theme conflict? I have tried a few different code snippets I found online, but none of them have worked on this site. – Banter Mar 14 '19 at 01:20
  • Sorry for the bother - I've found a plugin that will do the job. – Banter Mar 14 '19 at 02:01

1 Answers1

0

try this its working for me.

function poa_request_quots() {
    $html = '<div class="poa">POA</div>';
    $html .= '<button type="submit" id="trigger_cf" class="single_add_to_cart_button button alt"> Request Price Now </button>';
    $html .=  '<div id="product_inq" style="display:none">';
    $html .= do_shortcode('[contact_form_7_2]');
    $html .=  '</div>';
    return $html;
}
add_filter('woocommerce_empty_price_html', 'poa_request_quots');
  • **Just for info:** This hook doesn't exist when using [`get_price_html`](https://docs.woocommerce.com/wc-apidocs/source-class-WC_Product_Variable.html#129-168) method for **variable products** price range, which is asked on this question. – LoicTheAztec Mar 11 '19 at 14:44