Okay
  Public Ticket #3744999
Free Product
Closed

Comments

  •  1
    Jim started the conversation

    We want to auto add a product to a cart and give it out for free with purchases for a promotion.  There are lots of plugins that can do this such as dynamic pricing or advanced coupons ect.. 

    The issue is that B2BKing starts to conflict with these programs and either does not apply the free item or does not apply the dynamic tears in B2BKing rules. 

    Is there a way around this?

  •  1
    Jim replied

    The error we get when we run dynamic pricing plug pro version and B2BKing is: 

    Uncaught DivisionByZeroError

    This is only when we want to give a free product out

  •  2,243
    WebWizards replied

    Hi Jim,

    Glad to assist,

     

    These kind of plugins (generally any plugins with pricing effects) can run into conflicts with B2BKing, as both their plugin and ours usually use the same WooCommerce price hooks to set prices (or set products as free), with unpredictable results.

    I understand you're getting a specific Uncaught DivisionByZero error. I'm thinking a quick solution could be that we make an integration with that plugin, to basically tell our code to ignore free products set by that plugin.

     

    Is it possible perhaps to share a backend access to the site you're working on, or a staging clone site? It would help us troubleshoot and look into it directly.

    Or otherwise, can you please link to the exact plugin you're using and share a screenshot with the configuration you're using for those free products?

     

    Kind regards,

    Stefan

  •  1
    Jim replied

    Can we turn off dynamic rules in B2BKing and just use dynamic pricing or would that still conflict?

  •  2,243
    WebWizards replied

    It should work to use the other plugin if you turn off all B2BKing pricing code. 

    Then you can use any other pricing plugin as our plugin would no longer have any effects. To do that, you can go to B2BKing -> Settings -> Other -> Components and enable the following switches: https://prnt.sc/VBU0unHC1_Vq