Shipping charges based on total order

Problems installing or using the NOP Design Free Shopping Cart. **ARCHIVE** Please post new topics to one of the groups below.

Moderator: scott

Shipping charges based on total order

Postby scott » Mon Aug 05, 2002 8:28 pm

Hi,
Does your free shopping cart have the ability to charge shipping based on purchase amount?

Here is an example of our shipping charges:
$0-$8.00 shipping =$2.00
$8.01-$25.00 shipping=$4.95
$25.01-$50.00 shipping=$6.95

If your cart can do this could you please let me know what I would have to
change inorder to implement this.

Thanks for your time
Greg
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

Postby scott » Mon Aug 05, 2002 8:33 pm

You can make it very easily -- if you know a little javascript. Just
modify the WriteToForm function. Using version 4.2.2 of the cart, starting on line 639 you will see the code:

fTotal += (parseInt(fields[1]) * parseFloat(fields[2]) );
fShipping += (parseInt(fields[1]) * parseFloat(fields[4]) );
fTax = (fTotal * TaxRate);
strTotal = moneyFormat(fTotal);
strTax = moneyFormat(fTax);
strShipping = moneyFormat(fShipping);

Change this to:

fTotal += (parseInt(fields[1]) * parseFloat(fields[2]) );
//Start fixed shipping calculation
if( fTotal < 8 )
fShipping = 2;
else if( fTotal < 25 )
fShipping = 4.95;
else if( fTotal < 50 )
fShipping = 6.95;
else
fShipping = 0;
//Finish fixed shipping calculation
fTax = (fTotal * TaxRate);
strTotal = moneyFormat(fTotal);
strTax = moneyFormat(fTax);
strShipping = moneyFormat(fShipping);


The last line is for when the total is more than $50. Your case doesn't
cover that. I'm assuming here free shipping on orders over $50. You could change the '0' to whatever you would charge.

_Scott
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

Problem?

Postby daver6 » Fri Nov 15, 2002 2:30 am

This seems to work fine in ManageCart() and the shipping rate in the cart looks fine. However, when I go to checkout, CheckoutCart() shows what ever shipping rate is associated with the item, not the table in nopcart.js. The string showing in the command line

(checkout2.htm?Q=1&ID_1=SYL1&QUANTITY_1=1&PRICE_1=145.00&NAME_1=Syllabus&SHIPPING_1=0&ADDTLINFO_1=&TAX=11.96&SUBTOTAL=%24145.00&SHIPPING=%2415.00&TAX=%2411.96&TOTAL=%24171.96&Checkout.x=91&Checkout.y=21),

is corrrect, but it's not what's showing in the cart totals.

===========================

It's fixed. You need to add the revised code in nopcart.js TWICE. Once for the ManageCart() function and once further down for CheckoutCart().
daver6
 
Posts: 49
Joined: Wed Oct 09, 2002 7:15 pm

Postby iudex » Thu Nov 21, 2002 11:55 pm

Ok, this is AWESOME! Works like a charm.

Suggested improvements:

This site is a high end estate sterling silver company.

Orders up to $35.00 we calculate shipping at $6.00
Orders up to $75.00 we calculate shipping at $8.00
etc...
Orders over $800.00 we calculate shipping at 3% of the order total. A percentage based shipping calculation might not hurt, especially in the high dollar amounts.

Also, a way to set different rates for different shipping levels would be cool. For instance (in the above example) orders up to $35.00 are calculated at $6.00 shipping for UPS Ground. For Next Day Air add $16.00 if the client selects that option.

Just a thought.

SB
iudex
 
Posts: 8
Joined: Tue Oct 15, 2002 12:53 am

Shipping Methods

Postby daver6 » Fri Nov 22, 2002 1:03 am

The Shipping based on amount works fine. Thanks, Scott!

Shipping cost based on method would really help. Great idea! Lot's of times, our customers want a choice of shipping methods (UPS, FedEx 2 day, overnight, etc.). Adding that to the store would really help.
daver6
 
Posts: 49
Joined: Wed Oct 09, 2002 7:15 pm

PM Message

Postby scott » Fri Nov 22, 2002 8:15 pm

Got asked via PM/Email about making this work in 4.3. Here's the deal:

========

But to work with v.3, post the code listed to the nopcart.js file to BOTH lines: 968 AND 786. Please note to add it in that order or your line numbers will change. In both cases, it should be added immediately above the line:

if ( bDisplay ) {

Hope it helps!
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ

Postby scott » Wed Nov 27, 2002 11:44 pm

I posted a working version 4.3 managecart function with the shipping scale in this thread:

http://www.nopdesign.com/forum/viewtopi ... =1095#1095

_Scott
scott
Site Admin
 
Posts: 558
Joined: Sun Jul 14, 2002 7:00 pm
Location: Phoenix, AZ


Return to Installation and Setup Problems

Who is online

Users browsing this forum: No registered users and 0 guests