Okay
  Public Ticket #4573290
Plugin conflict
Open

Comments

  • Mike Chen started the conversation

    Hi B2BKing team,

    We use B2BKing for MOQ and B2B tiered pricing on a WooCommerce store, alongside Advanced Product Fields Pro (WAPF) for product options.

    The issue we hit: when a WAPF option adds a price to an item (for example a "Fixed flat fee" setup cost on a product option), B2BKing's price recalculation on the cart item overrides that item price, so the add-on amount is dropped from the total. With B2BKing's product add-ons compatibility mode enabled, the amount is kept but gets folded into the per-unit price, which then scales with quantity and tiers rather than staying as intended.

    Our questions:

    1. Is there an officially supported way to have B2BKing preserve an add-on/option price that another plugin adds to a cart item, rather than recalculating over it?

    2. Does B2BKing expose a filter or setting to exclude a specific cart item (or its added amount) from its price recalculation, so third-party add-on pricing is retained?

    3. What is your recommended approach for combining B2BKing tiered/MOQ pricing with per-option surcharges from a product-fields plugin?

    For context, we currently work around this by applying the option amounts as WooCommerce cart fees (which sit on top of item pricing and aren't recalculated). That works, but we'd like to know the supported path in case a future update affects it.

  •  2,731
    WebWizards replied

    Hi Mike,

    Thank you for purchasing our plugin and for reaching out!

     

    Unfortunately, the way this is handled internally in WooCommerce is quite messy. There isn't a clean system where each plugin's price change is visible and we can choose to preserve or recalculate over it. Instead, there are dozens of Woo price hooks, and each plugin inserts its effects at various points, unaware of the others.

    When B2BKing looks at a cart item, it's less "WAPF added this specific amount, do you want to keep it?" and more "the price here is $50, and we can't tell if that's the default price or the result of other plugins' code". Because of this unpredictable nature, making the two plugins work perfectly together on the same item price would require a special custom integration built specifically for WAPF.

    (our add-ons compatibility mode tries to work around this issue by essentially guessing, comparing the price in the database vs what it receives and assuming the difference is likely an add-on price it should fold in)

     

    Regarding your questions and the recommended approach, there are really only two safe ways to handle this:

    1. Cart fees (what you're already doing) - this is actually the most solid approach, since cart fees are a separate system outside of the main pricing flow.

    2. Excluding add-on products from B2BKing pricing - we could tell B2BKing to completely skip its pricing code for products that have WAPF add-ons, but the downside is that B2BKing tiered pricing would no longer apply to those products either.

    Given this, I believe your current workaround using cart fees is probably the best path forward (and least likely to break with future updates).

     

    Kind regards,
    Stefan