I propose to add a shipping quote method plugin to Ubercart core which calculates the cost as a fixed amount per order plus a percentage of the order total. This is a common method which has been provided by contributed modules since at least D5. It's almost identical to flat rate and weight quote, and because it's a plugin and doesn't involve creating a new module and doesn't get loaded unless it's used, it adds functionality without bloat.

Patch attached.

This exercise revealed to me that providing "Add xxx method" actions as the sole way to add a new shipping method doesn't scale well - we can't have four, five, six different actions, one for each method. So I also propose changing the ShippingQuoteMethodListBuilder to look like the PaymentMethodListBuilder, with a select box of all the available shipping quote methods and no action buttons.

Or another way to do this would be to emulate the add content page at admin/content, with *one* "Add method" button that redirects to a page listing all the methods (with help text underneath that explains what they all are!). And do this for both shipping and payment.

CommentFileSizeAuthor
p-rate.patch4.34 KBtr

Comments

TR created an issue. See original summary.

  • longwave committed 09e9ff9 on 8.x-4.x authored by TR
    Issue #2646590 by TR: Percentage Rate shipping quotes
    
longwave’s picture

Status: Needs review » Fixed

Committed, with the new base plugin namespace and a typo fix in the action ID. I will open a followup to improve the list builder.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.