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

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Modifying Shipping

Thread began 4/03/2011 7:01 pm by mora398588 | Last modified 4/12/2011 6:42 pm by mora398588 | 2260 views | 20 replies |

mora398588

Modifying Shipping

I have been attempting to modify my shipping rates using the eCart Object. However, the object is returning a JavaScript error I can't seem to pass.

What I am wanting to do is to modify my shipping to reflect a flat rate with a per item charge starting with the second item in the cart. I would like eCart to check against my sql-database for a specific value of 1 to ensure that the cart does not assess a S&H charge for any items not requiring shipping.

Your assistance would be greatly appreciated. I have included a copy of my eCart1_PHP and checkout.php files for your review.

Again, thank you in advance.

Attached Files
checkout (2).zip
eCart1_PHP.zip
Sign in to reply to this post

Jason ByrnesWebAssist

What is the javascript error you are getting?

have you tried deleting the Dreamweaver Cache file from the users configuration folder:
common_installation_issues.pdf




For the shipping charge, set the calcualtion to use:
Based on items with a specific value:

Total of 'Quantitity' where 'shipable' has a value of '1' 'time' '0.50 (-0.50)'


the (-0.50) will subtract the first shipping charge so that it only reflects the 22nd and above.

Sign in to reply to this post

mora398588

Please see attachment to view the error.

Also, I attempted to make inactive the current shipping algorithms for a set of new ones to reflect the shipping calculations I prefer. This did not work. It also made all my webpages that access the eCart object to go blank.

I think I made a mess of things. At this time, my attempts to correct the problem has failed. My e-commerce site is not working (all blank pages).

I also noticed that my eCart Object (under the shipping tab) is reflecting 2 of the shipping and handling and 2 of the shipping and handling per item. I am unable to delete these without the javascript error popping up (see attached). You may wish to reference the attachments I provided in my last post.

Any assistance would be helpful. Thank you.

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

Jason ByrnesWebAssist

In the WA_ecart/eCart1_PHP.php file change lines 87 - 90:

php:
$this->Shipping[] = new WA_eCart_Rule(urldecode("Shipping%20&%20Handling"), false, "WAEC_eCart1_ShippingHandling");

  $this->Shipping[] = new WA_eCart_Rule(urldecode("Shipping%20&%20Handling%20per%20item"), true, "WAEC_eCart1_ShippingHandlingperitem");
  $this->Shipping[] = new WA_eCart_Rule(urldecode("Shipping%20&%20Handling"), false, "WAEC_eCart1_ShippingHandling");
  $this->Shipping[] = new WA_eCart_Rule(urldecode("Shipping%20&%20Handling%20per%20item"), true, "WAEC_eCart1_ShippingHandlingperitem");


to:

php:
$this->Shipping[] = new WA_eCart_Rule(urldecode("Shipping%20&%20Handling"), false, "WAEC_eCart1_ShippingHandling");

  $this->Shipping[] = new WA_eCart_Rule(urldecode("Shipping%20&%20Handling%20per%20item"), true, "WAEC_eCart1_ShippingHandlingperitem");
Sign in to reply to this post

mora398588

Thank you for the code correction. My e-commerce site is up now.

However, the shipping functions are still off. The S&H per item function (which I set at 0.50 per item) is adding this additional fee to the first item. It is my preference that the per item fee start with 2nd item and thereafter.

I attempted to follow your directions in adding the following... (-0.50). This created additional issues, such as the cart page showing as an all white screen.

This is what I did... [Total of 'Quantitity' where 'TotalWeight' has a value of '1' 'time' '0.50 (-0.50)']

I replaced the word 'shipable" with 'TotalWeight' since this is where I indicate whether the item is shipable or not.

I am assuming that the above modifications were meant for the "S&H per item" and not the "Shipping and Handling".

I have included a copy of my eCart_PHP file for your review.

Your assistance is appreciated.

Attached Files
eCart1_PHP (2).zip
Sign in to reply to this post

Jason ByrnesWebAssist

in the WA_ecart/eCart1_PHP.php file change

change:

php:
$totalShipping += ($this->ConditionalTotal("Quantity", "TotalWeight", "1") * 0.50);//Result




to:

php:
$totalShipping += (($this->ConditionalTotal("Quantity", "TotalWeight", "1") * 0.50) - 0.50);//Result
Sign in to reply to this post

mora398588

Once again, thank you for your help.

The change worked out well. However, there appears to be a side effect. I tested the cart by modifying the quantity of an item that requires shipping. When I manually modified the quantity in the cart to reflect 2 items, I proceeded to click on the 'update' button and the shipping charges disappeared.

I tested the cart again by going back to my e-commerce site and proceeded to add the same item to cart by using the add to cart button. The results were the same.

You can visit my site at hrproducts.php to test what I am seeing.

Sign in to reply to this post

Jason ByrnesWebAssist

the problem is that you are using the TotalWeight Column. The total Weight colummn is calucalated as Weight * Quantity.

if you have 2 1lb items in the cart, the totalweight is now equal to 2, not 1.

use the weight column instead.
$totalShipping += (($this->ConditionalTotal("Quantity", "Weight", "1") * 0.50) - 0.50);//Result


also, for the Base shipping and handing chage, set the trigger to be:
number of items with a specific column value:
If the totla number of items where 'Wight' has a value of '1' is '>' a value of '0'

and set the charge to a flat rate of 5.50

Sign in to reply to this post

mora398588

I made the changes you recommended. However, I did not change the Total Weight to Weight. Doing so would require me to update all my e-commerce webpages. So, as a way out, I modified the TotalWeight Column to that of an integer. I updated all my shippable items to reflect a value of 1.

Going back to your recent recommendation. Even with your recommended changes, the cart is still erasing the shipping calculation when the quantity field is manually updated. For example, if a shopper wishes to increase the quantity of an item being ordered from one to two of the same item by changing the quantity figure manually in the cart and then clicking the 'update' button, the cart appears to not recognize the change in quantity and removes the shipping calculations completely. When you attempt to go to checkout (without the shipping calculations), the value does not pass through.

However, if the quantity value is not manually changed, the shipping calculations work just fine.

I am at a loss as to what to do. Do you have any other thoughts? I have included an updated copy of my eCart_PHP file (with your recommended changes) for your convenience.

Attached Files
eCart1_PHP(3).zip
Sign in to reply to this post

Jason ByrnesWebAssist

you wont need to change anything if you change the charge to use wight instead of total weight.


the cart calculates the totalweight as wight * quantity.

when you put one item in the cart, the total weigh calculation returns 1 (1 * 1 - 1)

when you add a second item to the cart, the totalweight no longer equals 1 (1 * 2 = 2) so the shipping is not longer applied.

you need to use the weight column in your calculations not total; weight.

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