Forums / All Other Contributions/Addons / Free Gifts-Dangling Carrot support

Free Gifts-Dangling Carrot support

Views: 48,602

Results 81 to 100 of 237
27 Aug 2009, 8:56 PM
#81
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Free Gifts-Dangling Carrot support

lankeeyankee:

The only issue that I can see right now is if a coupon or order total discount such as quantity discount is used during checkout and that brings the cart down below the threshold, the gift will not be removed. I am going to check into that to see what I need to do to change it. If anyone wants to chip in an opinion on how to do it, I am all ears!:D

I don't think you want to do this. If you are dangling a free gift, and then the gift is taken away as soon as the customer uses a coupon, it might annoy the customer enough to abandon the cart.

27 Aug 2009, 9:35 PM
#82
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

paul3648:

Yes, the display is correct with those original lines.

I've just installed this on my test site by using the compare and merge method, as well as modifying the main_template_vars.php as per your instructions to delete the gift when the cart contents fall below the threshold. If the gift item has attributes, errors are thrown up, so it's best just to remove any attributes from gift items. Otherwise it seems to work well.

Thanks for reporting the bug. Can you please post the error so I can look at it? I'll see if I can get it to work.


Zen Cart and it's community are the best!!

27 Aug 2009, 10:08 PM
#83
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

paul3648:

I don't think you want to do this. If you are dangling a free gift, and then the gift is taken away as soon as the customer uses a coupon, it might annoy the customer enough to abandon the cart.

Yeah, I see your point about a coupon, but what about group discount, quantity discounts, etc? Unfortunately, these do not factor into the cart total until the checkout page due to the zen cart structure and order totals like the discounts. So, they shouldn't have qualified for the gift in the first place but there is no way to address this until the checkout page. I guess you could just leave it the way it is so no one gets upset about losing the gift. It's better to get the sale even if the customer gets the gift for less than the threshold amount than to lose it because they feel cheated that they got to choose a gift in the shopping cart page only to lose it during checkout. It's a limitation of the core process since the shopping cart page's logic doesn't call the order totals modules.


Zen Cart and it's community are the best!!

27 Aug 2009, 10:23 PM
#84
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Free Gifts-Dangling Carrot support

lankeeyankee:

Yeah, I see your point about a coupon, but what about group discount, quantity discounts, etc?

I offer group discounts on my site, and I don't see any problem with giving the free gift along with the discount. Just factor in cost of the gift when setting the threshold. A slightly lower profit is always better than no profit at all.

27 Aug 2009, 10:27 PM
#85
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Free Gifts-Dangling Carrot support

lankeeyankee:

Thanks for reporting the bug. Can you please post the error so I can look at it? I'll see if I can get it to work.

If the gift has an attribute (in my case color), the customer is sent to the product page to select the attribute, then presses a "return to cart" button. But the free product is never added to the cart.

I think it's simpler just to disallow attributes. The fewer choices the better...

Thanks for all your work on this module. I can see it's going to be very useful.

27 Aug 2009, 11:52 PM
#86
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

I do see your point about the discounts and I agree. I think I will leave it as it is.

I am going to look at the code to see if I can add attributes right onto the gift listing on the shopping cart page. I have wanted to do this with other modules so it is worth me spending some time looking into the possibility. For now, I will put in the readme file in the next update that gifts should not have attributes.

My next task is the option of displaying only gifts within a threshold based on the current cart value.

Let me know if you run into any other bugs.


Zen Cart and it's community are the best!!

30 Aug 2009, 3:31 PM
#87
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Free Gifts-Dangling Carrot support

lankeeyankee:

Let me know if you run into any other bugs.

The gifts show up on the products_new page. I think the module was designed so that gifts are not displayed in the regular product listings.

30 Aug 2009, 8:15 PM
#88
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

paul3648:

The gifts show up on the products_new page. I think the module was designed so that gifts are not displayed in the regular product listings.

I see that they show up even with the category disabled. I am not sure what can be done about that, that is a zen cart core function. You could probably hardcode some logic into the new products function that won't display new products from category x. There is also a mod in the downloads called hide categories that might work for this http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=391 If you want to give it a try please let us know your results.

