Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2006
    Posts
    62
    Plugin Contributions
    0

    Default Checkout - how do I skip all the steps?

    I've been going through the code for the checkout flow, and I noticed that it could easily be modified to skip step 1 and step 3.
    In a situation where a store only allows one address per customer, and only has one (or dosn't let the customer pick) shipping option,
    these seem pointless. Step 1 simply because no information is altered, and Step 3 because frankly it might be sort of pointless in any case,
    and certainly if you would only be confirming one page of input, Step 2. I could see people forgetting what options were selected on Step 1,
    but not really Step 2. ANYHOW...

    I would very much like some input from the ZC experts. What problems would I face? What additional alterations would I have to make
    in order to not break the basic structure of zen cart, and its various underlying processes?

    Below are the alterations I've made so far. This works, and there are no obvious problems that I can se. Everything looks like it should.
    I've not done extensive testing, nor checked the database logs from notifier trace. That would be my next step.

    Any hints or pointers would be greatly appreciated.

    Added above row 239 in /includes/modules/pages/checkout_shipping/header_php.php
    PHP Code:
    //
    // I did not know the usual content_type so I negated virtual instead.
    //
      
    if ($order->content_type != 'virtual') {
        
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));
      } 
    Commented out row 34 in /includes/modules/pages/checkout_payment/header_php.php
    PHP Code:
    // if no shipping method has been selected, redirect the customer to the shipping method selection page
    if (!$_SESSION['shipping']) {
    // zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

    Commented out row 41 in /includes/modules/pages/checkout_confirmation/header_php.php
    PHP Code:
    // if no shipping method has been selected, redirect the customer to the shipping method selection page
    if (!$_SESSION['shipping']) {
    //  zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

    Added above row 171 in /includes/modules/pages/checkout_confirmation/header_php.php
    PHP Code:
    // if payment method has been selected, redirect the customer to the checkout process page
     
    if ($_SESSION['payment']) {
      
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PROCESS'''SSL'));


  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,928
    Plugin Contributions
    96

    Default Re: Checkout - how does it work?

    The one shipping option that your store provides, is it a flat rate regardless of the products in the customer's cart or does the rate vary with cart-content?

  3. #3
    Join Date
    Oct 2006
    Posts
    62
    Plugin Contributions
    0

    Default Re: Checkout - how does it work?

    Quote Originally Posted by lat9 View Post
    The one shipping option that your store provides, is it a flat rate regardless of the products in the customer's cart or does the rate vary with cart-content?
    Flat rate. We might use ot_shipping to give free shipping over a certain cart value.

    I actually have several shipping modules on my test site right now, with restrictions on weight/product type etc,
    and the cheapest allowed module does get selected.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Checkout - how does it work?

    More related to the original question than the current train of shipping, regarding the one address per customer, may see that a single person may create multiple accounts to support shipping to multiple locations, but that I thhink is more dependent on the products offered. Also consideration of a difference between shipping and billing addresses. Again, something that is dependent on the business and products involved, though it does appear that the billing address can be changed in step 2, but would be auto-populated with the shipping address.

    All of that is from a "functional" perspective not from a code perspective.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,928
    Plugin Contributions
    96

    Default Re: Checkout - how does it work?

    Quote Originally Posted by SHK View Post
    Flat rate. We might use ot_shipping to give free shipping over a certain cart value.

    I actually have several shipping modules on my test site right now, with restrictions on weight/product type etc,
    and the cheapest allowed module does get selected.
    You just need to make sure that the checkout_shipping pages processing sets $_SESSION['shipping'] to the array of values associated with your flat-rate module and that the $_SESSION['sendto'] is set to the customer's default address id. I'd think twice (at least) about commenting out the checkout_shipping redirects, given that your modified version should set the above two values to a "proper" setting and then redirect to the checkout_payment page.

    An order's content type is either 'physical', 'virtual', or 'mixed'. The "normal" processing on the checkout_shipping page bypasses the data gathering if the order is all 'virtual' (i.e. all products that don't actually ship anywhere).

    Are you planning on using coupons? Their "normal" processing is to gather information on the checkout_payment page to display a confirmation of the discount on the checkout_confirmation page (or redirect back to checkout_payment if there was an issue with the coupon, like it wasn't valid). I believe, but do not know, that the same is true when using gift vouchers -- the reduction doesn't show until the checkout_confirmation page.

  6. #6
    Join Date
    Oct 2006
    Posts
    62
    Plugin Contributions
    0

    Default Re: Checkout - how does it work?

    Quote Originally Posted by mc12345678 View Post
    More related to the original question than the current train of shipping, regarding the one address per customer, may see that a single person may create multiple accounts to support shipping to multiple locations, but that I thhink is more dependent on the products offered. Also consideration of a difference between shipping and billing addresses. Again, something that is dependent on the business and products involved, though it does appear that the billing address can be changed in step 2, but would be auto-populated with the shipping address.

    All of that is from a "functional" perspective not from a code perspective.
    Right. In our case, very few customers use more than one address, and sometimes only by mistake, Also, our invoice-provider requires that the customers uses only one address, the one listed in the pubic residential records.
    Quote Originally Posted by lat9 View Post
    You just need to make sure that the checkout_shipping pages processing sets $_SESSION['shipping'] to the array of values associated with your flat-rate module and that the $_SESSION['sendto'] is set to the customer's default address id. I'd think twice (at least) about commenting out the checkout_shipping redirects, given that your modified version should set the above two values to a "proper" setting and then redirect to the checkout_payment page.
    Right you are. I reverted the commented out redirects.
    I believe $_SESSION['sendto' ] was already handled in the original code. It also seems to set the $_SESSION['shipping'] correctly.
    This started to work properly when I moved the if ($order->content_type != 'virtual') { redirect to the bottom of the page.
    Quote Originally Posted by lat9 View Post
    An order's content type is either 'physical', 'virtual', or 'mixed'. The "normal" processing on the checkout_shipping page bypasses the data gathering if the order is all 'virtual' (i.e. all products that don't actually ship anywhere).
    Thanks. Changed.
    Quote Originally Posted by lat9 View Post
    Are you planning on using coupons? Their "normal" processing is to gather information on the checkout_payment page to display a confirmation of the discount on the checkout_confirmation page (or redirect back to checkout_payment if there was an issue with the coupon, like it wasn't valid). I believe, but do not know, that the same is true when using gift vouchers -- the reduction doesn't show until the checkout_confirmation page.
    Good point. We never had much success with coupons since our customers couldnt understand when and where to enter them. I mostly use links that set the code for them. In any case, if I enter the code and press enter, the payment page is reloaded and the rebate shown. If I dont hit enter, it will still work, but as you said without letting the customers know. The ot_shipping module works fine too, the shipping is reported as zero. Granted, I may have to style this a bit so that the customers notices the rebates given.

    Thanks for all the help so far!

 

 

Similar Threads

  1. how to install google checkout the steps on godaddy?
    By rashawn13 in forum Addon Payment Modules
    Replies: 5
    Last Post: 5 Mar 2009, 07:15 AM
  2. how to skip login or signup page while checkout?
    By gnplaza in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 11 Jul 2008, 05:20 AM
  3. Replies: 3
    Last Post: 9 May 2008, 03:59 PM
  4. How To skip two first checkout steps?
    By sart in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 1 Apr 2008, 07:56 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