changes makes by WCFM plugins get Shipping trouble calculations

We're shifting our Forum based support to a more dedicated support system!

We'll be closing our Forum support from 10th June, 2020 and move to Email Support assistance.

  • If you are a WCFM premium add-ons user, contact us- here
  • Want to know more before buying our add-ons? Send Pre sale queries- here
  • If you are a WCFM free user, please open a support ticket at WordPress.org
  • For WCFM App related queries, reach us- here
From now the forum will be read-only!

Best Multi Vendor Marketplace Plugin for WordPress Forums WCFM – Feature Request changes makes by WCFM plugins get Shipping trouble calculations

Viewing 1 reply thread
  • Author
    Posts
    • #49260
      cesar
      Guest

      Hey 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

    • #49319
      WCFM Forum
      Member

      HI,

      “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

Viewing 1 reply thread
  • The topic ‘changes makes by WCFM plugins get Shipping trouble calculations’ is closed to new replies.