Page 1 of 1

Flat rate plus per item shipping

Posted: Thu Mar 25, 2010 10:58 pm
by raquel
How can I implement a shipping cost of a flat rate plus a cost per item? For example, if I want to charge $5.95 plus $1 per item, how can I implement that? Is there a way to setup the modules already available, or is there a special download/programming needed?

Re: Flat rate plus per item shipping

Posted: Tue Mar 30, 2010 11:28 pm
by Qphoria
1. EDIT: catalog/model/shipping/item.php

2. FIND:

Code: Select all

'cost'         => $this->config->get('item_cost') * $this->cart->countProducts(),
3. REPLACE WITH:

Code: Select all

'cost'         => 5.95 + $this->config->get('item_cost') * $this->cart->countProducts(),
4. FIND:

Code: Select all

'text'         => $this->currency->format($this->tax->calculate($this->config->get('item_cost') * $this->cart->countProducts(), $this->config->get('item_tax_class_id'), $this->config->get('config_tax')))
5. REPLACE WITH:

Code: Select all

'text'         => $this->currency->format($this->tax->calculate(5.95 + $this->config->get('item_cost') * $this->cart->countProducts(), $this->config->get('item_tax_class_id'), $this->config->get('config_tax')))

Re: Flat rate plus per item shipping

Posted: Sat Jul 24, 2010 3:41 am
by logicalinsanity
This post was helpful to me, though I ended up going about it a little differently. Here's how I set a flat rate shipping cost for one item, with $1 added for each subsequent item:

1. Ensure Flat Rate Shipping is Enabled in 'Extensions > Shipping > Flat Rate'

2. Set flat rate shipping to $1 LESS than what you want your flat rate to be
(example: if you want a 5.95 flat rate, set the value to 4.95)

2. Open 'catalog > model > shipping > flat.php'

FIND:

Code: Select all

'cost'         => $this->config->get('flat_cost'),
 
REPLACE WITH:

Code: Select all

'cost'         => $this->config->get('flat_cost') + $this->cart->countProducts(),
 
FIND:

Code: Select all

'text'         => $this->currency->format($this->tax->calculate($this->config->get('flat_cost'), $this->config->get('flat_tax_class_id'), $this->config->get('config_tax')))
 
REPLACE WITH:

Code: Select all

'text'         => $this->currency->format($this->tax->calculate($this->config->get('flat_cost') + $this->cart->countProducts(), $this->config->get('flat_tax_class_id'), $this->config->get('config_tax')))
 
What This Does:

It takes your flat shipping rate value and adds the number of total items in your cart. So for example, if you want to charge a flat $5.95 plus $1 per each additional item, you set 'Extensions > Shipping > Flat Rate' to $4.95 (which is $1 less than your actual flat rate.

If a shopper has 1 item in their cart at checkout, it will calculate $4.95 (Flat Shipping Rate ) PLUS 1 (which is the quantity of items in cart) = $5.95 (correct shipping total for one item)

If a shopper has 2 items in their cart at checkout, it will calculate $4.95 + 2 (number of items in cart) = $6.95 (correct shipping total for two items).

The above code only works if you're specifically only charging $1 more for each additional item shipped. It wouldn't work if you wanted to charge, say, $2.50 for each additional item.

Re: Flat rate plus per item shipping

Posted: Sat Jul 31, 2010 7:47 am
by mastastealth
Is there a way to do this with the weight based shipping? I need both shipping costs and additional item costs to be different for my different zones.

Re: Flat rate plus per item shipping

Posted: Wed Aug 04, 2010 2:06 am
by Qphoria
mastastealth wrote:Is there a way to do this with the weight based shipping? I need both shipping costs and additional item costs to be different for my different zones.
not at this time but add it to the feature requests forum for future inclusion