Post by bluefall » Sat Jun 04, 2011 8:05 am

I'd like to have customer pay shipping fee on a flat + Per item rule:

For example, the shipping fee for the first 1-5 itemsis $20 and addtional $2 per item for addtional items.

How to set this kind of shipping fee?

Thanks!

Newbie

Posts

Joined
Wed Feb 16, 2011 3:48 am

Post by Johnathan » Sat Jun 04, 2011 10:01 pm

The easiest way is to make this edit:

IN:

Code: Select all

/catalog/model/shipping/item.php
REPLACE:

Code: Select all

$quote_data['item'] = array(
    'id'           => 'item.item',
    'title'        => $this->language->get('text_description'),
    'cost'         => $this->config->get('item_cost') * $this->cart->countProducts(),
    'tax_class_id' => $this->config->get('item_tax_class_id'),
    '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')))
); 
WITH:

Code: Select all

$cost = $this->config->get('item_cost') * $this->cart->countProducts();
$cost = ($cost < 20) ? 20 : $cost;
$quote_data['item'] = array(
    'id'           => 'item.item',
    'title'        => $this->language->get('text_description'),
    'cost'         => $cost,
    'tax_class_id' => $this->config->get('item_tax_class_id'),
    'text'         => $this->currency->format($this->tax->calculate($cost, $this->config->get('item_tax_class_id'), $this->config->get('config_tax')))
); 
If you need variable costs per quantity instead, I have a Quantity-Based Shipping extension that could handle it.

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 37 guests