Site maintenance: Sun 15 Nov, from 12:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Setting Up Specials and SaleMaker / Sale to make 1 attribute free for holidays

Sale to make 1 attribute free for holidays

Started by skinnyalbert on 8 Dec 2011, 2:40 PM · Views: 1,694

Results 1 to 2 of 2
8 Dec 2011, 2:40 PM
#1
skinnyalbert avatar

skinnyalbert

New Zenner

Join Date:
Sep 2007
Posts:
30
Plugin Contributions:
0

Sale to make 1 attribute free for holidays

Hi all,

I have a client who sells a product with several customization options. I would like to have one of thees attributes free for the holiday season. It would be equal to approx $20 off, but I don't want to allow the code to discount the normal price of the product.

Is there a way without going into each product to remove the price increase associated with an attribute?

I've been thinking of offering a discount if the price is within a specific price range, but this is sloppy since the multiple attributes make the price range overlap each other.

Any ideas appreciated.
Thanks.

6 Sep 2012, 4:02 PM
#2
llynix avatar

llynix

Zen Follower

Join Date:
Jul 2009
Location:
Texas
Posts:
210
Plugin Contributions:
0

Re: Sale to make 1 attribute free for holidays

Ok.. here's what I did. Requires you to hack your database and probably is of moderate difficulty. Practice on a copy of your site first.

Step 1. Figure out what option ID you want to allow 'Free' For my case I wanted Free upholstery upgrades, so I choose my upholstery option which was # 190. You'll need to replace the 190 below with your option ID.

Step 2. Use this SQL to get current attribute pricing.

SELECT CONCAT("UPDATE cart1_products_attributes SET options_values_price = '",options_values_price,"' WHERE products_attributes_id = ",products_attributes_id,';')
FROM cart1_products_attributes
WHERE options_id =190
AND options_values_price !=0;

In phpmyadmin I then exported this set as a CSV without any field or text delimiters. It gives you the SQL needed to 'reset' the prices. Save this for when your sale ends.

Step 3. Run this SQL to zero out your prices.

UPDATE cart1_products_attributes SET options_values_price = 0 WHERE options_id =190
AND options_values_price !=0;

This will set your attribute "free".

Now when your sale ends run the previous result set you saved to reset your prices.

Hope it helps someone.

DentalPlanet Designed/Administrated by Falls Geek