User Group only Shipping costs?

  • Posts: 18
  • Thank you received: 2
12 years 11 months ago #31206

I've set up a store for a manufacturer who also uses it to resupply his resellers. Using Joomla, there is a user-group protected inventory of reseller products (display boxes, multipacks, etc.)

His postage on international orders is already determined by weight ( 17 zones by 7 tiers = 119 Shipping Rules. You really need a reasonable way to manage that.), fixed price with tax on orders from his state, fixed price with no tax on orders from continental US.

What he is asking for is free shipping for resellers who order more than 12 items. I know I can enter a volume of 1 on all items and tally them to trip a rule, but I can't see a way to limit this rule to members of a certain User Group, "Resellers." Is that possible?




I have attempted to write my own shipping plugin with his price matrix, but failed: your API encourages the determination among existing shipping rules, not the calculation of a shipping amount on the fly. This doesn't save me any time or effort. I managed to get one that DID this calculation and delivered it to the Usable Rates array, Shipping selection screen and pre-selected rate value, but upon selection/order creation, HS apparently went back to its shipping rules and recalculated shipping for the order without using the plugin overrides. It was as if the cart rendering view was entirely isolated from the Shipping processes I was working on. I was not even able to confirm that onShippingSave() was ever called - I could complete an order without a die() statement within that method ever being tripped. It's like trying to build watches in an unlit room.

Please write a tutorial or two for the shipping and payment APIs. A definition of the two or three method calls is not enough for most of us: If you actually want the API calls to be used, we need a bit more context of what is going on around those processes and what variables/objects we need to juggle.

Thanks.

Last edit: 12 years 11 months ago by MonkeyT. Reason: spelling corrections

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31245

If you want to limit your rule to only some user group, you can do that with the access level area of your shipping methods in the Business edition.

Calculating shipping amounts on the fly shouldn't be complicated. All happens in the onShippingDisplay function. There you can just put your method in the $usableMethods array and in your method object, set the shipping_price based on whatever algorithm you need.
The onShippingSave method is called when the shipping method is selected by user on the checkout.
If the shipping method is auto selected by default and that the user does not select another shipping method, that method will indeed not be called at all during the checkout, and that's normal.
If you have more questions on the shipping plugins don't hesitate to ask.

Please Log in or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 2
12 years 11 months ago #31337

OK, I'll relay the Business Edition news to the customer. He's a bit cranky and was trying to avoid that step.

On the UsableMethods part, that's precisely the behavior I hoped for except it didn't work out that way. I had a working plugin that overrode the necessary UsableMethods values (as well as in the matching entry of the methods list) and the constructed shipping portion of the view worked as expected. It even posted the appropriate information. The problem was that my checkout process is "login_address_shipping,payment_cart_coupon_confirm_status_fields,end".

The login/address/shipping page behaved as I expected, but when the order proceeded to the payment/cart/coupon/confirm/status page, it recalculated the shipping amount according to the flat rules, not the selection made on the previous view - the plugin calculated rate according to weight/nationality with an override for Resellers with carts with over a specified number of items.

My customer's retail audience is largely elderly and often discouraged by long complex form pages, so I broke the checkout process into less visually intimidating steps. Setting usableMethod values on the first page had no effect on the shipping value displayed in the second page. That's where I gave up. I'd love it if there's a piece I'm missing that would resolve that. I hope you can help me find it.

I'm sorry if my message seemed terse: I couldn't tell from the documentation whether I had interpreted the work which needed to be accomplished correctly or not, and had already resolved myself to defeat.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31362

If you're injecting in the $usableMethods your own methods which do no exists in the database because you're calculating them on the fly, you should look at how we do it in the UPS plugin or the australia post plugin. Because the manual plugin just get the entries in the database and add them to usableMethods array while the the other plugins generate the methods objects based on what the web service returns.

Now it's hard to give more advice without looking at what you did.

Please Log in or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 2
12 years 11 months ago #31385

OK, that description makes sense to me: The manual plugin was far easier to dissect, so that's where I started. I see a few changes to try.

With your suggestions, I will try again. But I want to reiterate, documentation that includes a more robust explanation of the entire checkout process would make customizing such plugins much easier and faster. I know that there's never enough time, but this floundering around is frustrating.

Thank you for your help.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
12 years 11 months ago #31411

Also, for the onShippingSave function, you should just use the one from the other shipping plugins. In 90% of the cases shipping methods do not need to do anything else in that function.

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum