Filter: mam_wc_get_approved_price_for_user

$price = apply_filters( 'mam_wc_get_approved_price_for_user', $price, $product_id, $customer_id );

mam-woocommerce-offers provides this filter’s implementation: when the given customer has an accepted offer on the given product, the accepted price is returned; otherwise $price passes through unchanged.

Parameter Type Description
$price string/float The price to fall back to (usually the product price)
$product_id int The WooCommerce product
$customer_id int The buyer’s WP user ID. Required — with 0 the filter passes $price through

Who calls it

MAM Main’s product content elements and the MAM WooCommerce Product Vendors content classes apply this filter when building product/cart payloads, which is how an accepted offer becomes the buyer’s effective price at checkout.

Example: read the negotiated price in custom code

$effective_price = apply_filters(
    'mam_wc_get_approved_price_for_user',
    $product->get_price(),
    $product->get_id(),
    mam_user_id()
);
Contents

    Need Support?

    Can't find the answer you're looking for? Don't worry we're here to help!