I personally don't mind people seeing the gifts, I have enabled the Free Gift category so that it shows with all of the rest of the categories. I want people to be able to see the free gifts to entice them to buy more, you cannot add the gifts to the cart so in my opinion it can only help to show them to customers everywhere possible.


Zen Cart and it's community are the best!!

31 Aug 2009, 12:48 AM
#89
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Free Gifts-Dangling Carrot support

lankeeyankee:

I personally don't mind people seeing the gifts, I have enabled the Free Gift category so that it shows with all of the rest of the categories. I want people to be able to see the free gifts to entice them to buy more, you cannot add the gifts to the cart so in my opinion it can only help to show them to customers everywhere possible.

That's a good idea. I turned off the "Display Product Buy Now Button" for new listings and now have an acceptable format.

Are you using this module on your live site?

31 Aug 2009, 1:06 AM
#90
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Free Gifts-Dangling Carrot support

Here's another little bug. If the customer logs in, adds items to his cart, chooses a free gift, then logs out before completing the purchase, then comes back to the site and adds items to his guest cart, chooses another gift, logs in, the previously chosen gift remains in his cart, so now he's got two gifts.

31 Aug 2009, 6:55 PM
#91
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

Hello all,

I am very short of time at the moment as i have a massive amount of work on the go. I have managed to get the mod working with no apparent errors on 1.38 and i am in the process of major testing to ensure that the problems are all ironed out. There is still an issue with being able to get multiple gifts if the customer logs out then adds items to a guest cart, and i am looking into ways to get around this.

Thanks to everyone for their patience, bug reports and of course big thanks to anyone who has helped clean the code and give bug fix solutions....particularly lankeeyankee.

Steve

Zen Cart developer since 2009 — Zen Cart Solutions
Ecommerce development, integrations & automation — Junction Solutions

31 Aug 2009, 11:49 PM
#92
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

strelitzia:

Hello all,

I am very short of time at the moment as i have a massive amount of work on the go. I have managed to get the mod working with no apparent errors on 1.38 and i am in the process of major testing to ensure that the problems are all ironed out. There is still an issue with being able to get multiple gifts if the customer logs out then adds items to a guest cart, and i am looking into ways to get around this.

Thanks to everyone for their patience, bug reports and of course big thanks to anyone who has helped clean the code and give bug fix solutions....particularly lankeeyankee.

Steve

Glad to see you here again Steve! I have uploaded a new version but it hasn't been listed in the downloads section yet. It's all fixed up with the addition of pictures and standard formatting for the sidebox.

I am working, too, on a fix for the gift in customer cart/guest cart merging/adding 2 gifts bug. I will post results when I have them.

And thanks again for creating this!


Zen Cart and it's community are the best!!

31 Aug 2009, 11:50 PM
#93
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

paul3648:

Are you using this module on your live site?

I was about to until you pointed out that bug with customer cart/guest cart merging!:D


Zen Cart and it's community are the best!!

3 Sep 2009, 12:59 PM
#94
twdhosting avatar

twdhosting

Zen Follower

Join Date:
Mar 2005
Posts:
119
Plugin Contributions:
0

Re: Free Gifts-Dangling Carrot support

I've managed to integrate this cool looking mod into an already heavily modified zencart install - the frontend seems to be working flawlessly BUT the admin side is whacked...

I can make a product "a carrot" from the individual listings but when I go to catalog> Free Gifts - I don't see the list of assigned free gifts, I only get the "Add a new free gift" drop down box. So I can add new free gifts but cannot delete / edit existing ones?

Any ideas as I have checked and double cheked that I have integrated every line of code and re uploaded the gift_add.php file in the admin root

I am running 1.3.8a

3 Sep 2009, 8:57 PM
#95
lankeeyankee avatar

lankeeyankee

Totally Zenned

Join Date:
Jan 2007
Posts:
1,514
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

twdhosting:

I've managed to integrate this cool looking mod into an already heavily modified zencart install - the frontend seems to be working flawlessly BUT the admin side is whacked...

I can make a product "a carrot" from the individual listings but when I go to catalog> Free Gifts - I don't see the list of assigned free gifts, I only get the "Add a new free gift" drop down box. So I can add new free gifts but cannot delete / edit existing ones?

