close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Shipping based on column value

Thread began 12/14/2013 4:06 pm by bill173836 | Last modified 12/16/2013 5:15 pm by Jason Byrnes | 1207 views | 7 replies |

bill173836

Shipping based on column value

I have a store that only ships priority mail. The price is determined by which flat rate box is used. Each product table has a database field called shipping and in it I put the price of the box used. I want to use the shipping column in the product table to base my shipping on.

Example:
Item 1000 uses the small flat rate box which is $5.80
Item 1001 uses the medium flat rate box which is $12.35
My patron buys 2 Item 1000s and 1 Item 1001 so the total shipping should be $23.95

I also want to set the max shipping price to $50 so no matter now many they buy they never pay over $50 total

How would I set up this rule?

Sign in to reply to this post

Jason ByrnesWebAssist

since you already have a column that is storing the shipping rate, this is fairly strait forward:

on the calculation tab, create a totalShipping calcualtion similar to the totalPrice calcualtion, but use the shippping column:

[ShippingRate] * [Quantity]

this example uses a column named ShippingRate, if you use a different name, adjust the code accordingly


Then create the shipping rule as:
triggers:
"Subtotal for any column"
if the subtotal for column "totalShipping" is ">" a value of "0"

AND
"Subtotal for any column"
if the subtotal for column "totalShipping" is "<" a value of "50"

calculation:
"Based on Multiple of Column subtotal"
subtotal of column "totalShipping" times "1" "plus" "0"

Sign in to reply to this post

bill173836

I guess I need to cross one bridge at a time. I followed the instructions for the first rule and tested and I just got error messages. Just so I'm clear here is what I have and what I need for the first part.
My Products database is pretty basic productid, productname, productprice, etc and I added a field called shipping. Each product will have it's shipping determined by that product database field.

Example:
Product1 cost $5 to ship
Product2 cost $10 to ship
A client buys 2 Product1 and 1 Product2

On checkout the calculation is:

Total shipping would be ($5+$5)+($10)=$20

Sign in to reply to this post

Jason ByrnesWebAssist

  I followed the instructions for the first rule and tested and I just got error messages.  



what where the errors


i understand how you want the shipping to calculate, the above instructions will accomplish that.

Sign in to reply to this post

bill173836

Error: Parse error: syntax error, unexpected '[' in /home/content/06/7238106/html/loungedoctorlegrest/WA_eCart/siteCart_PHP.php on line 14
Line 14: $itmObj->totalShipping = [ProductShipping] * $itmObj->Quantity;//n

The database field name is ProductShipping

Sign in to reply to this post

Jason ByrnesWebAssist

but what is the name of the column in the cart object?

the cart object name for that column is what should be used in the calculation.

Sign in to reply to this post

bill173836

The database field is ProductShipping and the Column is Shipping

I tried to do it again and got rid of the message but now it doesn't show anything.

You can see the store at http://www.loungedoctorlegrest.com/products-detail.php?ProductID=1000

Here are the 2 files.

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

Jason ByrnesWebAssist

in the add to cart buttons behaviors, make sure the shipping column is bound to the ProductShipping column of the recordset


also, the shipping rule is not defined as I described earlier. th shipping rule should be set up as:


triggers:
"Subtotal for any column"
if the subtotal for column "totalShipping" is ">" a value of "0"

AND
"Subtotal for any column"
if the subtotal for column "totalShipping" is "<" a value of "50"

calculation:
"Based on Multiple of Column subtotal"
subtotal of column "totalShipping" times "1" "plus" "0"

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