modDiscounts.asp help needed
Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=4140
Printed Date: 21-November-2024 at 3:06pm Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com
Topic: modDiscounts.asp help needed
Posted By: katharina
Subject: modDiscounts.asp help needed
Date Posted: 11-November-2010 at 10:57am
Posted it yesterday in the wrong section, so here it is again.
I need some help with the modDiscounts.asp file in version 3.51 with parent path enabled. I like to offer a
coupon that automatically adds a free calendar to each order. I was
basically using the Amount Discount radio button, but it does not allow
me to put a 0.00 amount into it. I can put 0.01 as a discount to make
it work, but I rather do not give any money back to the customer for a
free item. So I need some help trying to figure out how to overwrite
the 0.00 amount checking in the modDiscounts.asp file. Thanks,
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Replies:
Posted By: intour
Date Posted: 12-November-2010 at 6:01pm
Hi Katharina,
As a suggestion why don't you give the free calendar a price and then make the discount coupon equal to the price of the calendar so that it ends up being free.
This saves making any changes to the modDiscounts.asp file.
Nigel
------------- http://www.innerview.co.uk - Innerview
Productcart Platinum Reseller
Web Design/Hosting/Virtual Tours
|
Posted By: katharina
Date Posted: 12-November-2010 at 6:20pm
That requires the customer to put the product into the cart. We have some free items like that. We are basically adding a wallet calendar as a gift from us to each order, and just would like to show it on the invoice.
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: cpgmar
Date Posted: 13-November-2010 at 9:09am
How did you get the item added automatically to the cart? Last year we did a free item like that but every customer had to enter the product into the cart manually and I got calls constantly from folks who forgot to add it or didn't realize they had to. We want to add a free item for orders over $100.
------------- Cindy
The Tasteful Garden
www.tastefulgarden.com
|
Posted By: Brett
Date Posted: 13-November-2010 at 5:32pm
I just tested this and was able to create a coupon with a $0.00 discount. If you post your modDiscounts.asp file here I'll take a look at it.
|
Posted By: katharina
Date Posted: 13-November-2010 at 5:38pm
I truly appreciate this. Katharina
<%@ LANGUAGE="VBSCRIPT" %> ... <!--#include file="AdminFooter.asp"-->
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 13-November-2010 at 6:01pm
I'll try to use this, would you mind re-posting it as an attachment?
|
Posted By: katharina
Date Posted: 13-November-2010 at 6:17pm
I've uploaded it as a zip file at: http://www.davitt.com/modDiscounts.zip - http://www.davitt.com/modDiscounts.zip
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 13-November-2010 at 6:23pm
Thanks, looking at it now. What error message does it give you when you try to save a discount with a $0 value? Did you make sure to check "price discount" even though you are entering zero? I know if i try to save a coupon without selecting either price or percentage that it doesn't work.
Like I said earlier, It works fine on my site and I can't find any code on this page that looks like it would restrict it. Going to keep looking.
|
Posted By: Brett
Date Posted: 13-November-2010 at 6:26pm
uploads/1159/modDiscountsMODIFIED.zip - modDiscountsMODIFIED.zip
This should do the trick, but has not been tested. Save or rename your old file and upload this one to test it out. Let me know how it works. I modified lines 254 and 266.
|
Posted By: katharina
Date Posted: 13-November-2010 at 6:47pm
It's still not working. I can create the coupon and do not get an error message. I've noticed that the radio button is not selected when I click again on edit this coupon. It just doesn't work when I place an order. I called it "Free calendar", select fixed rate of $0.00, and selected it to be automatically applied to all orders, and available for retail and wholesale customers. It basically does not show in the check out, even after selecting a shipping option. It will show, if I put a value of $0.01 in. I think there is somewhere a checking mechanism.
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 13-November-2010 at 6:58pm
What you're seeing on the backend is the same thing mine does when I create zero value coupons. I usually just have to re-check price discount radio each time I edit the coupon.
However, mine apply during the checkout process without any issues. What version of productcart are you running? Does it use onepagecheckout.asp? Attach/upload onepagecheckout.asp, or whatever page it is that processes your discount codes (you should see it in the address bar during checkout when you enter the discount code).
|
Posted By: katharina
Date Posted: 13-November-2010 at 7:05pm
I'm still on 3.51 without the one page checkout.
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 13-November-2010 at 7:05pm
Attach/upload onepagecheckout.asp, or whatever page it is that processes your discount codes (you should see it in the address bar during checkout when you enter the discount code).
*edit*
Also attach the page AFTER that page please. The page that the browser goes to after you enter the coupon code and press the submit button.
|
Posted By: katharina
Date Posted: 13-November-2010 at 7:18pm
I'm pretty sure the problem is on the modDiscounts.asp page, since it does not even save the radio button dollar discount with the 0.00 amount. It will only work if I put in 0.01. It does not save zero amount.
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 13-November-2010 at 7:30pm
Posted By: katharina
Date Posted: 13-November-2010 at 7:39pm
Unfortunately it is in the modDiscounts.asp. I just deleted the coupon and created a new one. It saves it without error when I select Discount Amount and select zero amount. It shows no radio button selection when I click on it to edit it. It does save the radio button when I do put an amount in. The page checks for zero amounts, but I cannot read the code well enough to change it. My ASP skills are none existing.
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 13-November-2010 at 7:45pm
Please take screenshot of the modDiscounts.asp so I can see what you mean when you say it shows no radio button selection. Also please take a screenshot during checkout so I can see what happens when you try to use that coupon.
|
Posted By: katharina
Date Posted: 13-November-2010 at 7:59pm
It does not keep the Price Discount radio button check marked when the the amount is 0. It only does it when I put a number larger then 0 in. At check out it complaints that the coupon is not valid when I manually add it. The coupon should be auto applied, and only does so when there is a numeric value greater then 0.
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 13-November-2010 at 8:10pm
That answers my first question. Now, could you please try to apply the coupon at checkout and take two screenshots, one before and one after?
|
Posted By: katharina
Date Posted: 13-November-2010 at 8:17pm
Before with automatic apply:
After manual apply of fcal coupon. With an error message that does not make any sense at all:
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 13-November-2010 at 8:24pm
The problem is with that page you just screenshotted, the one where the discount code is applied. The zero-dollar amount is being checked when the coupon is applied to an order, NOT when it is being modified.
Upload that page and I will modify it so your coupons will work, assuming the code to process the discount code isn't contained on some other page.
|
Posted By: katharina
Date Posted: 13-November-2010 at 8:31pm
I'm sorry if this is frustrating. I really appreciate all the efforts you put into this. This is the page where the coupon is applied to. http://www.earlyimpact.com/forum/uploads/4/OrderVerify.zip - http://www.earlyimpact.com/forum/uploads/4/OrderVerify.zip
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 13-November-2010 at 9:56pm
Try this file. I modified Lines 2004-2015 and 2019 to 2030.
However, once you apply this modification you will no longer have warning of an improperly created shipping discount. It will just apply the coupon with a zero dollar amount and do nothing besides display it as being applied (assuming it does what I think it will).
uploads/1159/OrderVerify_MOD2.zip]OrderVerify_MOD2.zip
I haven't tested this as I have no way to, so let me know how it works. Hopefully it solves your problem. Make sure you save your old one first
|
Posted By: Brett
Date Posted: 13-November-2010 at 10:01pm
uploads/1159/OrderVerify_MOD3.zip - OrderVerify_MOD3.zip
Actually, use this file. I added these lines:
discountAmount=ccur(0)
discountAmount=discountAmount&","&ccur(0)
In case there was some kind of issue with intArrayCnt not matching up with the number of commas in discountAmount
|
Posted By: Brett
Date Posted: 15-November-2010 at 10:47pm
Hey Katharina have you had a chance to test that file? If so let me know if it works ;)
|
Posted By: katharina
Date Posted: 18-November-2010 at 12:10pm
Sorry for letting you wait so long. Made me look like I'm a rotten person. I had to take care of some business related things and was not on my computer. I did upload the file today and it works like a charm. Thank you so much for doing this. One more little thing. Can you tell what lines you have modified? I keep a running log of modifications in a word file.
Are only those two lines being added or was there more? discountAmount=ccur(0)
discountAmount=discountAmount&","&ccur(0)
Again, thank you.
------------- Katharina
*******************
www.GermanPlaza.com
*******************
|
Posted By: Brett
Date Posted: 18-November-2010 at 4:56pm
You didn't look like a rotten person, don't worry. I was just curious to see if it worked ;)
The code was changed between lines 2004-2017, 2021-2034. To see all of the modifications, do a search in the code for these two lines:
'ALLOW ZERO-DOLLAR DISCOUNTS
'END ALLOW ZERO-DOLLAR DISCOUNTS
You'll find two groups of code modifications. I commented that first line out and added the other lines below it.
|
|