close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

eCart not calculating shipping correcty

Thread began 9/26/2011 11:23 am by info271221 | Last modified 10/10/2011 5:34 am by info271221 | 10408 views | 10 replies |

info271221

eCart not calculating shipping correcty

When more than one line items are in the At Home cart…..the cart is not adding the net weights of each line item to arrive at a totaled order net weight. As well, it is basing SH and freight calculations off of the total net weight of line item #1 only as opposed to total net weight of the order.

Attached Files
eCartHomesteadHomeUse_PHP.zip
Sign in to reply to this post

Jason ByrnesWebAssist

on the confirm page, edit the Fedex Shipping rate lookup behavior. on the last page of the behavior wizard, make sure the package weight option is using:

php:
<?php echo WA_eCart_FormatNumber($yourCartName->TotalColumn('TotalWeight'), true1); ?>





where "yourCartName" is the name of your eCart object.

Sign in to reply to this post

info271221

Originally Said By: Jason Byrnes
  on the confirm page, edit the Fedex Shipping rate lookup behavior. on the last page of the behavior wizard, make sure the package weight option is using:

php:
<?php echo WA_eCart_FormatNumber($yourCartName->TotalColumn('TotalWeight'), true1); ?>




where "yourCartName" is the name of your eCart object.  


I tried to find that code or something similar doing a find on the confirm page and searching the source of all open documents and could not find anything. I then searched things like FormatNumber, TotalWeight to see what I could find and I found this.
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".WA_eCart_FormatNumber($eCartHomesteadHomeUse->DisplayInfo('TotalWeight') + $addedWeight, true, 1) ."";

Sign in to reply to this post

info271221

eCart Shipping only calculating on line item 1

Line #177 on the eCartHomeUsePHP.php attached in the original post had *0
I changed it to *1 but I really don't understand what this code is saying. This is the checkout for home use products, and we copied the cart from the wholesale and made modifications. On the wholesale side we were *.25 to add 25% to the order. So on the home use (retail) we did not want to add the 25% so I removed it. Can you explain what we are saying here and advise if the TotalPrice")*1.0 is correct or what it should be.

We don't want to add a upcharge we just want all the line items in the cart to total up.
Also any help you can give me to direct me to where we tell the cart to total all line items and calculate the weight from all line items. (which is what I believe you were directing me to in your post above but I cannot find any similar code)

I have attached the confirm and fed ex pages.

function WAEC_eCartHomesteadHomeUse_VariableAuth() {
$totalCharge = 0;
if (true && ((sizeof($this->Items) >= 0))) {
$totalCharge += (($this->TotalColumn("TotalPrice") * 1.0) + 0);//Result
}
return WA_eCart_FormatNumber($totalCharge, $this->ForceDecimalsC, $this->DecimalPlacesC);
}

Thank You,

Attached Files
WA_eCart_FedEx_PHP.zip
Sign in to reply to this post

Jason ByrnesWebAssist

for the shipping issue, on line 543 of the confirm page:

php:
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".WA_eCart_FormatNumber($eCartHomesteadHomeUse->DisplayInfo('TotalWeight') + $addedWeight, true, 1)  ."";




change that to:

php:
$Shipping_PackageArray[$Shipping_PackageIndex]["PackageWeight"] = "".WA_eCart_FormatNumber($eCartHomesteadHomeUse->TotalColumn('TotalWeight') + $addedWeight, true, 1)  ."";







for your question about this code:

php:
function WAEC_eCartHomesteadHomeUse_VariableAuth() {

$totalCharge = 0;
if (true && ((sizeof($this->Items) >= 0))) {
$totalCharge += (($this->TotalColumn("TotalPrice") * 1.0) + 0);//Result
}
return WA_eCart_FormatNumber($totalCharge, $this->ForceDecimalsC, $this->DecimalPlacesC);
}




this is saying:
If there are any items in the cart, charge (cart subtotal * 1 ) + 0

if the subtotal is 100, that would be:
(100 * 1) + 0


which equals 100.

in other words, that calculation is not doing anything since (100 * 1) + 0 = 100

Sign in to reply to this post

info271221

eCart Totals appear to be working, delete other?

Thanks! The eCart totals appear to be working. My customer is double checking.

For the 2nd chunk of code I can safely revise to:
function WAEC_eCartHomesteadHomeUse_VariableAuth()
return WA_eCart_FormatNumber($totalCharge, $this->ForceDecimalsC, $this->DecimalPlacesC);
}

If not, what would be correct?

Sign in to reply to this post

Jason ByrnesWebAssist

you dont really need to make any changes, you can leave that second chunk as is.

Sign in to reply to this post

info271221

Shipping and Handling Charges also calculating off line item 1

It appears the Shipping and Handling Charges are also calculating off line 1 only as the S&H charge will increase when I increase the QTY of line item 1 but not line item 2. We are calculating the S&H with a flat fee of $5 plus a cooler fee based on weight. Those calculations are lines 465-509 on the confirm page.

I tried changing line 538 to say "TotalColumn" verses DisplayInfo (just a wild guess going off your solution for the freight charges on line # 534 which worked GREAT - Thank You!!)

Sign in to reply to this post

info271221

eCart Calculations still off

The cart calculations are still off per my previous post. Please advise if I need to pay for support ticket to get a response to this. Thanks!

Sign in to reply to this post

Jason ByrnesWebAssist

on the confirm page, you have this code for the cooler weight:

<?php
$packageLength = "11";
$packageWidth = "8";
$packageHeight = "6";
$_SESSION["CoolerCost"] = 10;
$addedWeight = 3;
if ($eCartHomesteadHomeUse->DisplayInfo("TotalWeight") > 5) {
$packageLength = "15";
$packageWidth = "12";
$packageHeight = "9";
$_SESSION["CoolerCost"] = 13;
$addedWeight = 4;
}
if ($eCartHomesteadHomeUse->DisplayInfo("TotalWeight") > 10) {
$packageLength = "21";
$packageWidth = "17";
$packageHeight = "13";
$_SESSION["CoolerCost"] = 18;
$addedWeight = 5;
}
if ($eCartHomesteadHomeUse->DisplayInfo("TotalWeight") > 27) {
$packageLength = "24";
$packageWidth = "16";
$packageHeight = "14";
$_SESSION["CoolerCost"] = 20;
$addedWeight = 5;
}
if ($eCartHomesteadHomeUse->DisplayInfo("TotalWeight") > 40) {
$packageLength = "28";
$packageWidth = "21";
$packageHeight = "17";
$_SESSION["CoolerCost"] = 25;
$addedWeight = 7;
}
if ($eCartHomesteadHomeUse->DisplayInfo("TotalWeight") > 60) {
$packageLength = "28";
$packageWidth = "21";
$packageHeight = "16";
$_SESSION["CoolerCost"] = 35;
$addedWeight = 7;
}
?>




change each instance of:
$eCartHomesteadHomeUse->DisplayInfo("TotalWeight")


to:
$eCartHomesteadHomeUse->TotalColumn("TotalWeight")


If you are still having a problem after making that change, I would suggest a premier ticket since this is dealing with problems in your custom coding.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...