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

How do I add a charge to one specific item when the end user enters their "name" or "title?"

Thread began 7/19/2018 10:43 am by Supreme Geek | Last modified 8/03/2018 4:16 pm by Ray Borduin | 51 views | 9 replies |

Supreme Geek

How do I add a charge to one specific item when the end user enters their "name" or "title?"

I have a specific item that I want to add a charge of $5.00 when they enter their name or title. And when they don't enter their name or title I don't want the $5.00 charge added. Is there a way to do that? I have tried adding a rule for a specific item and I called one rule name and the other rule title. It adds the $5.00 charge but when I don't add the name or title it still charges the $5.00. As always, thanks in advance.
All the best,
Dale

Sign in to reply to this post

Ray BorduinWebAssist

You can update the TotalPrice Calculation in the cart from:

TotalPrice = [Price] * [Quantity]

to:

TotalPrice = ([Price] + ([Title]!=""?:5:0)) * [Quantity]

Sign in to reply to this post

Ray BorduinWebAssist

If you want to only add this charge for some items you can use:

TotalPrice = ([Price] + (([Title]!='' && ([Name]=='AUX-2000' || [Name] == 'AUX-2000X' || [Name] == 'AUX-2002' || [Name] == 'AUX-2002X'))?5:0)) * [Quantity]

or to exclude one use:

TotalPrice = ([Price] + (([Title]!="" && ([Name]!="AUX-2001"))?5:0)) * [Quantity]

This is done in the eCart dialog in the "Calculations" tab.

Sign in to reply to this post

Supreme Geek

How do I add a charge to one specific item when the end user enters their "name" or "title?"

Good day Ray!
I created a new calculation and pasted the code that you specified into the black space at the bottom. This is all that the box would let me paste: TotalPrice = ([Price] + (([Title]!=. I even tried selecting the "+" button above and right of the text box where I pasted the code and tried adding it to "TotalPrice." All I get is another dialog box with Name, Weight, TotalPrice and such. If I select the new calculation name, the text box at the bottom clears any input. The same with the "TotalPrice" calculation that already was there. Even if I select OK after pasting the code inside all I get to input is: TotalPrice = ([Price] + (([Title]!=. I even tried inputting the code by hand and I can get no further than TotalPrice = ([Price] + (([Title]!=. So, I must be missing something eh? Thank you for your help! Have a nice day!
All the best,
Dale

Sign in to reply to this post

Ray BorduinWebAssist

This was my mistake. You have to use single quotes and not double quotes in calculations. I've updated the code above so it should work now.

Sign in to reply to this post

Supreme Geek

E-Cart object error...

Good morning Ray,
I put the code into the Calculations tab with no problem. However, now when I go to view the store online I can't access any of the pages. I get a HTTP 500 error. What do I need to do to fix it? I tried "putting" the ecart1.php, cart.php and WA_eCart_Definition_PHP.php files to no avail. Also, there are a whole lot of question marks in front of all of the PHP file names. I even tried to revert the calculation to the one before and it didn't work either. Please help!
Thanks,
Dale

Sign in to reply to this post

Ray BorduinWebAssist

Can I get a URL to reproduce a problem and FTP access to debug? I'll take a look and make sure to get it fixed.

Sign in to reply to this post

Ray BorduinWebAssist

It looks like when you pasted your calculation you left the: "TotalPrice = "

You should have just copied and pasted the code after the column when creating the calculation. I've fixed it on your page.

Sign in to reply to this post

Supreme Geek

E-Cart object error...

Good morning Ray,
Once you fixed the error, now when someone orders items in the store and the order is processed through Authorize.net, a (WA) keeps appearing with each item on the e-mail receipt that is sent to my boss. In the example below you will find the offending (WA) characters under "ORDER INFORMATION." I am unable to figure this one out. Before the new code was input, there was no (WA). Thank you for you help and patience with this matter.
Dale

*NOTIFICATION* - An additional copy of this receipt was emailed to supremehqmoc@lotcs.org due to a gateway setting that was passed in at the time this transaction was submitted. If this e-mail address does not belong to someone in your organization, it could indicate fraudulent activity.

========= SECURITY STATEMENT ==========
It is not recommended that you ship product(s) or otherwise grant services relying solely upon this e-mail receipt.

========= GENERAL INFORMATION =========
Merchant : SUPREME PUP TENT M O C (1912513)
Date/Time : 31-Jul-2018 11:07:19 PDT

========= ORDER INFORMATION =========
Invoice :
Description : 1 Large (1294), (WA), 1 (624H), (WA), 1 (624J), (WA), 1 (9999A), (WA), 1 (9973), (WA), 1 VA
Amount : 186.00 (USD)
Payment Method: Visa xxxx9594
Transaction Type: Authorization and Capture

============== Line Items ==============

============== RESULTS ==============
Response : This transaction has been approved.
Auth Code : 01595D
Transaction ID : 61210421075
Address Verification : Street Address: Match -- First 5 Digits of Zip: Match

==== CUSTOMER BILLING INFORMATION ===
Customer ID :
First Name : David
Last Name : Goldstein
Company :
Address : 302 Rutherglen Muse
City : virginia beach
State/Province : VA
Zip/Postal Code : 23452
Country : US
Phone : 7576500244
Fax :
E-Mail : cheng186@cox.net

==== CUSTOMER SHIPPING INFORMATION ===
First Name : David
Last Name : Goldstein
Company :
Address : 302 Rutherglen Muse
City : virginia beach
State/Province : VA
Zip/Postal Code : 23452
Country : US

======= ADDITIONAL INFORMATION ======
Tax :
Duty :
Freight :
Tax Exempt : No
PO Number :

========== MERCHANT DEFINED =========
x_ship_to_phone : 7576500244
x_ship_to_fax :
Submit_order : Checkout

Sign in to reply to this post

Ray BorduinWebAssist

You had an older version of the WA_eCart_Definition_PHP.php file in the root of the site that was overriding the new version your site should have used. I deleted it and that appears to have fixed the issue.

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