Best Multi Vendor Marketplace Plugin for WordPress › Forums › WCFM – Feature Request › changes makes by WCFM plugins get Shipping trouble calculations
- This topic has 1 reply, 2 voices, and was last updated 7 years, 4 months ago by
WCFM Forum.
- AuthorPosts
- February 21, 2019 at 2:45 am #49260
cesar
GuestHey there, after kill almost all my neurons, i’ve found the issue.
I’m making a Shipping method, and i found a problem that cause a change in $packages or $package that arrive to Calculate_shipping( $packages =array() ) in a mistake way.
I can´t send a file, so i’m going to paste a summarized array that you can get if put inside:
function Calculate_shipping (…) {
print_r ($packages);
or
print_r ($package);
}
in this test, i’ve created 2 vendors, and a different product for each vendors, and i’ve added both product to a cart.
With WCFM active plugins you can get
Array
(
[contents] => Array
(
[0] => Array
(
[key] => c74d97b01eae257e44aa9d5bade97baf
[product_id] => 16
… … … …
))
)
Array
(
[contents] => Array
(
[0] => Array
(
[key] => aab3238922bcc25a6f606eb525ffdc56
[product_id] => 14
… … … …
))
)
Array
(
[contents] => Array
(
[0] => Array
(
[key] => aab3238922bcc25a6f606eb525ffdc56
[product_id] => 14
… … … …
))
)
Notice, that the last product in the cart it’s printed again, and the index (all say [0]) of array is reset at the end of each [key], this is the reasons by calculate_shipping can calculate each of them.
i you let WCFM plugins DEACTIVATE, if put inside:
function Calculate_shipping (…) {
print_r ($packages);
or
print_r ($package);
}
YOU ARE GOING TO GET:
Array
(
[contents] => Array
(
[c74d97b01eae257e44aa9d5bade97baf] => Array
(
[key] => c74d97b01eae257e44aa9d5bade97baf
[product_id] => 16
… … …
)[aab3238922bcc25a6f606eb525ffdc56] => Array
(
[key] => aab3238922bcc25a6f606eb525ffdc56
[product_id] => 14
[variation_id] => 0)
)So, with the WCFM plugins the function calculate_shipping() try calculate each of contents but only do with the last product, and the same $cost is assigned to a each package, (shipments from different vendors have the same cost).
How can i set Calculate_shipping(…) in order to the first format (with the WCFM active), can calculate each package again?, notice, that i want to calculate again, because in each vendor have to search a different origin.Thanks for answer
you are the best - February 21, 2019 at 7:12 am #49319
WCFM Forum
MemberHI,
“I’m making a Shipping method” – Do you have created a custom Shipping Method?
Well, WCFM Zone Shipping only supports three shipping methods – Flat Rate, Local Pickup and Free Shipping.
“So, with the WCFM plugins the function calculate_shipping() try calculate each of contents but only do with the last product, and the same $cost is assigned to a each package, (shipments from different vendors have the same cost).”
*** WooCommerce zone shipping works like this. You may check by setting up shipping as Admin.
Thank You
- AuthorPosts
- The topic ‘changes makes by WCFM plugins get Shipping trouble calculations’ is closed to new replies.