Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Dec 2010
    Posts
    10
    Plugin Contributions
    0

    Default Discount for Store Pickup

    Hi,

    After trawling the internet and this forum for days I need to ask for HELP!

    I'm trying to set-up my store to apply a percentage discount if the shopper chooses to collect their order from the shop instead of having it delivered.

    It is for a fast food takeaway that offers free delivery, but a discount if you choose to collect.

    I'm using version v1.3.9f.

    Thank you in advance - you guys seem to be a helpful bunch!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Discount for Store Pickup

    Have you tried adding a negative value on the Handling Fee for the Store Pickup storepickup shipping module?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Dec 2010
    Posts
    10
    Plugin Contributions
    0

    Default Re: Discount for Store Pickup

    Excellent suggestion, I've just tried it and it gives a negative figure - but I need a percentage.

    Can I put a formula in (like in a spreadsheet) to work out a percentage?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Discount for Store Pickup

    To be a percentage of the order, you could enter for the Store Pickup in the Handling charge: 10

    for 10% and customize the code for the Store Pickup storepickup in the module:
    /includes/modules/shipping/storepickup.php

    and change the code to:
    Code:
        global $cart;
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY,
                                                       'cost' => MODULE_SHIPPING_STOREPICKUP_COST/100 * $_SESSION['cart']->show_total())));
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Dec 2010
    Posts
    10
    Plugin Contributions
    0

    Default Re: Discount for Store Pickup

    Wow,

    Thank you, thank you, thank you!!!!!!!!

    You are a genius and a lifesaver.

    The code works perfectly, and it is a very elegant way of doing it.

    I don't have the programming experience to have done it myself.

    I hope this is useful for others aswell.

    Again... Thank you.

  6. #6
    Join Date
    Dec 2010
    Posts
    10
    Plugin Contributions
    0

    Default Re: Discount for Store Pickup

    One more thing, how would I amend the code to do the calculation only if the spend is over £10.

    I think an IF command? But not sure how to do it.

    Thanks

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Discount for Store Pickup

    You could test the code with the results of the:
    $_SESSION['cart']->show_total()

    Code:
    if ($_SESSION['cart']->show_total() > 10.00) {
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY,
                                                       'cost' => MODULE_SHIPPING_STOREPICKUP_COST/100 * $_SESSION['cart']->show_total())));
    } else {
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY,
                                                       'cost' => MODULE_SHIPPING_STOREPICKUP_COST)));
    }
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Dec 2010
    Posts
    10
    Plugin Contributions
    0

    Default Re: Discount for Store Pickup

    Thanks very very much!

    The code worked for orders over £10.

    But for orders below £10 it would discount £10 rather than
    £0 because of the ELSE expression and the -10 I put in the "shipping costs" field of the STORE PICK UP module.

    So I've tweaked the ELSE part of the code got it to return 0 on the COST line.

    The code now reads:
    Code:
    if ($_SESSION['cart']->show_total() > 10.00) {
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY,
                                                       'cost' => MODULE_SHIPPING_STOREPICKUP_COST/100 * $_SESSION['cart']->show_total())));
    } else {
        $this->quotes = array('id' => $this->code,
                              'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE,
                              'methods' => array(array('id' => $this->code,
                                                       'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY,
                                                       'cost' => 0)));
    }
    Thank you again AJEH and I hope this helps others

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Discount for Store Pickup

    oh yeah ... forgot to change that ...

    Thanks for the update on what worked for you ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  10. #10
    Join Date
    Dec 2010
    Posts
    10
    Plugin Contributions
    0

    Default Re: Discount for Store Pickup

    Just a little more help required please!

    The discounting works fine but I've just found out one of the products needs to be excluded from the discount.

    Can I amend the code above to check if this particular product has been added to the shopping cart then call up the total value of this products (Or if more than 1 was added, the number or total). - Could I then add the percentage back on?

    An alternative way of doing this whole discount thing would have been with Discount Coupons but I'd need to be able to automatically apply the coupon in the background without the customer having to enter the code - But I can't see how to do that.

    Any help is much appreciated.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Store pickup; category/product level discount
    By WetSteve in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 4 Sep 2015, 06:40 PM
  2. Is it possible to apply discount to store pickup customers?
    By malcshan in forum General Questions
    Replies: 4
    Last Post: 23 Apr 2011, 02:17 PM
  3. Discount for Pickup in Store...?
    By bbjay in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 23 Apr 2009, 09:15 PM
  4. Store Pickup for Friends only
    By Darkwander in forum Addon Shipping Modules
    Replies: 10
    Last Post: 1 Nov 2006, 01:33 PM

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