Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 01-28-2005 14:55:09

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Mini-cart: Shipping Totals

I have fixed shipping cost on my items, and I would like to be able to show the mini cart as:


Sub-Total = $0.00
Shipping   =$0.00
-------------------
Total  = $0.00


How can I should this and get this to work?


Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#2 02-02-2005 13:20:36

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Re: Mini-cart: Shipping Totals

Bump - Anyone?


Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#3 02-08-2005 13:16:11

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Mini-cart: Shipping Totals

How are you storing shipping info in the cart?  Are these all default method products?


Nick Hendler

Offline

 

#4 02-08-2005 13:22:29

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Re: Mini-cart: Shipping Totals

Yes default method, not real-time shipping.


Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#5 02-08-2005 15:13:13

webmaster
Administrator
From: York, PA
Registered: 04-20-2001
Posts: 19798
Website

Re: Mini-cart: Shipping Totals

How many different levels of default prices are you using - 1, 2 or 3?  If it's more than 1, which should we assume the user will pick?


Nick Hendler

Offline

 

#6 02-08-2005 15:26:40

EagleWolf
Member
From: Daytona Beach, FL
Registered: 07-27-2003
Posts: 979

Re: Mini-cart: Shipping Totals

For product based shipping, there are 3 options, I say make option 1 the default, and the customer "could" change that once they go to checkout - right?

Also is it possible to include the Customer shipping script in this, so that if they choose to use a custom script (like fre shipping for orders over 50.00) the cart will reflect the free, once they hit 50.00 in sales?

As for realtime, I know that would not be possible unless the customer is logged to their customer account, then the mini cart "sould" calulate the realtime shipping charges based on the default customers ship to address.

Another option would be to require a ZIP CODE when they enter a product to the cart, so they it would calcuate the real-time shipping then, there could be a pop-up asking for the zip code? Just a thought- don't mean to start getting to "Pie in the Sky" on you.


Chris
<a href='mailto:webmaster@equivity.com'>webmaster@equivity.com</a>
-

Offline

 

#7 02-08-2005 20:51:13

WayneK
Member
Registered: 08-17-2003
Posts: 256
Website

Re: Mini-cart: Shipping Totals

For simple shipping one could use the code from the shipping script.

in ste_cart_pl in the mini cart sub routine, after

Code:

$mini_quantity   = ($mini_quantity + $cart_prodquantity);
$mini_total      = ($mini_total + $cart_amtprod);
$mini_totalrecur = ($mini_totalrecur + $cart_amtrecur);

} ######### End of foreach statement.

if ($cart_prodquantity > 0) {

if ($mini_total >= "0" && $mini_total <= "40.00") {

$mini_ship_total = "6.00";

} elsif ($mini_total > "40.00" && $mini_total <= "74.00") {

$mini_ship_total = "5.50";

} elsif ($mini_total > "74.00" && $mini_total <= "99.99") {

$mini_ship_total = "4.50";

} else {

$mini_ship_total = "0.00";

}
} else {
$mini_ship_total = "0.00";
}

$mini_ship_total = sprintf("%.2f", $mini_ship_total);

replace

Code:

$mini_total      = sprintf("%.2f", $mini_total);
$mini_totalrecur = sprintf("%.2f", $mini_totalrecur);

with
$mini_total = ($mini_total+$mini_ship_total);
$mini_total = sprintf("%.2f", $mini_total);
$mini_totalrecur = sprintf("%.2f", $mini_totalrecur);

then in ste_layout

add (CGIVAR)mini_ship_total(/CGIVAR) where you want the shipping to appear

I am sure this could be adapted to reflect other shipping based on cost. If it based on weight we need to get the weight from someplace.


- Wayne
<-- Witty Clever Phrase Goes Here -->

Offline

 

#8 11-11-2005 04:43:29

daz_phil
Member
Registered: 10-11-2005
Posts: 52

Re: Mini-cart: Shipping Totals

This looks great. I would like to do the same but reflect the UK shipping price just for UK. However, 'product weight' is the yardstick rather than 'product cost'.

So could I use the script below and how could I get have the script recognise the the item_total_weight which I think is calculated in the ste_chkout.pl

Any help greatly appreciated... Thanks, DP


