Zen Cart Logo
Forums / Built-in Shipping and Payment Modules / Skip Checkout Shipping Page - Only 1 method offered

Skip Checkout Shipping Page - Only 1 method offered

Views: 2,026

Results 1 to 9 of 9
18 Aug 2013, 3:15 AM
#1
harry2cool avatar

harry2cool

Zen Follower

Join Date:
Oct 2005
Posts:
280
Plugin Contributions:
0

Skip Checkout Shipping Page - Only 1 method offered

How can we skip the checkout_shipping page when we offer only 1 kind of shipping ?
It's no use showing this page to the customer.

The checkout_shipping page can be shown for countries we do not ship to, so that the website will not move ahead from this page.

Please guide .

18 Aug 2013, 3:23 AM
#2
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Re: Skip Checkout Shipping Page - Only 1 method offered

If you remove this page...
How do you handle customers who want to change the "delivery address"?

18 Aug 2013, 4:12 AM
#3
harry2cool avatar

harry2cool

Zen Follower

Join Date:
Oct 2005
Posts:
280
Plugin Contributions:
0

Re: Skip Checkout Shipping Page - Only 1 method offered

Yes Gilby you are correct.
Fast and Easy checkout is probably something I should look into

22 Sep 2015, 5:08 AM
#4
scott_ease avatar

scott_ease

New Zenner

Join Date:
Jun 2012
Posts:
68
Plugin Contributions:
2

Re: Skip Checkout Shipping Page - Only 1 method offered

Since Fast and Easy plugin change quite a few core files, and is somewhat unstable, is there any other way to skip shipping selection when only 1 method available? Thanks.

22 Sep 2015, 12:02 PM
#5
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: Skip Checkout Shipping Page - Only 1 method offered

Is there **always **only one shipping method available?

22 Sep 2015, 2:46 PM
#6
scott_ease avatar

scott_ease

New Zenner

Join Date:
Jun 2012
Posts:
68
Plugin Contributions:
2

Re: Skip Checkout Shipping Page - Only 1 method offered

As far as can be seen from now, there is only Per Weight Unit shipping suitable for us. Thanks.

23 Sep 2015, 5:35 PM
#7
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: Skip Checkout Shipping Page - Only 1 method offered

That can be accomplished with a teeny observer-class script.

Create the file /includes/classes/observers/force_per_weight_shipping.php:

<?php
class force_per_weight_shipping extends base {

  function __construct () {
    $this->attach ($this, array ('NOTIFY_HEADER_START_CHECKOUT_SHIPPING'));
    
  }
  
  function update (&$class, $eventID) {
    $_POST['shipping'] = 'perweightunit_perweightunit';
    $_POST['action'] = 'process';
    
  }
 
}

and its associated installer, /includes/auto_loaders/config.force_per_weight_shipping.php:

<?php
if (!defined('IS_ADMIN_FLAG')) {
 die('Illegal Access');
}
                    
/*
** Point 200 is after all other initialization is complete.
*/
$autoLoadConfig[200][] = array ('autoType'   => 'class',
                                'loadFile'   => 'observers/force_per_weight_shipping.php');
$autoLoadConfig[200][] = array ('autoType'   => 'classInstantiate',
                                'className'  => 'force_per_weight_shipping',
                                'objectName' => 'force_per_weight_shipping');

That results in the class-based module running each time the checkout_shipping page starts. It "emulates" the customer's selection of the perweightunit shipping method, resulting in the checkout_shipping page being bypassed with the perweightunit method being automatically selected.

To disable this processing, simply rename the auto_loader file to have an extension of .php~

24 Sep 2015, 4:59 AM
#8
scott_ease avatar

scott_ease

New Zenner

Join Date:
Jun 2012
Posts:
68
Plugin Contributions:
2

Re: Skip Checkout Shipping Page - Only 1 method offered

It's great. I appreciate, lat9.

To handle customers who want to change the "delivery address" (see above #2), I changed one line in '/includes/templates/your_template/templates/tpl_checkout_confirmation_default.php'

from <div class="buttonRow forward"><?php echo '<a href="' . $editShippingButtonLink . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>
to <div class="buttonRow forward"><?php echo '<a href="' . zen_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS, '', 'SSL') . '">' . zen_image_button(BUTTON_IMAGE_EDIT_SMALL, BUTTON_EDIT_SMALL_ALT) . '</a>'; ?></div>

Zen Cart forum is wonderful because people here help themselves by helping others.

24 Sep 2015, 1:33 PM
#9
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,102
Plugin Contributions:
56

Re: Skip Checkout Shipping Page - Only 1 method offered

Nice one, @scott_ease, that was the one downfall in the checkout_shipping page's bypass that I was going to alert you to!