| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Buy $xxx get product X for free Coupon | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
I am looking for exact mod like this for my store. I would be nice if this mod is done.
What I did was, create a Coupon code, to give 100% off on a certain product. But this runs into problem if that product is added more than once. Then I got all of them off. Any other solution?
__________________
X-Cart Gold version 4.4.4 X-Cart directory /home/web/u/ugchweb/cart PHP 5 MySQL server 5 |
|||||||
#12
|
|||||||
|
|||||||
I have a way to work around this issue and it gives me what I need, however, I am stuck on the last puzzle.
To accomplish this task, this is what I do: My Needs: If subtotal is equal or over $100 then customer can get a free DVD (productid = 2 My solution: First: add a product free DVD in which I had its productid=28. Make this product hidden but available to sale and give its price is $0.00 Second: Now you need to modify some code. Open you cart_totals.tpl, add following code at the end of the code: Code:
Now open you product.tpl, modify your code so that productid=28 display price is FREE, and quantity you can make it hidden to value 1. So when you customer click on add to cart for this product, it will add to the cart with quantity is 1 and price is $0.00. Now open you cart.tpl and modify it so that you won't let your customer change the quantity of productid=28. This should give you what you need for if buy x$x.xx then get y item forfree. However, when I got to this step, I got stuck ont he last step, that if customer decides to change the quantity of items in the cart to less than $100, then the free DVD is still in the cart. Does any know show to solve this? If I could code to make the page automatically remove free DVD item out of the cart as soon as subtotal is less than $100. Then my whole puzzle is completed.
__________________
X-Cart Gold version 4.4.4 X-Cart directory /home/web/u/ugchweb/cart PHP 5 MySQL server 5 |
|||||||
#13
|
|||||||
|
|||||||
I think you need to do something along the lines of how the DVD got added.
For it to say if the total is less than 100 to delete the DVD from the Cart. How you would implement this, you will have to look at the functions that take place you manually delete a product from the Cart. Well that's how I'd start to work it out. It does sound as though it should be fairly simple to do. Hope it helps.
__________________
X-Cart 4.0.17 |
|||||||
#14
|
|||||||
|
|||||||
I'm guessing that unless you are having a third party shipping this stuff out for you, you will catch it if a customer is trying to fleece you (i.e. adding multiple free products to the cart, dropping their order total to less than $100, etc). Since the free item isn't affecting the total cost, you can just make sure you only add one item to their shipment. Seems to be the easiest fix until X-Cart (or an eager pro) comes up with a mod.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#15
|
|||||||
|
|||||||
One Solution
see my next post
|
|||||||
#16
|
|||||||
|
|||||||
One Solution
I have managed to get this to work for our store... It requires a lot of modifications and we've already done so many to other parts of our site that it's going to be difficult to explain exactly where the modifications should be made but anyone with a little experience modding X-Cart should be able to figure it out... We haven't fully beta-tested it yet, but so far it seems to be working fine...
Keep in mind that the Free Gifts you add should have a price of 0.00, be available for sale, and be in a category that can't be accessed via normal browsing of the site. This was easy to accomplish with our site design but it may or may not be so simple with yours. STEP 1 -------- Add a "Free Gifts" menu item (or whatever you want to call it) to the admin menu under "Inventory". We put it just under "Coupons". In /skin1/provider/menu.tpl, add: Code:
STEP 2 -------- Create the Free Gifts table in the database. We called it "xcart_freegifts" and it has the following structure: Code:
STEP 3 -------- Create a bunch of functions in func.php for handling the Free Gifts. Some of the function might be reduntant but I just made what I needed and didn't think too much about it. Code:
STEP 4 -------- Create provider/freegifts.php for handling all the admin modifications to the Free Gifts. Here's the code for that page: Code:
STEP 5 -------- Add the redirect call in skin1/single/home.tpl just below Coupons for consistency. Code:
STEP 6 -------- Create skin1/provider/main/freegifts.tpl. The code is as follows: Code:
STEP 7 -------- Add the promotion text somewhere at the bottom of skin1/customer/main/cart_totals.tpl. The code below is just a generic version. Modify it to fit your site design. Code:
STEP 8 -------- Add the following code to customer/cart.php. Somewhere at the top, maybe after "$intershipper_recalc = 'Y'", put: Code:
After the code that checks if the cart is empty and includes the Discount Coupons module if it's active, below "$smarty->assign('cart', $cart);", and above the Redirect code put the code below. Keep in mind that it's very important that this code be put in the right place otherwise your additions and removals from your cart won't work properly. Code:
Lastly, send the two arrays to the smarty templating engine: Code:
STEP 9 -------- In skin1/customer/main/product.tpl you'll have to change the code that prints the price of the item. Our product.tpl is heavily modified so all I can say is that instead of showing a text input field when the price is 0.00 you should put text that says "FREE!" or something like that. For us, it looks something like this: Code:
STEP 10 ---------- In skin1/customer/main/cart.tpl or skin1/customer/main/cart_contents.tpl (depending on your setup) you have to do something along these lines so that the quantity input field doesn't show up if it's a free gift: Code:
That's all of it... If anyone needs any help let me know! Atul |
|||||||
#17
|
|||||||
|
|||||||
Update to my solution...
The original mod I posted was based on a modded Version 3.4.14 installation. I recently got it to work on a Version 4.0.12 installation. I also added a feature called Notification Price that tells the customer that if they spend $XX more they'll get a free gift. Here are the differences and modifications.
STEP 1 -------- This step should be as follows: Code:
STEP 2 -------- The "xcart_freegifts" table now has the following structure: Code:
STEP 3 -------- The following functions were either modified or added: Code:
STEP 4 -------- provider/freegifts.php is also different: Code:
STEP 5 -------- No changes to this step... STEP 6 -------- skin1/provider/main/freegifts.tpl is also different: Code:
STEP 7 -------- skin1/customer/main/cart_totals.tpl is also different: Code:
STEP 8 -------- Instead of modifying customer/cart.php, you have to modify cart.php in the root directory of your store. The top section which gets the active free gifts stays the same, but the other sections are modified as follows: Code:
Code:
STEP 9 -------- I also noticed you have to modify skin1/customer/main/product.tpl so that the customer cannot select more than 1 free item at a time. So in addition to the other changes, do something like the following in the section where it prints the quantity select box: Code:
STEP 10 --------- No changes to this step... I hope all of that makes sense... Atul |
|||||||
#18
|
|||||||
|
|||||||
Hey Atul, great mod, works great! You might want to re-post this as a new thread in the Custom Mods section, as it gets rather lost in this thread.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#19
|
|||||||||
|
|||||||||
Re: Buy $xxx get product X for free Coupon
i'm looking for somehting similar for version 4.1.6
buy 3 dvds and get a free gisft bag any ideas
__________________
Web Design Web Design and Custom X-Cart Projects http://www.dataviking.com Mention the forums for discounts! x-cart Version 4.1.8 |
|||||||||
#20
|
|||||||
|
|||||||
Re: Buy $xxx get product X for free Coupon
Take a look at the Special Offers mod available at X-Cart.com
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
|
|||
X-Cart forums © 2001-2020
|