close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Shipping based on area and quantity

Thread began 6/08/2015 1:53 pm by ZP | Last modified 6/08/2015 4:42 pm by Ray Borduin | 373 views | 5 replies |

ZP

Shipping based on area and quantity

Hello,

I am trying to do a calculation in Cart 6.1 in relation to a shipping.

I have a attached a freight pricing sheet based on the following.

1. The freight is charge per ever 5 boxes and or items.

Example

Freight per one 1-5 items is the same
Example
up to 10 boxes (items) = $6.83
up to 10 boxes (items) = $13.65
up to 20 boxes (items) = $20.48

I have a freight in the database that reflect the charge as user_states which has all the charges in it.

as "charge1, charge2, charge3 charge4" etc.

How can I get the cart to reflect this freight price?

Sign in to reply to this post

Ray BorduinWebAssist

If you wanted to do it from the database, then you would add a recordset to the cart page and have it filter based on the value of $eCart1->TotalColumn("Quantity"). Once the recordset returns the correct charge, then you can store that as a session variable and use the Shipping tab in the eCart object to add a shipping charge equal to the value stored as that session variable.

Perhaps an easier way to do it is to not use the database and add the rows as individual shipping rules. You would add one shipping rule per price and set them "based on the number of items in the cart" with the flat rate charge based on your spreadsheet.

Sign in to reply to this post

ZP

There is a session variable set upon login "ship_state" which has a dollar value.

If I could help with adding some code to this line please:

//eCart Rule
function WAEC_eCart1_BigChill() {
$totalShipping = 0;
if (true && ((sizeof($this->Items) > 0))) {
$totalShipping += (floatval($this->GetInfo("5", "Quantity")) + 0.00);//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//end node

Sign in to reply to this post

Ray BorduinWebAssist

Don't edit the code directly. Use the eCart object to edit the code. If you start hand editing, then you won't be able to use our interfaces to make further edits in the future.

That code is controlled by the Shipping tab in the eCart object. Edit it from that interface.

Sign in to reply to this post

ZP

Yes I realise that I must use the interface.

I was wondering if you could please assist with the correct formula?

Please view the attachment.

Thanks

Sign in to reply to this post

Ray BorduinWebAssist

Just set it to charge "if session variable exists"

and set the charge amount the the session variable value like: $_SESSION['var_name']

Sign in to reply to this post

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...