Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2004
    Posts
    167
    Plugin Contributions
    0

    Default FREE Gift Using Observer

    Ref: http://www.zen-cart.com/wiki/index.p..._API_Tutorials

    I have implimented the free gift over a certain amount which works really well in its simplicity, but I have a few questions.

    1)How would I allow people to remove the free gift if they so wish?
    2)How can people change the attributes of the free gift?

  2. #2
    Join Date
    Jul 2004
    Posts
    167
    Plugin Contributions
    0

    Default Re: FREE Gift Using Observer

    Sorry I thought this would be too much to ask, any chance of you Zen Cart Gurus helping with the first part:

    1)How would I allow people to remove the free gift if they so wish?

  3. #3
    Join Date
    Jul 2004
    Posts
    167
    Plugin Contributions
    0

    Default Re: FREE Gift Using Observer

    I think this is what needs adjusting?

    function update(&$class, $eventID) {
    if ($_SESSION['cart']->show_total() >= $this->freeAmount && !$_SESSION['cart']->in_cart($this->freeProductID) ) {
    $_SESSION['cart']->add_cart($this->freeProductID);
    }
    if ($_SESSION['cart']->show_total() < $this->freeAmount && $_SESSION['cart']->in_cart($this->freeProductID) ) {
    $_SESSION['cart']->remove($this->freeProductID);
    }
    if ($_SESSION['cart']->in_cart($this->freeProductID)) {
    $_SESSION['cart']->contents[$this->freeProductID]['qty'] = 1;
    }

  4. #4
    Join Date
    Jul 2004
    Posts
    167
    Plugin Contributions
    0

    Default Re: FREE Gift Using Observer

    This forum sucks

  5. #5
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: FREE Gift Using Observer

    Hi,

    Given that your first post was made only 4 days ago and that those 4 days included a Holiday weekend, then the fact that your post has not been answered (especially given the highly technical nature of the question) is surely not unreasonable. ?

  6. #6
    Join Date
    Jun 2003
    Location
    Newcastle UK
    Posts
    2,896
    Blog Entries
    2
    Plugin Contributions
    2

    Default Re: FREE Gift Using Observer

    BTW

    The quick answer to your question is that you are probably going to have to set a $_SESSION variable if the user removes the item from the cart, so that you can test for this to stop the original code adding the item straight back into the code.

 

 

Similar Threads

  1. v139h Free shipping to just 1 country using free shipper and Yes, Always Free Shipping
    By boomy in forum Built-in Shipping and Payment Modules
    Replies: 9
    Last Post: 20 Oct 2014, 01:43 AM
  2. Free Gift
    By robbie269 in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 5
    Last Post: 3 Dec 2010, 04:55 AM
  3. Replies: 5
    Last Post: 10 Sep 2010, 01:50 AM
  4. Replies: 0
    Last Post: 5 Nov 2009, 04:49 PM
  5. coupon for free gift with gift certificate purchase?
    By tkepler in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 24 Jul 2008, 03:31 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR