Repository Forums Support WooCommerce Extended Coupon Features PRO provide $context parameter to get_price()

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2307
    Jonathan Moore
    Participant

    Hi, please would you consider providing a $context parameter to get_price() calls.

    If no parameter is provided, the context is set ‘view’ and in view mode the price is filtered and may be changed, for example for currency conversion.

    By providing a context such as ‘edit’ – even ‘coupon’ would be ok I believe – the filter is then not called and you get the raw saved price which is the safest to use for calculations.

    #2312
    Soft79
    Keymaster

    I think that would cause issues with plugins overriding the price. Additionally, WooCommerce also uses get_price() without any context for calculations.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.