Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Free Shipping for cheapest option only

Free Shipping for cheapest option only

Views: 1,058

Results 1 to 7 of 7
4 Jan 2013, 3:27 AM
#1
coreyalderin avatar

coreyalderin

Zen Follower

Join Date:
May 2012
Posts:
137
Plugin Contributions:
0

Free Shipping for cheapest option only

Is there a way to create a coupon that allows free shipping but for the cheapest option only. Currently I allow a few shipping options and I want to create a coupon for free shipping. But I only want the customer to be able to use the cheapest option.

Thanks
Corey

12 Mar 2013, 10:24 AM
#2
ryguylivinlife avatar

ryguylivinlife

New Zenner

Join Date:
Aug 2011
Posts:
6
Plugin Contributions:
0

Re: Free Shipping for cheapest option only

I wanna know as well. Did you find the answer?

16 Mar 2013, 4:07 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Free Shipping for cheapest option only

Judging from the titles of the posts listed below in the "Similar Threads" section I'm guessing one of those probably contains an answer.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Mar 2013, 2:40 AM
#4
coreyalderin avatar

coreyalderin

Zen Follower

Join Date:
May 2012
Posts:
137
Plugin Contributions:
0

Re: Free Shipping for cheapest option only

ryguylivinlife - I never could find the answer. I ended up only providing the cheapest shipping option, when I was running the free shipping promotion. It;s not the way I would like to do it, but I could never figure it out.

DrByte - The "Similar Threads" below do not seem to answer my question. I did a lot of searching on here before I asked the question and it seemed like the only threads that had were asking this question, were never answered.

If anyone finds out the answer to this, it would be greatly appreciated.

Thanks
Corey

18 Mar 2013, 1:38 PM
#5
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping for cheapest option only

What shipping module(s) do you normally run on your site?

What shipping module or shipping method are you trying to use for the "cheapest" when you are giving Free Shipping via a coupon?

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!

18 Mar 2013, 2:18 PM
#6
coreyalderin avatar

coreyalderin

Zen Follower

Join Date:
May 2012
Posts:
137
Plugin Contributions:
0

Re: Free Shipping for cheapest option only

I only use USPS shipping module. For domestic shipping I give the option of first class, priority, or express mail. I currently have a free shipping coupon with any order so I removed express mail as an option until I stop the promotion.

18 Mar 2013, 3:21 PM
#7
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping for cheapest option only

You could try this by adding the code in **RED **by editing the file:
/includes/modules/pages/checkout_payment/header_php.php

$order_total_modules->collect_posts();
$order_total_modules->pre_confirmation_check();

[B]// bof: change shipping for free shipping discount coupon
  $chk_coupon = $db->Execute("select * from " . TABLE_COUPONS . " where coupon_id = '" . (int)$_SESSION['cc_id'] . "'");
//echo 'Coupon ORIGINAL $_SESSION[shipping][id]: ' . $_SESSION['shipping']['id'] . '<br>';
  if ($chk_coupon->fields['coupon_type'] == 'S' or $chk_coupon->fields['coupon_type'] == '0') {
//echo 'Discount Coupon: Free Shipping! Country: ' . $order->delivery['country']['id'] . ' $_SESSION[shipping][id]: ' . $_SESSION['shipping']['id'] . '<br>';
//echo '<pre>'; echo var_dump($_SESSION['shipping']); echo '</pre>';
    if ($order->delivery['country']['id'] == '223') {
      if ($_SESSION['shipping']['id'] != 'usps_PRIORITY') {
        $_SESSION['shipping']['id'] = 'usps_PRIORITY';
        $messageStack->add_session('header', 'Shipping changed for Free Coupon - Please continue checkout', 'caution');
        zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
      }
    } else {
      if ($_SESSION['shipping']['id'] != 'usps_Priority Mail International') {
        $_SESSION['shipping']['id'] = 'usps_Priority Mail International';
        $messageStack->add_session('header', 'Shipping changed for Free Coupon - Please continue checkout', 'caution');
        zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
      }
    }
  }
//echo 'Coupon CHANGED $_SESSION[shipping][id]: ' . $_SESSION['shipping']['id'] . '<br>';
// eof: change shipping for free shipping discount coupon
[/B]
//  $_SESSION['comments'] = '';
$comments = $_SESSION['comments'];

This assumes you want to use Priority mail for both US and the Rest of the World ...

You can adjust which shipping methods you want to use based on your needs ...

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!