close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Additional Fee charged for specific size T-shirts

Thread began 12/15/2011 3:54 pm by elewis93815 | Last modified 1/03/2012 4:30 pm by elewis93815 | 922 views | 8 replies |

elewis93815

Additional Fee charged for specific size T-shirts

Hi We've built a T-Shirt website using eCart5 and need to charge $19.00 for shirt sizes small - Large and we need to charge an additional $3.00 for sizes XL, XXL, and XXXL. Please advise on how to charge the additional $3.00

Thanks

Erick

Sign in to reply to this post

Nathon Jones Web Design

incremental charge

Hi Erick,

Are your sizes stored in a database table?

In my experience, in order to acheive what you describe, you'd need to add an additional field to your 'Sizes' database table which stores an incremental value, $3 in your case, for each size that you need to charge an additional fee for.

You then need to store that incremental value in your cart, when the customer is adding items to basket, and add/apply that incremental value to the 'Price' value once it's in the basket.

Hope that gives you some ideas.
Nath.

Sign in to reply to this post

elewis93815

Thank you Nathon for your response! What makes this a bit unique, i think, is that we are calling the Tshirt color and size via a list menu and not from the record set / database. How would we achieve this using this method?

Sign in to reply to this post

Jason ByrnesWebAssist

you could do this using a calculation in the eCart object on the calculations tab.

assuming that the values being passed for the size select list are "XL", "XXL" and "XXXL", and that the name of the size column is "Size"

create a new calculation named truePrice as:
(abs([Size] == 'XL' || [Size] == 'XXL' || [Size] == 'XL'))?[Price] + 3:[Price]


then change the TotalPrice calculation:
[Price] * [Quantity]

to:
((abs([Size] == 'XL' || [Size] == 'XXL' || [Size] == 'XL'))?[Price] + 3:[Price]) * [Quantity]


and in the cart display, replace the binding for the Price column with the binding for the truePrice.

Sign in to reply to this post

elewis93815

Thank you very much for the direction! I did all of the steps you have recommended and it works when I try to add to cart any t shirt that is a 2XL or higher, however, when I try to order a t shirt that is a small, medium, large I get the following error:

Fatal error: Call to undefined method bakatus_ItemDefinition::Quantity() in /home/content/52/8601252/html/WA_eCart/bakatus_PHP.php on line 340

On a side note, when I order a XL, it is sent to the cart but the charge that shows is just $3.00. i'm pretty sure that my calculation formula is off but I'm not sure what to change to fix the problem.

Thanks again,

Jackie

Attached Files
BAKATUS WA SIZE ERROR.zip
Sign in to reply to this post

Jason ByrnesWebAssist

change the Total Price calcualtion:

php:
(abs([Size] == '2XL' || [Size] == '3XL' || [Size] == '4XL' || [Size] == '5XL' || [Size] == 'XL'))?[Price] + 3:[Price] * [Quantity](abs([Size] == '2XL' || [Size] == '3XL' || [Size] == '4XL' || [Size] == '5XL' || [Size] == 'XL'))?[Price] + 3:[Price] * [Quantity](abs([Size] == '2XL' || [Size] == '3XL' || [Size] == '4XL' || [Size] == '5XL' || [Size] == 'XL'))?[Price] + 3:[Price] * [Quantity]





to:

php:
((abs([Size] == '2XL' || [Size] == '3XL' || [Size] == '4XL' || [Size] == '5XL' || [Size] == 'XL'))?[Price] + 3:[Price]) * [Quantity]




if you continue to have a problem, include a link where i can see the problem with your reply

Sign in to reply to this post

elewis93815

Thanks Jason, the only thing that is causing issue is that the additional $3.00 is applying to the XL as well which it should only be 2XL and Higher. This is what I currently have in the TotalPrice calculation:

((abs([Size] == '2XL' || [Size] == '3XL' || [Size] == '4XL' || [Size] == '5XL' || [Size]))?[Price] + 3:[Price]) * [Quantity]

The website store link is: products.php

Sign in to reply to this post

Jason ByrnesWebAssist

in the copy of the cart you sent,

XL is included in the calculation for truePrice:

php:
(abs([Size] == '2XL' || [Size] == '3XL' || [Size] == '4XL' || [Size] == '5XL' || [Size] == 'XL'))?[Price] + 3:[Price]





change that to:

php:
(abs([Size] == '2XL' || [Size] == '3XL' || [Size] == '4XL' || [Size] == '5XL'))?[Price] + 3:[Price]




and set the total price calculation to:

php:
((abs([Size] == '2XL' || [Size] == '3XL' || [Size] == '4XL' || [Size] == '5XL'))?[Price] + 3:[Price]) * [Quntity]
Sign in to reply to this post

elewis93815

Thank you very much, it worked great!

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