Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29
  1. #11
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Re: Fast and Easy Checkout

    First, I need to update the page on a shipping selection without redirecting to another page. I've started another thread specific to this using JavaScript:

    http://www.zen-cart.com/forum/showthread.php?t=76152

  2. #12
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Re: Fast and Easy Checkout

    My latest code to bypass the checkout_confirmation page has the following errors:

    Warning: reset() [function.reset]: Passed variable is not an array or object in /home/public_html/1pagecheckout/includes/modules/order_total/ot_group_pricing.php on line 77

    Warning: Variable passed to each() is not an array or object in /home/public_html/1pagecheckout/includes/modules/order_total/ot_group_pricing.php on line 78

    Warning: reset() [function.reset]: Passed variable is not an array or object in /home/public_html/1pagecheckout/includes/modules/order_total/ot_group_pricing.php on line 77

    Warning: Variable passed to each() is not an array or object in /home/public_html/1pagecheckout/includes/modules/order_total/ot_group_pricing.php on line 78

    Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/1pagecheckout/includes/modules/order_total/ot_group_pricing.php:77) in /home/public_html/1pagecheckout/includes/functions/functions_general.php on line 44
    Here is the code from the header_php.php file:

    PHP Code:
    <?php  
      $zco_notifier
    ->notify('NOTIFY_HEADER_START_CHECKOUT_SHIPPING');
      
    $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_PAYMENT');
      require(
    DIR_WS_CLASSES 'order_total.php');
      
    $order_total_modules = new order_total;
      
    $order_total_modules->collect_posts();
      
    $order_total_modules->pre_confirmation_check();
     
      require(
    DIR_WS_CLASSES 'order.php');
      
    $order = new order;
      require(
    DIR_WS_CLASSES 'payment.php');
      
    $payment_modules = new payment($payment);
      
    $flagOnSubmit sizeof($payment_modules->selection());
      require(
    DIR_WS_CLASSES 'shipping.php');
      
    $shipping_modules = new shipping;
     
      require_once(
    DIR_WS_CLASSES 'http_client.php');
     
    // if there is nothing in the customers cart, redirect them to the shopping cart page
      
    if ($_SESSION['cart']->count_contents() <= 0) {
        
    zen_redirect(zen_href_link(FILENAME_TIME_OUT));
      }
     
    // if the customer is not logged on, redirect them to the login page
      
    if (!$_SESSION['customer_id']) {
        
    $_SESSION['navigation']->set_snapshot();
        
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));
      } else {
        
    // validate customer
        
    if (zen_get_customer_validate_session($_SESSION['customer_id']) == false) {
          
    $_SESSION['navigation']->set_snapshot();
          
    zen_redirect(zen_href_link(FILENAME_LOGIN'''SSL'));
        }
      }
     
    // avoid hack attempts during the checkout procedure by checking the internal cartID
      
    if (isset($_SESSION['cart']->cartID) && $_SESSION['cartID']) {
        if (
    $_SESSION['cart']->cartID != $_SESSION['cartID']) {
          
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'));
        }
      }
     
    // Validate Cart for checkout
      
    $_SESSION['valid_to_checkout'] = true;
      
    $_SESSION['cart']->get_products(true);
      if (
    $_SESSION['valid_to_checkout'] == false) {
        
    $messageStack->add('header'ERROR_CART_UPDATE'error');
        
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
      }
    // Stock Check
      
    if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
        
    $products $_SESSION['cart']->get_products();
        for (
    $i=0$n=sizeof($products); $i<$n$i++) {
          if (
    zen_check_stock($products[$i]['id'], $products[$i]['quantity'])) {
            
    zen_redirect(zen_href_link(FILENAME_SHOPPING_CART));
            break;
          }
        }
      }
    // if no billing destination address was selected, use the customers own address as default
      
    if (!$_SESSION['billto']) {
        
    $_SESSION['billto'] = $_SESSION['customer_default_address_id'];
      } else {
        
    // verify the selected billing address
        
    $check_address_query "SELECT count(*) AS total FROM " TABLE_ADDRESS_BOOK "
                                WHERE customers_id = :customersID
                                AND address_book_id = :addressBookID"
    ;
        
    $check_address_query $db->bindVars($check_address_query':customersID'$_SESSION['customer_id'], 'integer');
        
    $check_address_query $db->bindVars($check_address_query':addressBookID'$_SESSION['billto'], 'integer');
        
    $check_address $db->Execute($check_address_query);
        if (
    $check_address->fields['total'] != '1') {
          
    $_SESSION['billto'] = $_SESSION['customer_default_address_id'];
          
    $_SESSION['payment'] = '';
        }
      }
     
    // if no shipping destination address was selected, use the customers own address as default
      
    if (!$_SESSION['sendto']) {
        
    $_SESSION['sendto'] = $_SESSION['customer_default_address_id'];
      } else {
    // verify the selected shipping address
        
    $check_address_query "SELECT count(*) AS total
                                FROM   " 
    TABLE_ADDRESS_BOOK "
                                WHERE  customers_id = :customersID
                                AND    address_book_id = :addressBookID"
    ;
        
    $check_address_query $db->bindVars($check_address_query':customersID'$_SESSION['customer_id'], 'integer');
        
    $check_address_query $db->bindVars($check_address_query':addressBookID'$_SESSION['sendto'], 'integer');
        
    $check_address $db->Execute($check_address_query);
        if (
    $check_address->fields['total'] != '1') {
          
    $_SESSION['sendto'] = $_SESSION['customer_default_address_id'];
          
    $_SESSION['shipping'] = '';
        }
      }
     
      
    $total_weight $_SESSION['cart']->show_weight();
      
    $total_count $_SESSION['cart']->count_contents();
     
      
    // load all enabled shipping modules
      
    if ( defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING') && (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == 'true') ) {
        
    $pass false;
        switch (
    MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
          case 
    'national':
            if (
    $order->delivery['country_id'] == STORE_COUNTRY) {
              
    $pass true;
            }
            break;
          case 
    'international':
            if (
    $order->delivery['country_id'] != STORE_COUNTRY) {
              
    $pass true;
            }
            break;
          case 
    'both':
            
    $pass true;
            break;
        }
        
    $free_shipping false;
        if ( (
    $pass == true) && ($_SESSION['cart']->show_total() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
          
    $free_shipping true;
        }
      } else {
        
    $free_shipping false;
      }
     
    // get all available shipping quotes
      
    $quotes $shipping_modules->quote();
    // if no shipping method has been selected, automatically select the cheapest method.
    // if the modules status was changed when none were available, to save on implementing
    // a javascript force-selection method, also automatically select the cheapest shipping
    // method if more than one module is now enabled
      
    if ( !$_SESSION['shipping'] || ( $_SESSION['shipping'] && ($_SESSION['shipping'] == false) && (zen_count_shipping_modules() > 1) ) ) $_SESSION['shipping'] = $shipping_modules->cheapest();
      
    // Should address-edit button be offered?
      
    $displayAddressEdit = (MAX_ADDRESS_BOOK_ENTRIES >= 2);
      
    // if shipping-edit button should be overridden, do so
      
    $editShippingButtonLink zen_href_link(FILENAME_CHECKOUT_SHIPPING_ADDRESS'''SSL'); 
      if (isset(
    $_SESSION['payment']) && method_exists($$_SESSION['payment'], 'alterShippingEditButton')) {
        
    $theLink = $$_SESSION['payment']->alterShippingEditButton();
        if (
    $theLink) {
          
    $editShippingButtonLink $theLink;
          
    $displayAddressEdit true;
        }
      }
      
    $total_weight $_SESSION['cart']->show_weight();
      
    $total_count $_SESSION['cart']->count_contents();
     
      require(
    DIR_WS_MODULES zen_get_module_directory('require_languages.php'));
      if (isset(
    $_GET['payment_error']) && is_object(${$_GET['payment_error']}) && ($error = ${$_GET['payment_error']}->get_error())) {
        
    $messageStack->add('checkout_payment'$error['error'], 'error');
      }
     
     
      
    // Load the selected shipping module(needed to calculate tax correctly)
      
    $shipping_modules = new shipping($_SESSION['shipping']);
     
      
    $comments $_SESSION['comments']; // process comments
     
      
    if (isset($_POST['payment'])) $_SESSION['payment'] = $_POST['payment'];
      if (isset(
    $_POST['comments'])) $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
     
      switch (
    $_GET['action']) {
     case 
    'process':
       
    $form_action_url zen_href_link(FILENAME_CHECKOUT'action=null''SSL');
          if (
    zen_not_null($_POST['comments'])) {
            
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
          }
          
    $comments $_SESSION['comments'];
     
          if ( (
    zen_count_shipping_modules() > 0) || ($free_shipping == true) ) {
            if ( (isset(
    $_POST['shipping'])) && (strpos($_POST['shipping'], '_')) ) {
              
    $_SESSION['shipping'] = $_POST['shipping']; // process shipping
              
    list($module$method) = explode('_'$_SESSION['shipping']);
              if ( 
    is_object($$module) || ($_SESSION['shipping'] == 'free_free') ) {
                if (
    $_SESSION['shipping'] == 'free_free') {
                  
    $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
                 
    $quote[0]['methods'][0]['cost'] = '0';
                } else {
                  
    $quote $shipping_modules->quote($method$module);
                }
                if (isset(
    $quote['error'])) {
                  
    $_SESSION['shipping'] = '';
                } else {
                  if ( (isset(
    $quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
                    
    $_SESSION['shipping'] = array('id' => $_SESSION['shipping'],
                                      
    'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' $quote[0]['methods'][0]['title'] . ')'),
                                      
    'cost' => $quote[0]['methods'][0]['cost']);
                    
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_CONFIRMATION'''SSL')); 
                  }
                }
              } else {
                
    $_SESSION['shipping'] = false;
              }
            }
          } else {
            
    $_SESSION['shipping'] = false;
            
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_CONFIRMATION'''SSL')); 
          }
          break;
        case 
    'update'
          
    $form_action_url zen_href_link(FILENAME_CHECKOUT'action=null''SSL');   
          if (
    zen_not_null($_POST['comments'])) {
           
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
          }
          
    $comments $_SESSION['comments'];
     
          if ( (
    zen_count_shipping_modules() > 0) || ($free_shipping == true) ) {
            if ( (isset(
    $_POST['shipping'])) && (strpos($_POST['shipping'], '_')) ) {
              
    $_SESSION['shipping'] = $_POST['shipping']; // process shipping
              
    list($module$method) = explode('_'$_SESSION['shipping']);
              if ( 
    is_object($$module) || ($_SESSION['shipping'] == 'free_free') ) {
                if (
    $_SESSION['shipping'] == 'free_free') {
                  
    $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
                  
    $quote[0]['methods'][0]['cost'] = '0';
                } else {
                  
    $quote $shipping_modules->quote($method$module);
                }
                if (isset(
    $quote['error'])) {
                  
    $_SESSION['shipping'] = '';
                } else {
                  if ( (isset(
    $quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
                    
    $_SESSION['shipping'] = array('id' => $_SESSION['shipping'],
                                      
    'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' $quote[0]['methods'][0]['title'] . ')'),
                                      
    'cost' => $quote[0]['methods'][0]['cost']);
     
                    
    zen_redirect(zen_href_link(FILENAME_CHECKOUT'action=null''SSL')); 
                  }
                }
              } else {
                
    $_SESSION['shipping'] = false;
              }
            }
          } else {
            
    $_SESSION['shipping'] = false;
         
    zen_redirect(zen_href_link(FILENAME_CHECKOUT'action=null''SSL'));  
          }
          break;
        case 
    'submit':  
          if (isset($
    $_SESSION['payment']->form_action_url)) {
         
    $form_action_url = $$_SESSION['payment']->form_action_url;
         } else {
        
    $form_action_url zen_href_link(FILENAME_CHECKOUT_PROCESS'''SSL');
          }
          
    // process comments 
       
    if (zen_not_null($_POST['comments'])) {
            
    $_SESSION['comments'] = zen_db_prepare_input($_POST['comments']);
          }
          
    $comments $_SESSION['comments'];
          
    // process shipping
          
    if ( (zen_count_shipping_modules() > 0) || ($free_shipping == true) ) {
            if ( (isset(
    $_POST['shipping'])) && (strpos($_POST['shipping'], '_')) ) {
              
    $_SESSION['shipping'] = $_POST['shipping']; // process shipping
              
    list($module$method) = explode('_'$_SESSION['shipping']);
              if ( 
    is_object($$module) || ($_SESSION['shipping'] == 'free_free') ) {
                if (
    $_SESSION['shipping'] == 'free_free') {
                  
    $quote[0]['methods'][0]['title'] = FREE_SHIPPING_TITLE;
                  
    $quote[0]['methods'][0]['cost'] = '0';
                } else {
                  
    $quote $shipping_modules->quote($method$module);
                }
                if (isset(
    $quote['error'])) {
                  
    $_SESSION['shipping'] = '';
                } else {
                  if ( (isset(
    $quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
                    
    $_SESSION['shipping'] = array('id' => $_SESSION['shipping'],
                                                  
    'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' $quote[0]['methods'][0]['title'] . ')'),
                                                  
    'cost' => $quote[0]['methods'][0]['cost']);
              if (isset($
    $_SESSION['payment']->form_action_url)) {
             
    zen_redirect($$_SESSION['payment']->form_action_url);
             } else {
             
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PROCESS'''SSL'));
              }
                  }
                }
              } else {
                
    $_SESSION['shipping'] = false;
              }
            }
          } else {
            
    $_SESSION['shipping'] = false;
            if (isset($
    $_SESSION['payment']->form_action_url)) {
        
    zen_redirect($$_SESSION['payment']->form_action_url);
      } else {
        
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PROCESS'''SSL'));
         }
          }
          break;
        case 
    'null':
          
    $form_action_url zen_href_link(FILENAME_CHECKOUT'action=null''SSL');
          break;
        default:
          
    $form_action_url zen_href_link(FILENAME_CHECKOUT'action=null''SSL');
          
    zen_redirect(zen_href_link(FILENAME_CHECKOUT'action=null''SSL'));
          break;
      }
     
      
    $breadcrumb->add(NAVBAR_TITLE_1zen_href_link(FILENAME_CHECKOUT'''SSL'));  
     
      
    $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_SHIPPING');
      
    $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_PAYMENT');
     
      if (
    FEC_ONE_PAGE == 'true') {
      
    $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_CONFIRMATION');  
    // update customers_referral with $_SESSION['gv_id']
        
    if ($_SESSION['cc_id']) {
          
    $discount_coupon_query "SELECT coupon_code
                                    FROM " 
    TABLE_COUPONS "
                                    WHERE coupon_id = :couponID"
    ;
     
          
    $discount_coupon_query $db->bindVars($discount_coupon_query':couponID'$_SESSION['cc_id'], 'integer');
          
    $discount_coupon $db->Execute($discount_coupon_query);
          
    $customers_referral_query "SELECT customers_referral
                                       FROM " 
    TABLE_CUSTOMERS "
                                       WHERE customers_id = :customersID"
    ;
          
    $customers_referral_query $db->bindVars($customers_referral_query':customersID'$_SESSION['customer_id'], 'integer');
          
    $customers_referral $db->Execute($customers_referral_query);
    // only use discount coupon if set by coupon
          
    if ($customers_referral->fields['customers_referral'] == '' and CUSTOMERS_REFERRAL_STATUS == 1) {
            
    $sql "UPDATE " TABLE_CUSTOMERS "
                    SET customers_referral = :customersReferral
                    WHERE customers_id = :customersID"
    ;
            
    $sql $db->bindVars($sql':customersID'$_SESSION['customer_id'], 'integer');
            
    $sql $db->bindVars($sql':customersReferral'$discount_coupon->fields['coupon_code'], 'string');
            
    $db->Execute($sql);
          } else {
            
    // do not update referral was added before
          
    }
        }
      
    $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_CONFIRMATION');
      }
    ?>

  3. #13
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Re: Fast and Easy Checkout

    Script is ready for bug testing:

    http://www.numinix.com/1pagecheckout/

    The script is called Fast and Easy Checkout for Zen Cart and includes either a 2 step process (shipping/payment + confirmation), or the option to have a one page checkout without the confirmation page.

    The script updates the order_total on the same page using a refresh function so that confirmation is not needed. It also auto refreshes if you enter a discount coupon. The script also will not validate if you forget to choose a payment method or select the terms and conditions checkbox and an error message is printed at the top of the form.

    I've tested it in IE7 and FF without errors.

  4. #14
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Fast and Easy Checkout

    Does it touch any core code numinix?
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  5. #15
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Re: Fast and Easy Checkout

    It only overwrites one file, filenames.php and it just defines FILENAME_CHECKOUT_SHIPPING and FILENAME_CHECKOUT_PAYMENT as 'checkout'

    I'm going to see if there is a way to override the filenames.php page. I'd also like to be able to do some conditional statements in this page so that the module can be turned on or off as a whole by putting the definitions back to normal.

    At the moment, I haven't tried or figured a way to do this...

  6. #16
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Fast and Easy Checkout

    One of the possible ways, is to define it in table configuration, the constants will be available throughout the site.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  7. #17
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Re: Fast and Easy Checkout

    Yes, but then when I placed that conditional statement in filenames.php I think I received an error. I'm going to try it again now and post back.

  8. #18
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Re: Fast and Easy Checkout

    I remember the issue, filenames.php doesn't have require('includes/application_top.php');

  9. #19
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: Fast and Easy Checkout

    I see what you mean, not really anything serious though. We can try to define it at the init_loaders but I think it's not necessary, just 2 small changes in filesname.php. I hope DrByte can suggest something tho.

    Good job by the way. I'll check this out at the end of this week and let you know if it works out okie. Which payment method did you check with this by the way? I'm currently using Paypal, Linkpoint, check/money order.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  10. #20
    Join Date
    Apr 2007
    Location
    Vancouver, Canada
    Posts
    1,547
    Plugin Contributions
    81

    Default Re: Fast and Easy Checkout

    Only with PayPal, it uses the same process to redirect to the payment processors so I doubt there will be any issues.

 

 
Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Fast and Easy Checkout
    By numinix in forum All Other Contributions/Addons
    Replies: 2176
    Last Post: 14 Mar 2024, 06:27 PM
  2. Replies: 4
    Last Post: 25 Jan 2012, 07:37 PM
  3. Fast and Easy Checkout - Checkout Without Account not showing
    By Lee-oh in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 3 Feb 2010, 05:09 PM
  4. Go To Checkout Error - with Fast and Easy Checkout installed
    By RFree190 in forum General Questions
    Replies: 3
    Last Post: 10 Mar 2009, 07:08 AM
  5. checkout page not redirect (Fast and Easy Checkout module)
    By wowemall in forum Addon Templates
    Replies: 0
    Last Post: 27 Sep 2008, 02:36 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