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

    Default Fast and Easy Checkout

    Here is the header file for checkout

    I am having an issue where the shipping selection is not passed to the shipment confirmation page:

    PHP Code:
      $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_PAYMENT');

    // 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'));
      }
    }
    // get coupon code
    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);
    }
    // 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'] = '';
      }
    }
    require(
    DIR_WS_CLASSES 'order.php');
    $order = new order;
    require(
    DIR_WS_CLASSES 'order_total.php');
    $order_total_modules = new order_total;
    $order_total_modules->collect_posts();
    $order_total_modules->pre_confirmation_check();
    //  $_SESSION['comments'] = '';
    $comments $_SESSION['comments'];
    $total_weight $_SESSION['cart']->show_weight();
    $total_count $_SESSION['cart']->count_contents();
    // load all enabled payment modules
    require(DIR_WS_CLASSES 'payment.php');
    $payment_modules = new payment;
    $flagOnSubmit sizeof($payment_modules->selection());
    // Load the selected shipping module(needed to calculate tax correctly)
    require(DIR_WS_CLASSES 'shipping.php');
    $shipping_modules = new shipping($_SESSION['shipping']);
    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');
    }
    $breadcrumb->add(NAVBAR_TITLE_1zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'));
    $breadcrumb->add(NAVBAR_TITLE_2);
    // This should be last line of the script:
    $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_PAYMENT');
    $zco_notifier->notify('NOTIFY_HEADER_START_CHECKOUT_SHIPPING');
      require_once(
    DIR_WS_CLASSES 'http_client.php');
    // 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 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'] = '';
        }
      }
      
    $order = new order;
    // register a random ID in the session to check throughout the checkout procedure
    // against alterations in the shopping cart contents
      
    $_SESSION['cartID'] = $_SESSION['cart']->cartID;
    // if the order contains only virtual products, forward the customer to the billing page as
    // a shipping address is not needed
      
    if ($order->content_type == 'virtual') {
        
    $_SESSION['shipping'] = 'free_free';
        
    $_SESSION['shipping']['title'] = 'free_free';
        
    $_SESSION['sendto'] = false;
        
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));
      }
      
    $total_weight $_SESSION['cart']->show_weight();
      
    $total_count $_SESSION['cart']->count_contents();
    // load all enabled shipping modules
      
    $shipping_modules = new shipping;
      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;
      }
      require(
    DIR_WS_MODULES zen_get_module_directory('require_languages.php'));
      if (isset(
    $_SESSION['comments'])) {
        
    $comments $_SESSION['comments'];
      }

    // process the selected shipping method
      
    if ( isset($_POST['action']) && ($_POST['action'] == 'process') ) {
        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'];
            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_PAYMENT'''SSL'));
                }
              }
            } else {
              
    $_SESSION['shipping'] = false;
            }
          }
        } else {
          
    $_SESSION['shipping'] = false;
          
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));
        }
      }
    // get all available shipping quotes
      
    $quotes $shipping_modules->quote();
      
    // 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;
        }
      }
      
    $breadcrumb->add(NAVBAR_TITLE_1zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'));
      
    $breadcrumb->add(NAVBAR_TITLE_2);
    // This should be last line of the script:
      
    $zco_notifier->notify('NOTIFY_HEADER_END_CHECKOUT_SHIPPING'); 

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

    Default Re: Fast and Easy Checkout

    includes/modules/pages/checkout/header_php.php:

    PHP Code:
    <?php
      
      
    require(DIR_WS_CLASSES 'order_total.php');
      
    $order_total_modules = new order_total;

      require(
    DIR_WS_CLASSES 'payment.php');
      
    $payment_modules = new payment($payment);

      require(
    DIR_WS_CLASSES 'order.php');
      
    $order = new order;

      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();
        
      
    $order_total_modules = new order_total;
      
    $order_total_modules->collect_posts();
      
    $order_total_modules->pre_confirmation_check();
     
      
    // 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;
      }

      if (isset(
    $_SESSION['comments'])) {
        
    $comments $_SESSION['comments'];
      }

    // process the selected shipping method
      
    if ( isset($_POST['action']) && ($_POST['action'] == 'process') ) {
        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'];

            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'));
        }
      }

    // 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');
      }

      
    $breadcrumb->add(NAVBAR_TITLE_1zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'));  
    ?>
    includes/templates/YOUR TEMPLATE/templates/tpl_checkout_default.php:

    PHP Code:
    <div class="centerColumn" id="checkout">

    <?php echo zen_draw_form('checkout_payment'zen_href_link(FILENAME_CHECKOUT_CONFIRMATION'''SSL'), 'post', ($flagOnSubmit 'onsubmit="return check_form();"' '')); ?>

    <h1 id="checkoutPaymentHeading"><?php echo HEADING_TITLE_PAYMENT?></h1>

    <?php
      $selection 
    =  $order_total_modules->credit_selection();
      if (
    sizeof($selection)>0) {
        for (
    $i=0$n=sizeof($selection); $i<$n$i++) {
          if (
    $_GET['credit_class_error_code'] == $selection[$i]['id']) {
    ?>
    <div class="messageStackError"><?php echo zen_output_string_protected($_GET['credit_class_error']); ?></div>

    <?php
          
    }
          for (
    $j=0$n2=sizeof($selection[$i]['fields']); $j<$n2$j++) {
    ?>
    <fieldset>
    <legend><?php echo $selection[$i]['module']; ?></legend>
    <?php echo $selection[$i]['redeem_instructions']; ?>
    <div class="gvBal larger"><?php echo $selection[$i]['checkbox']; ?></div>
    <label class="inputLabel"<?php echo ($selection[$i]['fields'][$j]['tag']) ? ' for="'.$selection[$i]['fields'][$j]['tag'].'"'''?>><?php echo $selection[$i]['fields'][$j]['title']; ?></label>
    <?php echo $selection[$i]['fields'][$j]['field']; ?>
    </fieldset>
    <?php
          
    }
        }
    ?>

    <?php
        
    }
    ?>

    <br>
    <?php
      
    if (DISPLAY_PRIVACY_CONDITIONS == 'true') {
    ?>
    <fieldset>
    <legend><?php echo TABLE_HEADING_PRIVACY_CONDITIONS?></legend>
    <div class="information"><?php echo TEXT_PRIVACY_CONDITIONS_DESCRIPTION;?></div>
    <?php echo zen_draw_checkbox_field('privacy_conditions''1'false'id="privacy"');?>
    <label clas="checkboxLabel" for="privacy"><?php echo TEXT_PRIVACY_CONDITIONS_CONFIRM;?></label>
    </fieldset>
    <?php
     
    }
    ?>
    <?php 
    // ** BEGIN PAYPAL EXPRESS CHECKOUT **
          
    if (!$payment_modules->in_special_checkout()) {
          
    // ** END PAYPAL EXPRESS CHECKOUT ** ?>
    <!--<br class="clearBoth" />-->
    <?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
          
    }
          
    // ** END PAYPAL EXPRESS CHECKOUT ** ?>
    <?php 
    // ** BEGIN PAYPAL EXPRESS CHECKOUT **
          
    if (!$payment_modules->in_special_checkout()) {
          
    // ** END PAYPAL EXPRESS CHECKOUT ** ?>
    <fieldset>
    <legend><?php echo TABLE_HEADING_PAYMENT_METHOD?></legend>

    <?php
      
    if (SHOW_ACCEPTED_CREDIT_CARDS != '0') {
    ?>

    <?php
        
    if (SHOW_ACCEPTED_CREDIT_CARDS == '1') {
          echo 
    TEXT_ACCEPTED_CREDIT_CARDS zen_get_cc_enabled();
        }
        if (
    SHOW_ACCEPTED_CREDIT_CARDS == '2') {
          echo 
    TEXT_ACCEPTED_CREDIT_CARDS zen_get_cc_enabled('IMAGE_');
        }
    ?>
    <br class="clearBoth" />
    <?php ?>

    <?php
      $selection 
    $payment_modules->selection();

      if (
    sizeof($selection) > 1) {
    ?>
    <p class="important"><?php echo TEXT_SELECT_PAYMENT_METHOD?></p>
    <?php
      
    } elseif (sizeof($selection) == 0) {
    ?>
    <p class="important"><?php echo TEXT_NO_PAYMENT_OPTIONS_AVAILABLE?></p>

    <?php
      
    }
    ?>

    <?php
      $radio_buttons 
    0;
      for (
    $i=0$n=sizeof($selection); $i<$n$i++) {
    ?>
    <?php
        
    if (sizeof($selection) > 1) {
            if (empty(
    $selection[$i]['noradio'])) {
     
    ?>
    <?php 
    echo zen_draw_radio_field('payment'$selection[$i]['id'], ($selection[$i]['id'] == $_SESSION['payment'] ? true false), 'id="pmt-'.$selection[$i]['id'].'"'); ?>
    <?php   
    ?>
    <?php
        
    } else {
            
    ?>
    <?php 
    echo zen_draw_hidden_field('payment'$selection[$i]['id']); ?>
    <?php
        
    }
    ?>
    <label for="pmt-<?php echo $selection[$i]['id']; ?>" class="radioButtonLabel"><?php echo $selection[$i]['module']; ?></label>

    <?php
        
    if (defined('MODULE_ORDER_TOTAL_COD_STATUS') && MODULE_ORDER_TOTAL_COD_STATUS == 'true' and $selection[$i]['id'] == 'cod') {
    ?>
    <div class="alert"><?php echo TEXT_INFO_COD_FEES?></div>
    <?php
        
    } else {
          
    // echo 'WRONG ' . $selection[$i]['id'];
    ?>
    <?php
        
    }
    ?>
    <br class="clearBoth" />

    <?php
        
    if (isset($selection[$i]['error'])) {
    ?>
        <div><?php echo $selection[$i]['error']; ?></div>

    <?php
        
    } elseif (isset($selection[$i]['fields']) && is_array($selection[$i]['fields'])) {
    ?>

    <div class="ccinfo">
    <?php
          
    for ($j=0$n2=sizeof($selection[$i]['fields']); $j<$n2$j++) {
    ?>
    <label <?php echo (isset($selection[$i]['fields'][$j]['tag']) ? 'for="'.$selection[$i]['fields'][$j]['tag'] . '" ' ''); ?>class="inputLabelPayment"><?php echo $selection[$i]['fields'][$j]['title']; ?></label><?php echo $selection[$i]['fields'][$j]['field']; ?>
    <br class="clearBoth" />
    <?php
          
    }
    ?>
    </div>
    <br class="clearBoth" />
    <?php
        
    }
        
    $radio_buttons++;
    ?>
    <br class="clearBoth" />
    <?php
      
    }
    ?>

    </fieldset>
    <?php // ** BEGIN PAYPAL EXPRESS CHECKOUT **
          
    } else {
            
    ?><input type="hidden" name="payment" value="<?php echo $_SESSION['payment']; ?>" /><?php
          
    }
          
    // ** END PAYPAL EXPRESS CHECKOUT ** ?>
    <!-- EOF PAYMENT -->
    <br class="clearBoth" />
    <!--BOF SHIPPING-->
    <h1 id="checkoutShippingHeading"><?php echo HEADING_TITLE_SHIPPING?></h1>
    <fieldset id="checkoutShipping">
    <legend><?php echo TABLE_HEADING_SHIPPING_ADDRESS?></legend>
    <?php if ($messageStack->size('checkout_shipping') > 0) echo $messageStack->output('checkout_shipping'); ?>

    <div id="checkoutShipto" class="floatingBox back">
    <?php if ($displayAddressEdit) { ?>
    <div class="buttonRow forward"><?php echo '<a href="' $editShippingButtonLink '">' zen_image_button(BUTTON_IMAGE_CHANGE_ADDRESSBUTTON_CHANGE_ADDRESS_ALT) . '</a>'?></div>
    <?php ?>
    <address class=""><?php echo zen_address_label($_SESSION['customer_id'], $_SESSION['sendto'], true' ''<br />'); ?></address>
    </div>
    <div class="floatingBox important forward"><?php echo TEXT_CHOOSE_SHIPPING_DESTINATION?></div>
    </fieldset>

    <fieldset id="checkoutShippingMethods">
    <legend><?php echo TABLE_HEADING_SHIPPING_METHOD?></legend>
    <?php
      
    if (zen_count_shipping_modules() > 0) {
    ?>

    <?php
        
    if (sizeof($quotes) > && sizeof($quotes[0]) > 1) {
    ?>

    <div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_CHOOSE_SHIPPING_METHOD?></div>

    <?php
        
    } elseif ($free_shipping == false) {
    ?>
    <div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_ENTER_SHIPPING_INFORMATION?></div>

    <?php
        
    }
    ?>
    <?php
        
    if ($free_shipping == true) {
    ?>
    <div id="freeShip" class="important" ><?php echo FREE_SHIPPING_TITLE?>&nbsp;<?php echo $quotes[$i]['icon']; ?></div>
    <div id="defaultSelected"><?php echo sprintf(FREE_SHIPPING_DESCRIPTION$currencies->format(MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) . zen_draw_hidden_field('shipping''free_free'); ?></div>

    <?php
        
    } else {
          
    $radio_buttons 0;
          for (
    $i=0$n=sizeof($quotes); $i<$n$i++) {
    ?>
    <fieldset>
    <legend><?php echo $quotes[$i]['module']; ?>&nbsp;<?php if (isset($quotes[$i]['icon']) && zen_not_null($quotes[$i]['icon'])) { echo $quotes[$i]['icon']; } ?></legend>

    <?php
            
    if (isset($quotes[$i]['error'])) {
    ?>
          <div><?php echo $quotes[$i]['error']; ?></div>
    <?php
            
    } else {
              for (
    $j=0$n2=sizeof($quotes[$i]['methods']); $j<$n2$j++) {
    // set the radio button to be checked if it is the method chosen
                
    $checked = (($quotes[$i]['id'] . '_' $quotes[$i]['methods'][$j]['id'] == $_SESSION['shipping']['id']) ? true false);

                if ( (
    $checked == true) || ($n == && $n2 == 1) ) {
                  
    //echo '      <div id="defaultSelected" class="moduleRowSelected">' . "\n";
                //} else {
                  //echo '      <div class="moduleRow">' . "\n";
                
    }
    ?>
    <?php
                
    if ( ($n 1) || ($n2 1) ) {
    ?>
    <div class="important forward"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], (isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0))); ?></div>
    <?php
                
    } else {
    ?>
    <div class="important forward"><?php echo $currencies->format(zen_add_tax($quotes[$i]['methods'][$j]['cost'], $quotes[$i]['tax'])) . zen_draw_hidden_field('shipping'$quotes[$i]['id'] . '_' $quotes[$i]['methods'][$j]['id']); ?></div>
    <?php
                
    }
    ?>

    <?php echo zen_draw_radio_field('shipping'$quotes[$i]['id'] . '_' $quotes[$i]['methods'][$j]['id'], $checked'id="ship-'.$quotes[$i]['id'] . '-' $quotes[$i]['methods'][$j]['id'].'"'); ?>
    <label for="ship-<?php echo $quotes[$i]['id'] . '-' $quotes[$i]['methods'][$j]['id']; ?>" class="checkboxLabel" ><?php echo $quotes[$i]['methods'][$j]['title']; ?></label>
    <!--</div>-->
    <br class="clearBoth" />
    <?php
                $radio_buttons
    ++;
              }
            }
    ?>

    </fieldset>
    <?php
          
    }
        }
    ?>

    <?php
      
    } else {
    ?>
    <h2 id="checkoutShippingHeadingMethod"><?php echo TITLE_NO_SHIPPING_AVAILABLE?></h2>
    <div id="checkoutShippingContentChoose" class="important"><?php echo TEXT_NO_SHIPPING_AVAILABLE?></div>
    <?php
      
    }
    ?>
    </fieldset>
    <!--EOF SHIPPING-->

    <div class="buttonRow forward"><?php echo zen_draw_hidden_field('action''submit') . zen_image_submit(BUTTON_IMAGE_CONTINUEBUTTON_CONTINUE_ALT); ?></div>
    <div class="buttonRow back"><?php echo TITLE_CONTINUE_CHECKOUT_PROCEDURE '<br />' TEXT_CONTINUE_CHECKOUT_PROCEDURE?></div>

    </form>
    </div>
    The issue is that the shipping method selected during the shortened checkout process is not passed to checkout_confirmation. Payments are passed correctly.

    http://www.numinix.com/1pagecheckout/ ignore the layout of the checkout page, it will be completed once I know all variables are being passed including showing the cart contents at the top.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fast and Easy Checkout

    Your page will have to post back to itself in order to process the shipping selection.
    .

    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.

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

    Default Re: Fast and Easy Checkout

    DrByte,

    that works, but then doesn't go to the next page...

    any more pointers are appreciated

  5. #5
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fast and Easy Checkout

    Just as each of the existing checkout pages does, you should do also. Once the data is validated, redirect to the next page.
    .

    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.

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

    Default Re: Fast and Easy Checkout

    It appears to be this line in checkout_confirmation/header_php.php:

    PHP Code:
    if ($messageStack->size('checkout_payment') > 0) {
      
    zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT'''SSL'));

    I chaged this to 'checkout'

    Could you confirm what this does?
    Last edited by numinix; 23 Sep 2007 at 11:24 PM.

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

    Default Re: Fast and Easy Checkout

    Just to clarify, this is what had to be done to the start and ends of the form to pass the required information:

    PHP Code:
    <?php echo zen_draw_form('checkout'zen_href_link(FILENAME_CHECKOUT_SHIPPING'''SSL'), 'post', ($flagOnSubmit 'onsubmit="return check_form();"' '')) . zen_draw_hidden_field('action' 'process'); ?>
    PHP Code:
    <div class="buttonRow forward"><?php echo zen_image_submit(BUTTON_IMAGE_CONTINUE_CHECKOUTBUTTON_CONTINUE_ALT'onclick="submitFunction('.zen_user_has_gv_account($_SESSION['customer_id']).','.$order->info['total'].')"'); ?></div>
    Was the change I made to checkout_confirmation's header appropriate (from last post)?

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

    Default Re: Fast and Easy Checkout

    Turns out it's not completely working.

    Now, the payment information is not passed.

    If I post to checkout_confirmation the payment information is included, but the shipping information is not.

    If I post to self, the payment information isn't included, but the shipping information is.

    So, I need to post to self and then to checkout_confirmation? I've spent too much time on this lol...

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

    Default Re: Fast and Easy Checkout

    Got around the double actions by giving $_SESSION['payment'] = $_POST['payment']

    Comments do not pass though using this...

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

    Default Re: Fast and Easy Checkout

    Script is completed, for now. Now I am going to give the option of removing the checkout_confirmation page....

 

 
Page 1 of 3 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