Methods

Methods are a general patterns for an installed plugin allowing diffrent configurations. This allows you to create multiple methods e.g. shipment with each method having different settings.

Methods can generally be restricted by shoppergroups.  Pugins of various types can have their own restrictions.

The second tab of a method for a plugin generally shows the specific additional parameters for that plugin.

Methods belong to a vendor and can be set to shared.

Customfields and userfield plugins are also a kind of methods.

Default Shipment plugin example

Below is a shipment method that has been added to the store using the VirtueMart standard shipment plugin.

{tab Method Information}

The first tab "Shipment Method Information" contains some general information for this method plugin including some restrictions.

shipment shipment method edit screen

This method has some default restrictions for configuration that determine if a shopper sees this shipment method.:

  • Shipment name - will appear on screens and invoices visible to the user
  • Categories and blocking categories - allow or prevent this method showing when a product from the category is in the cart.
  • Shopper Group - The shopper must be a member of one of the configured shoppergroups (multiple shoppergroups can be set )
  • Min amount - Max amount - the value of items in the cart must be within this value range.
  • Countries and Blocking countries - allow or prevent this method when this shopper Shipping destination is set.

{tab Method Configuration}

The second tab "Configuration" is more specific for this plugin and further restricts availability and also sets the price for the shipment method

shipment shipment method edit screen2

  • Zip range is useful for countries with numeric or simple zip codes
  • Lowest - Highest weight - the weight of items in the cart must be within the range set (inclusive)
  • Weight unit - set to the weight unit to use for cart weight consideration
  • Shipment cost is the charge to be made for selecting this method.  This will be added as a shipment total to the order total
  • Package fee is an additional charge to be made for selecting this method.  This will be added as a shipment total to the order total.
  • Tax - this can follow your store rules or be set to reflect the shipping tax for your region.

{/tabs}

Mutliple shipment methods are often configured for a single store.

Notes to calculation of fees

Assume you need $100 and they want 5% as fee. Then you must actually borrow $105 and you have to pay fee for the $5 again => 100 +5 + 0.25 + 0.0125 + 0.00625 + 0.0003125 + ... = ~ 105,2690625....
We use a bit simplified formular and get 105.2631

It sounds first quite reasonable that a fee of 5% and a payment of 100 results in 105. But the The fee is not just x + % of x. Because x + % of x does not consider that the amount to pay increased by 5 and that you have to pay for this 5 again a fee of 5%. The calculation looks like this then => 100 +5 + 0.25 + 0.0125 + 0.000625 + 0.00003125 + ... = ~ 105,26315625.....

This is a geometric progression http://en.wikipedia.org/wiki/Geometric_progression. We use the direct formula

$cartTotalAmount = ($cartTotalAmountOrig + $method->cost_per_transaction) / (1 -($method->cost_percent_total * 0.01));

and get (100 + 0.0) / (1 - (5 * 0.01)) = 105.263157894737