Marketpress suggestion

To whom it may concern,

Would it be possible that if an affiliate product is selected that there is an option to turn off the price or maybe if price isn't populated in general it doesn't show a price?

Kind regards

Peter

  • Vaughan

    Hi Peter,

    Hope you're well?

    I'm not entirely sure how easy this would be. In general though it might be possible.

    Do you mean you want to just hide the whole price field on the front-end if it's set to 0?

    The following might work but I haven't tested this.

    add_filter('mp_product/display_price', 'hide_price_for_free_products', 999, 3);
    function hide_price_for_free_products($snippet, $price, $product_id) {
        if($price > 0) return $snippet;
    
        return '';
    }

    Just add the above to your theme functions.php

    Hopefully now the price will not be displayed if it's free, but as mentioned I haven't tested it.

    Hope this helps

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.