WebWizards
Forum Replies Created
-
Thank you very much !
Thank you so much : )
Thank you so much!
Hi there,
Thank you for sharing this with us,
I guess your site may have some situations / calls where the WC() cart is not yet initialized, but B2BKing is trying to access it.
I have made an update to the plugin to address this situation, version 4.7.05. Please update to this newest version. Let us know if you see any further issues,
Kind regards,
Stefan
Glad to hear it : )?If there’s anything else I can help with, please let me know.
Also, if you feel it deserves it, I would really appreciate it if you considered?leaving a quick?rating for the plugin?– it’s a big help to us.
It cannot work exactly as you described it I’m afraid.
What can be done is that you can have 3 customer groups (roles), and when you edit each product, you can directly enter what price each customer group will get: https://www.loom.com/i/a39811618afe49a8b699aee859e5eccf
Thank you for the details,
For (2), please try adding / testing the following PHP code snippet:
function set_custom_order_status_based_on_user_role($order_id) {
if (!$order_id) {
return;
}
$order = wc_get_order($order_id);
if (!$order) {
return;
}
$customer_id = $order->get_customer_id();
if (!$customer_id) {
return;
}
$user = get_userdata($customer_id);
if (!$user) {
return;
}
// Check if the user has the role 'b2bking_role_47'
if (in_array('b2bking_role_47', $user->roles)) {
$order->update_status('wc-custom-status');
}
}
add_action('woocommerce_thankyou', 'set_custom_order_status_based_on_user_role');This code runs on the “thank you” (order confirmation) page, so it’s important that page is reached. Let me know if that can solve it for you.
(For clarity, this code can be added to functions.php of the child theme, or to any code snippets plugin).
- This reply was modified 4 months, 2 weeks ago by WebWizards.
Thank you for sharing that,
This seems to work through a different mechanism on your site, than on my test site: https://prnt.sc/SzUfxNeStBLF (in my tests I am seeing 2 separate items in cart, whereas on your site there’s only 1 item whose price changes)Can you share more details as to how that coupon is created? In my tests I created it per the tutorial here: https://woocommerce.com/document/smart-coupons/how-to-create-a-woocommerce-bogo-buy-one-get-one-offer/ – could you try this configuration to see if it can do it for your purposes?
Thank you for getting back to me with those details,
I think the closest approach with our plugin would be through “fixed price” dynamic rules. You would need to have such a rule for each product with a dealer price, and assign users to each rule.
For example: https://prnt.sc/7-SWZ8ol0glm – in this rule, we set a special price of $25, on the product “Silk Sweater”, for only the selected customers (‘janedoe’ and ‘jimsson’). This price will overwrite the regular price defined on the product page for those two customers.
You would need such a rule for each product. If you have a large number of products, I mention these rules can also be created programmatically via REST API: https://woocommerce-b2b-plugin.com/docs/import-or-setup-dynamic-rules-programatically/
Hi Alex,
Thank you for getting in touch with us,
(1) There is a setting in B2BKing for “always in stock for b2b”: https://woocommerce-b2b-plugin.com/docs/separate-stock-b2b-b2c-users-wholesale-woocommerce/ . When this is enabled, all B2B users (only b2b) are able to order any product regardless of stock status (including out of stock products).
I have to mention that this feature is currently available only in the paid version of B2BKing,
(2) There is no specific feature for this by default. I believe we may be able to help with a custom code snippet to assign B2B orders a different status. Which status would you like to assign?
Kind regards,
Stefan
Hi Alex,
Thank you for using our plugin,
Is it correct that you are referring to WordPress roles such as “Administrator”, “Editor”, “Subscriber”, “Client”, etc?
B2BKing by default uses its own groups instead of WP roles. These groups can be configured in B2BKing -> Groups -> Business Groups.
It is also possible to make B2BKing sync its groups with WP Roles. To do that, please follow the guide here: https://woocommerce-b2b-plugin.com/docs/how-to-use-wp-roles-with-b2bking/ – after setting this up, each B2BKing group should have an identical WP role. New registrations would get both the B2BKing group and similarly named role.
Hi Anastasia,
I made a further update 4.6.85 to B2BKing now, that I hope can resolve that. Please try to update to that and check.
If it doesn’t solve it, it would help if you can please share a few screenshots in your setup to help us better understand what is happening:
- a screenshot of your cart with the bogo coupon with B2BKing deactivated
- a screenshot of your cart with the bogo coupon with B2BKing active
- screenshots with how your bogo coupon is configured, so we can try those same settings
Hello Johannes,
Thank you for getting in touch with us,
Indeed in our plugin a user can only be part of 1 group at a time. This is because groups control many binary choices such as “is the user tax exempt?”, “is X payment gateway available or not” etc, so if a user were to be part of multiple groups, we would not know which rules to apply.
In the situation you described regarding pricing, I think what you can do is to create multiple dynamic discount or pricing rules.
If you have for example 2 rules that apply to a group, the plugin will indeed give the customer the lowest price across all rules that apply to the customer.
If you can send us more details about your setup and what you need to achieve / why you were thinking to use different groups, we would be happy to advise on the best setup. The plugin has many pricing options, including setting prices for customers individually by username, discount rules, group pricing, etc, so I believe we can find an effective solution,
KInd regards,
Stefan
Hi Anastasia,
Thank you for the details and clarifications,
The feature I mentioned there to disable B2BKing pricing is only in the Pro version, I misunderstood which one you were using.
I looked into how Smart Coupons work with BOGO discounts and created a discount as described here: https://woocommerce.com/document/smart-coupons/how-to-create-a-woocommerce-bogo-buy-one-get-one-offer/
I took a quick video of how I am testing this:
I found that some issues can occur if there is a discount percentage dynamic rule that applies to products in cart. I have made an update to B2BKing Core, version 4.6.80 with a fix for that.
If that cannot solve it for you, please check my above video and let me know what we are doing different.
Perhaps you have a B2BKing group price set for that product as in here? https://prnt.sc/BOZ6RueMShHs
Hi Anastasia,
Thank you for your patience on this,
In general, B2BKing can conflict with other plugins that change the price of products. Usually such plugins use the same hooks that B2BKing uses to modify product prices, so the results are unpredictable, as both plugins modify the same functions without knowledge of each other.
To solve this, I think there are a few different options:
(A) Apply a coupon that adds discounts to the cart totals area (but not changing the price of products directly). E.g: https://prnt.sc/KVbBhfK7pFV_
If you had such a discount that is added to cart totals, that should also work with B2BKing as there would be no conflict over the actual price of each product.
(B) You can disable B2BKing pricing features if you do not need them (I am not sure what B2BKing features you’re using). To do that, you can enable these switches in B2BKing -> Settings -> Other -> Components: https://prnt.sc/oxCZgQ4pPdjO
Could (A) be used here? I think it’s generally the easiest option, and it’s how WooCommerce coupons are normally added (they are added at the end of the cart rather than changing the product prices).
And are you using B2BKing Pro or the B2BKing Core plugin? what B2BKing pricing features are you using if any?