Changing the shipping calculation in magento

Syed Irfan Ahmed picture Syed Irfan Ahmed · Dec 20, 2011 · Viewed 7.2k times · Source

I have a magento shop which uses shipping zones method for calculating shipment price.

It works but there is one small issue , I am unable to offer quantity discounts for the same product if the user adds to his cart multiple times with different color. Each time the product is added it is taken as a separate products . for eg shipping 1 unit of product x (irrespective of color) costs 20 usd, shipping 4 units of product x (irrespective of color) costs 50 usd (i.e 30 usd quantity discount ...more quantity less per unit cost)

Now if the customer choose 4 black tables the shipment cost is correctly calculated as 50 usd BUT if the customer chooses 1 back, 1 white , 1 green and 1 red the calculation is incorrectly done to usd 80.

How can I fix this issue as a magento should be taking into account 4 quantity of the same product and NOT 4 different products/

Answer

ʍǝɥʇɐɯ picture ʍǝɥʇɐɯ · Feb 20, 2012

I don't think this is achievable with Shopping Cart Rules, particularly if you want your delivery costs to be separate to the product prices (from an accounting point of view you may want to keep track on delivery).

Hence...

...you need to write your own shipping module.

Here is the tutorial I have found to be of the most use:

http://www.excellencemagentoblog.com/magento-create-custom-shipping-method

Included in the tutorial are lots of examples of how to iterate over the cart and apply custom rules.

A module may seem a lot of work, however, once you have something you will be able to do a better job of shipping, for the customer, the company book keeper and the bottom line.