Any ideas as I have checked and double cheked that I have integrated every line of code and re uploaded the gift_add.php file in the admin root

I am running 1.3.8a

Did you delete the sql line from add_gift.php on line 107 and 108? Not the whole line, just ```php
pd.language_id = '".$languages_id."'
AND

If you didn't, try deleting that and see if it fixes it. If you already have deleted it, put it back in and see if that works. This is a known problem and I am going to work on a permanent solution for it. 

Let me know if that works and what you did to get it to work.


Zen Cart and it's community are the best!!

3 Sep 2009, 11:46 PM
#96
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

This isn't an issue that was found in earlier versions of the port.

Lankeeyankee, i will compare earlier versions of this file to see if the error was introduced somehow during file modification.

I've been checking through the zip you sent me and there are a few files that are older versions. I am now updating these to current versions which may well fix some of the issues still present. Hopefully i will have this done tomorrow and i'll do some more testing on it.

Regards
Steve

Zen Cart developer since 2009 — Zen Cart Solutions
Ecommerce development, integrations & automation — Junction Solutions

4 Sep 2009, 10:14 PM
#97
fireflyz avatar

fireflyz

New Zenner

Join Date:
May 2007
Location:
Los Angeles
Posts:
89
Plugin Contributions:
0

Re: Free Gifts-Dangling Carrot support

I'm having an issue with blank page. Here is the scenario when the problem happens:

Customer adds 2 items to the cart, one above the price limit for gift and one below. Then adds the free gift.

Customer try to removes the item above the price limit. That's when the page loads half blank.

I did a debug and this is what I get:

PHP Warning: Missing argument 2 for currencies::display_price(), called in ..../includes/languages/english/extra_definitions/My_Template/free_gifts.php on line 28 (and line 29) and defined in /includes/classes/currencies.php on line 99

Anyone has an idea what is wrong?

Thanks!

4 Sep 2009, 10:35 PM
#98
paul3648 avatar

paul3648

Zen Follower

Join Date:
Mar 2007
Location:
Taiwan
Posts:
239
Plugin Contributions:
0

Re: Free Gifts-Dangling Carrot support

Fireflyz:

I'm having an issue with blank page. Here is the scenario when the problem happens:

Customer adds 2 items to the cart, one above the price limit for gift and one below. Then adds the free gift.

Customer try to removes the item above the price limit. That's when the page loads half blank.

I can't duplicate this on 1.38a, using compare/merge method to install this module.

4 Sep 2009, 10:41 PM
#99
fireflyz avatar

fireflyz

New Zenner

Join Date:
May 2007
Location:
Los Angeles
Posts:
89
Plugin Contributions:
0

Re: Free Gifts-Dangling Carrot support

Fireflyz:

I'm having an issue with blank page. Here is the scenario when the problem happens:
.......

Here are the codes mentioned in debug:

lines 28 and 29 on free_gifts.php

define('TEXT_FREE_GIFT', 'Free gift with ' . $currencies->display_price($product_gift->fields['threshold']) . ' purchase.');
define('TEXT_DISCOUNT_GIFT', 'Only ' . $currencies->display_price($gift->fields['products_price'], zen_get_tax_rate($gift->fields['products_tax_class_id'])) . ' with ' . $currencies->display_price($product_gift->fields['threshold']) . ' purchase.');

And here is line 99 on currencies.php:

function display_price($products_price, $products_tax, $quantity = 1) {
    return $this->format(zen_add_tax($products_price, $products_tax) * $quantity);
```I'll take any help I can get..  throw me a bone!   :jump:
4 Sep 2009, 10:50 PM
#100
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

Re: Free Gifts-Dangling Carrot support

Fireflyz,

I have noticed this bug in testing of the newest version, as well as a bug that causes a blank page if you remove items from the cart and leave the free gift in, which then causes a partially blank page to load. I am looking for a solution to the problem at the moment. Lankeeyankee may be able to offer some further help as he's done quite a bit of work on this mod whilst i've been unavailable.

Sorry I can't be any more helpful at the moment.

Regards
Steve

Zen Cart developer since 2009 — Zen Cart Solutions
Ecommerce development, integrations & automation — Junction Solutions