discount

SurfShopPRO™ has a powerful new calculation engine. Have you done something special with it? Share your calculation here. Or if you need help with a calc, ask away!

Moderator: frankjan

Post Reply
jifsurshop
Posts: 17
Joined: Oct 17, 2004 10:23 pm
Location: San Diego, Ca
Contact:

discount

Post by jifsurshop » Oct 19, 2005 10:26 pm

Hi All!

I asked this question before, but now that I am using SurfShop Pro Version 1.0.3, I was wondering if this is possible now.  I have a shopping cart where I sell to retail and wholesale customers.  I would like to give my retail customers 50% off their order once they hit a total of $250.  But I don't want the wholesale customer orders to get that percentage off, as they already have wholesale pricing.  I was thinking if I can create a custom field in mySQL database and use this field in a calculation where I would give it a value if the customer is a wholesale customer and have a look-up calculation using this field.  Also, how would I get this custom field to show up in the "By Field" drop down list in the calculation?

Thank you very much.  Please let me know if you need more detail.

Juan :)

frankjan
Site Admin
Posts: 392
Joined: May 03, 2004 8:57 pm
Contact:

Re: discount

Post by frankjan » Oct 20, 2005 8:07 am

Hi Juan,

I don't know if you can accomplish what you want within a single cart.  A calculation is given to all orders across the board, no matter if it's wholesale or retail.  However, your idea about the custom field just might work.  Give it a shot and let us know how it works for you.  Back up your MySQL database first.
Also, how would I get this custom field to show up in the "By Field" drop down list in the calculation?
As long as the field is in the Orders table, it will show in the 'By Field' list.

Another way to do this would be to set up a Coupon in the cart that would give a customer the 50% discount over $250.00.  The only drawback to this would be finding a way to keep wholesalers from using the coupon.

The only other way I can think of would be to set up 2 separate carts, one for wholesalers and another for retailers.
Frank Jance
SurfShop Forum Admin

Setting Up Shop Has Never Been Easier!

jifsurshop
Posts: 17
Joined: Oct 17, 2004 10:23 pm
Location: San Diego, Ca
Contact:

Post by jifsurshop » Oct 20, 2005 10:44 pm

Hi Frank,

Thank you for your quick response.  First, I am trying to avoid using 2 separate carts - maintaining both with changes would be difficult.  I tried using the custom field, but like you said, the only fields that show up on the "By Field" drop down list are from the order data base.  I need the field to be from the customer data base.  So that's not working too well.  

As far as the coupon, I did come up with a solution that I did not mention because I was still working on it.  What I've done is use this " loginchk " statement which is like an "if" statement to check if someone logs in. I use this statement to remove the input field for the coupon on the " info.htm " output file.  But that would also keep the retail customers that have created an account with us from seeing the coupon field.  Is there another "if" statement that I can use specifically to check if it's a wholesale customer that has signed in?

Thank you again for your quick response.

Juan

Nick
Posts: 39
Joined: May 04, 2004 6:20 pm
Contact:

Re: discount

Post by Nick » Oct 31, 2005 2:57 pm

Hi Juan,

I've had to do something similar myself.  Since the wholesale field is in the customers db, I made all my wholesaler accounts to be tax exempt as well, in the admin section.  Then I just use the tax exempt field in the orders db as the flag.
What I've done is use this " loginchk " statement which is like an "if" statement to check if someone logs in. I use this statement to remove the input field for the coupon on the " info.htm " output file.
Would you be so kind as to post your code for the rest of us to see?  I love to see what others have done with SurfShopPRO!

Thanks.

jifsurshop
Posts: 17
Joined: Oct 17, 2004 10:23 pm
Location: San Diego, Ca
Contact:

Post by jifsurshop » Oct 31, 2005 11:07 pm

Hi Nick,

Thank you for your response.  But I don't think I understood what you were trying to tell me about using it as a flag.  I did find a good solution that did work for me.  I would be more than happy to share it with everyone.

What I did is create a field (ie. wholesale_discount) in my customer database, and then used an "if" statement to check for the word "no" in this field.  When the customer created the account and I checked them off as a wholesaler, I would also put the word "no" inside this field.  If the statement checks true, then I would remove two fields (Coupon ID and Coupon Password) from the file info.htm.  I don't know if this makes any sense, but I'd be willing to carry this thread until you understand what I am talking about.  This solution is working perfectly so far.  If a wholesale customer tries to use the coupon ID and the password, they have no field in which to put them.

For everyone else, the fields show up when they get to the info page.  Below I tried to copy and paste the codes - I hope they turn out okay.

Code: Select all

<! if:wholesale_discount:ne:"no">
<tr> 
<td align=right class="form"><span class="text-small">If you are using a <b>[b]Coupon or[/b] <br />
[b]Gift Certificate[/b]</b>, please enter the information here:</span>
</td>

<td class="form" valign="top"> 
<table border="0" cellpadding="1" cellspacing="2" width="100%">
<tr> 
<td class="form" valign="top" width="46%"><span class="text-small"><b>[b]Coupon ID:[/b]</b> <br />
<input name="couponid" size="15" maxlength="40"></span>
</td>

<td class="form" valign="top" width="54%"><span class="text-small"> <b>[b]Coupon Password:[/b]</b><br /> 
<input name="couponpass" size="15" maxlength="40" type="password"></span>
</td>
</tr>
<! /if>
Juan

frankjan
Site Admin
Posts: 392
Joined: May 03, 2004 8:57 pm
Contact:

Re: discount

Post by frankjan » Nov 22, 2008 11:45 am

This functionality is now built in to SurfShopPRO. You can select which type of customers to give discounts to, i.e. retail and members only, wholesale only, or all customers.
Frank Jance
SurfShop Forum Admin

Setting Up Shop Has Never Been Easier!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest