Post by mmk » Wed May 21, 2008 11:20 am

I need to calculate the flat shipping rate based on the items/quantity ordered.

Please help.......

Also, I do not see weight.php file in /catalog/extensions/shipping. Could you please let me know how to get this file, in case if i need it
Last edited by mmk on Wed May 21, 2008 11:23 am, edited 1 time in total.

mmk
Newbie

Posts

Joined
Tue May 06, 2008 4:27 am

Post by bruce » Wed May 21, 2008 11:23 am

you can base your new shipping method on this contribution http://www.opencart.com/contribution/in ... tion_id/49

change the code that uses subtotal and replace it with some that uses quantity.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by mmk » Wed May 21, 2008 11:40 am

Hi Bruce,

I appreciate your prompt response. I am new to PHP and OpenCart tool.

Could you please point to the code from where I can get the qunatity in the cart ?

mmk
Newbie

Posts

Joined
Tue May 06, 2008 4:27 am

Post by bruce » Wed May 21, 2008 5:39 pm

There isn't anywhere specific that I can show you but you have some alternatives...
  • Look at catalog\controller\cart.php to see how to iterate through the products in the cart. You will see the quantity for each product, you only need to add them up into your own variable.
  • Extract the total number of products using your own sql query from the order_info table for the current order reference.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by mmk » Fri May 23, 2008 8:12 am

Thank you Bruce!

I will looking into the code and try making the changes. May get back to in case.....

mmk
Newbie

Posts

Joined
Tue May 06, 2008 4:27 am
Who is online

Users browsing this forum: No registered users and 1 guest