Okay
  Public Ticket #3164487
DYNAMIC RULES
Closed

Comments

  •  5
    CANDY started the conversation

    We would like to set up a dynamic rule for dist1 users. if they order item x. item y is automatically added to cart? Is this possible?  I see where I can add a tax/fee if they order certain products , which could be a work around.  but i would have to create a rule for each product times 4 different customer groups. quite cumbersome when we have 1000+ products and 10 different customer groups total

  •  5
    CANDY replied

    alittle more clarity...

    items a, b, c use box1 for shipping

    items d, e, f use box2 for shipping

    customer group A gets charged extra depending on the box/crate size.

    What we want is 

    customer group A orders item a, box1 gets added to the sales order as line item with its associated price for that group.


    What I am seeing in dynamic rules is i can add a tax/fee to that customer group if they order item a , i can add a set fee called crating fee .

  •  1,904
    WebWizards replied

    Hi there,

    I see what you mean - I think B2BKing doesn't have any features that could do this directly unfortunately.


    I would suggest using "Add Tax / Fee" as you mentioned and doing the following:

    You could add a tax rule for products A,B,C and another tax rule for products D,E,F

    You could also add this PHP code snippet to your site (can be added to functions.php):

    add_filter('b2bking_add_tax_apply_times', function($val){
            return 1;
    }, 10, 1);
    

    This snippet should help make each fee apply only once (rather than once per product as is the default behaviour).


    Kind regards,

    Stefan


  •  5
    CANDY replied

    Thank you for your reply. Actually the crating charge would be for each item.. so I dont think the snippit code is needed.  I did a test dynamic rule with one category of products. I dont think the tax/fee selection will work for us. since it adds the fee at the bottom of sales order with the freight, taxes totals. we really need it as a line item since that is how it is in our accounting software.

  •  1,904
    WebWizards replied

    As far as I know, there is no mechanism in WooCommerce that allows fees / discounts / taxes to be added as line items. I believe there are some plugins which can create some sort of 'fake' line items that appear that way, but this is not a standard WooCommerce feature.


    B2BKing can only add surcharges under cart totals OR directly to the price itself (by modifying the price), but the plugin has no way of adding these as line items unfortunately.


    Perhaps like you mentioned, it would make sense to have a feature that can automatically add X item to cart if Y is also added. Maybe check out:

    https://www.asanaplugins.com/product/auto-add-products-to-cart-woocommerce/

    - https://wpexplorer-themes.com/total/snippets/add-product-b-to-woocommerce-cart-when-adding-product-a/