Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Dangling Carrot (Free Gift/Discount Contrib)


thejungle

Recommended Posts

Hi!

 

I was trying to see if there was an `official' thread but couldn't find one.

 

Anyway.

 

I downloaded the Dangling Carrot contrib which is just what I was looking for.

Allows you to offer free gifts and discounts that appear in the shopping cart page.

 

eg: If a customer will get a free mug if they spend $50 or more, when they get close the shopping cart will say `Spend just xxx more and get this coffee mug for free'.

 

I'm having a few problems and was wondering if anyone else had used it, or edited it or if the author plans on releasing an update. It seems to work pretty well on their site.

 

1) I am unable to offer a discount onlt free items (eg: 50% discount on xxx product on $xx spend)

 

2) If you run a multi currency store it doesn't take into account additional currencies.

 

3) Is it possible to offer a discount or free on an entire category - eg: Buy $100 and received your choice of a DVD for $10 (or free) etc.

 

Also, the gift_add.php page refers to a page called gifts.php (which doesn't exist in the zip download) - it works if you change the gifts.php to gift_add.php

 

On about line 87-90 a reference is made to the authors site you need to change this to your own sites page.

 

I do like the contribution, I was just wondering if anyone had updated it, or was planning too.

 

 

Thanks

Ernie

Link to comment
Share on other sites

  • Replies 308
  • Created
  • Last Reply

Top Posters In This Topic

let's call this the official thread.

 

for discounted products, you need to copy the original product and change the price. Also change the name to say "Towel worth ?10 for just ?2" or similar. It's a bit crude, but it works.

 

Currencies - perhaps someone can help out with this one?

 

I haven't figured out the discounted category yet - this mod works on "copied" products rather than modifying product properties (which would ultimately be more powerful). Maybe someday, but don't hold your breath ...

 

chris

Link to comment
Share on other sites

Hi Chris:

 

Thanks for replying.

 

So I guess maybe make a new category called `Freebies' and copy the items into there? Then rename and reprice of course!

 

How do I `hide' a category so everyone and his dog doesn't order a `towel at $2' - I'm sure I should know.... :blush:

 

I was looking at your site (very nice too) - the session1 (?) is this the exact contrib you used as is on that site?

 

Thanks

Ernie

Link to comment
Share on other sites

don't create a new category - you can hide them (I haven't tried, but everything is possible!) but everyone uses such different menus... I have just set all my special products to inactive since they don't show up in my shop.

 

If your "inactive" or "out of stock" products still show in your shop then you might have to work out the category thing.

 

Yes, this is the same as I use in my shop, but I also have the bundled products module installed. (it makes no difference to the gift mod though really). all it means is that when someone buys the gift the stock level of the original product is updated.

Link to comment
Share on other sites

Chris,

 

I was testing the free gift system on your website and I seem to have found 2 bugs:

 

First,

- I add this product to my cart (price = 12.76)

http://www.session1.com/product_info.php?products_id=1570

 

- change the quantity to 4 so the total is 51.04 and I qualify for your gifts at 50 pound threshold.

 

- add the gift "HALF PRICE Scrub board bag worth ?29.99" to my cart.

 

Now if I change the quantity of the dvd to 3 (so the total is less than 38.28 and less than the threshold), the free gift is still in my cart.

 

Solution: it seems the 'threshold check' is looking at the cart total including the half price gift. So 38.28 plus the half price gift at 12.77 totals over $50 and it allows the gift to stay.

*The 'threshold check' should calculate the cart total minus the prices of any gifts (if they exist) already in the cart.*

 

 

Second:

- Add 4 of the same DVD to my cart:

http://www.session1.com/product_info.php?products_id=1570

 

- add the free gift:

HQ Airglider worth ?12.00 for just 99p!

 

- now change quantity of the dvd to 3, so total is less than thresholf of 50. the gift is correctly removed, but the gift listing on the bottom now reads:

 

Spend just ?10.88 more to get ...

HQ Airglider worth ?12.00 for just 99p!

(Maximum 1 gift per order)

 

Spend just ?11.72 more to get ...

HALF PRICE Scrub board bag worth ?29.99

(Maximum 1 gift per order)

 

The 10.88 amount is incorrect. It should be 11.72 as the 2nd gift correctly shows (assuming both gifts' threshold is 50)

 

 

Other than that, this seems like a great contribution.

 

I will be adding it to my site soon and will attempt to fix the 2 bugs and also the issue of not allowing more than one quantity of a gift as well.

 

Thanks again for another fine contribution!

Link to comment
Share on other sites

He is something I found odd. When testing on my test pc, I have the a free gift set at a $25 threshold. When you add a product to the cart at or above the $25 threshold everything seems to work fine. However, after adding the 'free gift' the original product dissapears leaving the free gift as the item to be purchased.

Michael

Link to comment
Share on other sites

I think I was able to solve the 2 bugs I had found before. I may also have figured out Lobotomia's problem. I will be posting my code after some final testing very soon.

 

When I changed things around a little bit, I got some bugs that I don't think were present before. All should be fixed now.

Link to comment
Share on other sites

Hi Safo,

thank you to post this update !

 

As you descrive in the contribution text, i'ld be grateful if you can post the 2 changes

you didn't insert in the 1.1 update.

 

Thank you in advance

 

sincerely

Roberto

 

 

update posted. let me know if anyone has problems. test is on non-live site first if possible as everyone's sites are different.

 

http://www.oscommerce.com/community/contributions,2990

Link to comment
Share on other sites

Roberto,

 

I will put that as special instructions for anyone who wants to do that change.

 

I still have to migrate that change into my live site, so once I do that I will give the instructions for it.

Link to comment
Share on other sites

also , i made a product inactive , when i clicked on the , well what should be buy button , see above post, i get page showing the product , but it isnr added to the cart

 

this doesnt happen if the product is active , it works as expected

Edited by jeffk
Link to comment
Share on other sites

Hi Guys...sounds like a great contribution but cant get it to work. Items appear under the shopping cart when cart contains sufficient orders, but there is no "add to cart button". No way of selecting the gift -not just a missing graphic, nothing.

 

Also on the Admin side - the threshold amounts are asked for in dollars and not everyone has an American site...can this be changed easily?

 

Thanks....

Edited by wintecs
Link to comment
Share on other sites

Ok guys. A new version has been uploaded. Remember, that gifts should have product model set to "gift" (without quotes).

 

Jeff, I am also using SEC2.2, so this should work with your setup. Try the new version as I forgot to include the image in the 1.1.

 

Wintecs, try it out on your site. The fact that it asks for dollar might not matter because on the catalog side we use the correct osc function instead of hardcoding 'dollar' or 'pound' as was done previously.

 

This version seems to work 100% correctly on my site; I hope it does on everyone's as well.

Edited by safoo
Link to comment
Share on other sites

in the file gift_add.php there is the code:

 

<select name="product_selector_'.$categories['categories_id'].'" onChange="fillCodes(document.newGift.product_selector_'.$categories['categories_id'].'[selectedIndex].name, document.newGift.product_selector_'.$categories['categories_id'].'[selectedIndex].model, document.newGift.product_selector_'.$categories['categories_id'].'[selectedIndex].price, document.newGift.product_selector_'.$categories['categories_id'].'[selectedIndex].value)" class="main">';

 

but i think that there is missing definition of $categories so i have as a result sometihing like thise

 

<select name="product_selector_" onChange="fillCodes(document.newGift.product_selector_[selectedIndex].name, document.newGift.product_selector_[selectedIndex].model, document.newGift.product_selector_[selectedIndex].price, document.newGift.product_selector_[selectedIndex].value)" class="main"><option name="null" value="" SELECTED>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...