if ($cart_prodquantity > 0) {

if ($item_total_weight >= "0" && $item_total_weight <= "500") {

$mini_ship_total = "0.95";

} elsif ($item_total_weight >= "500" && $item_total_weight <= "1000") {

$mini_ship_total = "1.95";

} elsif ($item_total_weight >= "1000" && $item_total_weight <= "1500") {

$mini_ship_total = "3.95";

elsif ($item_total_weight >= "1500" && $item_total_weight <= "2000") {

$mini_ship_total = "4.95";

} else {

$mini_ship_total = "6.95";

}
} else {
$mini_ship_total = "0.00";
}

Offline

 

#9 11-14-2005 07:44:24

daz_phil
Member
Registered: 10-11-2005
Posts: 52

Re: Mini-cart: Shipping Totals

a reply would be really helpful...
Thanks v much.

Offline

 

#10 11-14-2005 08:21:18

dtwg
Member
From: California
Registered: 11-15-2004
Posts: 1339
Website

Re: Mini-cart: Shipping Totals

I haven't tested this, but it should give you a variable called $mini_weight that you can use in your shipping calculation...

This is the code to replace within ste_cart_mini (it is not the whole sub). Backup your ste_cart.pl file before you do this, of course.

HTH,

Dave

Code:

$sql_statement = "

SELECT cart_prodquantity,cart_amtprod,cart_amtrecur,cart_prodshipweight
FROM cart

";

@mini = database_call('cart','SELECT',$sql_statement);

foreach $row(@mini) {

($cart_prodquantity,$cart_amtprod,$cart_amtrecur,$cart_prodshipweight) = @$row;

$mini_quantity   = ($mini_quantity + $cart_prodquantity);
$mini_total      = ($mini_total + $cart_amtprod);
$mini_totalrecur = ($mini_totalrecur + $cart_amtrecur);
$mini_weight = ($mini_weight + $cart_prodshipweight);

} ######### End of foreach statement.

$mini_total      = sprintf("%.2f", $mini_total);
$mini_totalrecur = sprintf("%.2f", $mini_totalrecur);
$mini_weight = sprintf("%.0f", $mini_weight);

Offline

 

#11 11-14-2005 19:38:38

daz_phil
Member
Registered: 10-11-2005
Posts: 52

Re: Mini-cart: Shipping Totals

Dave - thanks for helping me out again!

Not working yet but here's what I did:

I inserted your code then after the

} ######### End of foreach statement.

in your code I inserted my code changing '$item_total_weight' for '$mini_weight'

So now that part of the sub looks like this:


$sql_statement = "

SELECT cart_prodquantity,cart_amtprod,cart_amtrecur,cart_prodshipweight
FROM cart

";

@mini = database_call('cart','SELECT',$sql_statement);

foreach $row(@mini) {

($cart_prodquantity,$cart_amtprod,$cart_amtrecur,$cart_prodshipweight) = @$row;

$mini_quantity   = ($mini_quantity + $cart_prodquantity);
$mini_total      = ($mini_total + $cart_amtprod);
$mini_totalrecur = ($mini_totalrecur + $cart_amtrecur);
$mini_weight = ($mini_weight + $cart_prodshipweight);

} ######### End of foreach statement.

if ($cart_prodquantity > 0) {

if ($mini_weight >= "0" && $mini_weight <= "500") {

$mini_ship_total = "0.95";

} elsif ($mini_weight >= "500" && $mini_weight <= "1000") {

$mini_ship_total = "1.95";

} elsif ($mini_weight >= "1000" && $mini_weight <= "1500") {

$mini_ship_total = "3.95";

elsif ($mini_weight >= "1500" && $mini_weight <= "2000") {

$mini_ship_total = "4.95";

} else {

$mini_ship_total = "6.95";

}
} else {
$mini_ship_total = "0.00";
}

$mini_ship_total = sprintf("%.2f", $mini_ship_total);

$mini_total = sprintf("%.2f", $mini_total);
$mini_totalrecur = sprintf("%.2f", $mini_totalrecur);
$mini_weight = sprintf("%.0f", $mini_weight);

I'm way out my depth but giving it a go. I got a few syntax errors in the browser so I broke it some how.
I haven't put the add (CGIVAR)mini_ship_total(/CGIVAR) in the ste_layout yet though.

Do you want to know what the syntax errors read?

Bit more help would be great here to put me back on track.

Big thanks,
Darren.

Offline

 

#12 11-14-2005 21:43:44

dtwg
Member
From: California
Registered: 11-15-2004
Posts: 1339
Website

Re: Mini-cart: Shipping Totals

Looks like you left off a curly brace here (see arrow in second line)

So change:

Code:

$mini_ship_total = "3.95";

---> elsif ($mini_weight >= "1500" && $mini_weight <= "2000") {

$mini_ship_total = "4.95";

to:

Code:

$mini_ship_total = "3.95";

} elsif ($mini_weight >= "1500" && $mini_weight <= "2000") {

$mini_ship_total = "4.95";

See if that helps. If not and you get any syntax errors, by all means post them!

thx,

Dave


Offline

 

#13 11-15-2005 10:25:26

daz_phil
Member
Registered: 10-11-2005
Posts: 52

Re: Mini-cart: Shipping Totals

Dave - that has worked a treat - take a look

Now the only problem seems to be that it will add the weight of each separate item added but if you order more than one of the same item it assumes theres only one of that particular item. The main checkout shipping script works ok however.

Nearly there...

Darren.

Offline

 

#14 11-15-2005 10:43:01

dtwg
Member
From: California
Registered: 11-15-2004
Posts: 1339
Website

Re: Mini-cart: Shipping Totals

Hi Darren,

Glad it's starting to work.

Try changing

Code:

$mini_weight = ($mini_weight + $cart_prodshipweight);

to

Code:

$mini_weight = ($mini_weight + ($cart_prodshipweight * $cart_prodquantity));

Let me know if it doesn't work. Sorry, my bad.

Dave

Offline

 

#15 11-15-2005 11:50:07

daz_phil
Member
Registered: 10-11-2005
Posts: 52

Re: Mini-cart: Shipping Totals

Dave - That worked. I am extremely grateful for all the help you have given me both on this thread and others (as you know!)

Cheers Big Ears smile

Darren

Offline

 

Board footer