Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

fast easy checkout


nana

Recommended Posts

  • Replies 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

Nana, thanks for the CC error solution.

 

Now when I click the "Confirm Order" button my address bar shows: https://secure.authorize.net/gateway/transact.dll with an erreo on the page: "There has been an error processing your credit card. Please try again."

 

I am just using the Authorize.net test mode.

Does this sound familiar?

Link to comment
Share on other sites

hello david i am at work now and unfortunatly my dsl is broken and i had to also restore my computer so i can not check anything now but i think

if (!tep_session_is_registered('sendto')) tep_session_register('sendto');

could be

if (!tep_session_is_registered('billto')) tep_session_register('bilto');

i also have a file that includes the login and create acoount parts in the same page as create_account3.php if you are intrested but it is not cleaned out and has some useless code and some code specific to my site in it

spencermjax i do not know what causes that that. i do not use authorizenet. but i do not think this has anything to do with the changes to the checkout_shipping.php and checkout_confirmation.php this code is generated from the module itself and not in these pages.

if you want to make sure if all variable are available you can uncomment the print command on top of the checkout_confirmation.php and you will see a list of them

you should do this so you can write the codes you need to write to unregister the appropiate variables.

Link to comment
Share on other sites

Im Having trouble getting fast easy checkout to work correctly with BTS

Problem Is When I Go To Checkout Shipping The Template gets messed up

Anyone know exactly what lines i would need to change/remove to fix this

 

 

Here is the

Checkout_shipping.php from BTS

 

 

<?php
/*
 $Id: checkout_shipping.php,v 1.1.1.1 2005/01/15 06:43:45 Michael Sasek Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
 require('includes/classes/http_client.php');

// BOF: WebMakers.com Added: Downloads Controller - Free Shipping
// Reset $shipping if free shipping is on and weight is not 0
if (tep_get_configuration_key_value('MODULE_SHIPPING_FREESHIPPER_STATUS') and $cart->show_weight()!=0) {
 tep_session_unregister('shipping');
}
// EOF: WebMakers.com Added: Downloads Controller - Free Shipping

// BOF: Individual Shipping 
if (tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS') and $shiptotal) {
 tep_session_unregister('shipping');
}
// EOF: Individual Shipping 

// if the customer is not logged on, redirect them to the login page
 if (!tep_session_is_registered('customer_id')) {
   $navigation->set_snapshot();
   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

// if there is nothing in the customers cart, redirect them to the shopping cart page
 if ($cart->count_contents() < 1) {
   tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
 }

// if no shipping destination address was selected, use the customers own address as default
 if (!tep_session_is_registered('sendto')) {
   tep_session_register('sendto');
   $sendto = $customer_default_address_id;
 } else {
// verify the selected shipping address
   $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");
   $check_address = tep_db_fetch_array($check_address_query);

   if ($check_address['total'] != '1') {
     $sendto = $customer_default_address_id;
     if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');
   }
 }

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

// register a random ID in the session to check throughout the checkout procedure
// against alterations in the shopping cart contents
 if (!tep_session_is_registered('cartID')) tep_session_register('cartID');
 $cartID = $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') || ($order->content_type == 'virtual_weight')) {
   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');
   $shipping = false;
   $sendto = false;
   tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }

 $total_weight = $cart->show_weight();
 $total_count = $cart->count_contents();

// load all enabled shipping modules
 require(DIR_WS_CLASSES . 'shipping.php');
 $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) && ($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
     $free_shipping = true;

     include(DIR_WS_LANGUAGES . $language . '/modules/order_total/ot_shipping.php');
   }
 } else {
   $free_shipping = false;
 }

// process the selected shipping method
 if ( isset($HTTP_POST_VARS['action']) && ($HTTP_POST_VARS['action'] == 'process') ) {
   if (!tep_session_is_registered('comments')) tep_session_register('comments');
   if (tep_not_null($HTTP_POST_VARS['comments'])) {
     $comments = tep_db_prepare_input($HTTP_POST_VARS['comments']);
   }

   if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

   if ( (tep_count_shipping_modules() > 0) || ($free_shipping == true) ) {
     if ( (isset($HTTP_POST_VARS['shipping'])) && (strpos($HTTP_POST_VARS['shipping'], '_')) ) {
       $shipping = $HTTP_POST_VARS['shipping'];

       list($module, $method) = explode('_', $shipping);
       if ( is_object($$module) || ($shipping == 'free_free') ) {
         if ($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'])) {
           tep_session_unregister('shipping');
         } else {
           if ( (isset($quote[0]['methods'][0]['title'])) && (isset($quote[0]['methods'][0]['cost'])) ) {
             $shipping = array('id' => $shipping,
                               'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
                               'cost' => $quote[0]['methods'][0]['cost']);

             tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
           }
         }
       } else {
         tep_session_unregister('shipping');
       }
     }
   } else {
     $shipping = false;
               
     tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', '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 ( !tep_session_is_registered('shipping') || ( tep_session_is_registered('shipping') && ($shipping == false) && (tep_count_shipping_modules() > 1) ) ) $shipping = $shipping_modules->cheapest();

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SHIPPING);

 $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
 $breadcrumb->add(NAVBAR_TITLE_2, tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

 $content = CONTENT_CHECKOUT_SHIPPING;
 $javascript = $content . '.js';

 require(DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE);

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

Thanks In Advance

Link to comment
Share on other sites

ok david i took a look at that part of the file

i don't remember exactly where i got that i have to do another fresh install to figure out exactly and that has to stay for tomorrow . the main goal is pretty simple and you should figure it out easily if you just take a quick look at the files.

i am trying to make them redirect to checkout-shopping.php if the edit address is initiated from there and checkout+confirmation if it is startred there.

the issue with the session is when you go to these pages to edit the address you lose the shippto and billto values from the sesseion and you have to comment these lines out. this is mainly to accomadate create+account3.php if you have not tried it take a look seelily.com/create_account3.php

i hope i am clear enough if not tommorroew i do a fresh install. but today i am just to pooped. sorry

 

spencermjax - unfortunatly i am not using authorizenet so i can not answer your questions but i have tried to not change anything in checkout_confirmation to effect the payment method so it keeps the compatabilty to all shipping module and payment module and contributions. i have only put the shipping and payment pages on top of each other and made the form work correctly. maybe you should post your question in authorizenet tread or in payment module support or maybe general support forum. there might be someone with more knowledge about authorizenet can answer your question but if you change

foreach ($_SESSION as $key => $val) {
            //    print $key.' => '.$val.' - ';print_r($val);echo "<br>";
                 $HTTP_POST_VARS[$key] = $val;

                 }

to

foreach ($_SESSION as $key => $val) {
              print $key.' => '.$val.' - ';print_r($val);echo "<br>";
                 $HTTP_POST_VARS[$key] = $val;

                 }

at the beginning the checkout_confirmation.php

it will list the available keys and values in the session.

make sure authorizenet_cc and other variables are available they start with authorizenet_ i think

please let me know how you makeout with this since i have no way of knowing and it could be of value to other people.

 

 

Makrin i am not using any template system and have managed to change the look of my site by editing the php files and from css only but that is another story

as far as i can see from your post and the other one a few pages ago i belive that bts breaks the file in two section one is the php part which you both posted.

this seems to be the code on top of the page till the end of the beadcrumb and then the call to the html part

  $content = CONTENT_CHECKOUT_SHIPPING;
$javascript = $content . '.js';

require(DIR_WS_TEMPLATES . TEMPLATENAME_MAIN_PAGE);

require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

 

if you take this approach it will probably work. most probably you also have to change the html part to combine the shipping and payment pages.

please let me know how you madeout also this would probably be something that i would never try myself

Link to comment
Share on other sites

Looks really good on your demo, thanks a lot Frank. Will apply it shortly and confirm all is well.

 

Thanks a lot

 

John

 

 

Frank

 

Your solution to this problem work perfectly. Thank you for your assistance on this.

I'm now going to delve in and do part TWO :o

 

Just a note for anyone that is interested.

I like a little mod I added a while ago that automatically sets the first payment option as being checked, here it is very simple.

 

Find the body tag like this

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

 

Replace it with this

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" onload="javascript:document.checkout_payment.payment[0].click();return true;">

 

That should do it.

(This mod is not mine, but picked it up somewhere on the forums)

 

Cheers

John

Link to comment
Share on other sites

section 4a of the instruction should be

change in checkout_payment_address.php around line 144

 if (!tep_session_is_registered('billto')) tep_session_register('billto');

       tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

       $billto = tep_db_insert_id();

       if (tep_session_is_registered('payment')) tep_session_unregister('payment');

       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
     }
// process the selected billing destination
   } elseif (isset($HTTP_POST_VARS['address'])) {
     $reset_payment = false;
     if (tep_session_is_registered('billto')) {
       if ($billto != $HTTP_POST_VARS['address']) {
         if (tep_session_is_registered('payment')) {
           $reset_payment = true;
         }
       }
     } else {
       tep_session_register('billto');
     }

     $billto = $HTTP_POST_VARS['address'];

     $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "' and address_book_id = '" . $billto . "'");
     $check_address = tep_db_fetch_array($check_address_query);

     if ($check_address['total'] == '1') {
       if ($reset_payment == true) tep_session_unregister('payment');
       tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
     } else {
       tep_session_unregister('billto');
     }
// no addresses to select from - customer decided to keep the current assigned address
   } else {
     if (!tep_session_is_registered('billto')) tep_session_register('billto');
     $billto = $customer_default_address_id;

     tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
   }
 }

// if no billing destination address was selected, use their own address as default
 if (!tep_session_is_registered('billto')) {
   $billto = $customer_default_address_id;
 }

to

 if (!tep_session_is_registered('billto')) tep_session_register('billto');

       tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array);

       $billto = tep_db_insert_id();
//fast easy checkout comment out next line
    //   if (tep_session_is_registered('payment')) tep_session_unregister('payment');


//fast easy checkout comment out next line
      // tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

//fast easy checkout add next 5 lines
if (!tep_session_is_registered('registered_now')) {  tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));  
} else {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
    }
     }
// process the selected billing destination
   } elseif (isset($HTTP_POST_VARS['address'])) {
     $reset_payment = false;
     if (tep_session_is_registered('billto')) {
       if ($billto != $HTTP_POST_VARS['address']) {
         if (tep_session_is_registered('payment')) {
           $reset_payment = true;
         }
       }
     } else {
       tep_session_register('billto');
     }

     $billto = $HTTP_POST_VARS['address'];

     $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $customer_id . "' and address_book_id = '" . $billto . "'");
     $check_address = tep_db_fetch_array($check_address_query);

     if ($check_address['total'] == '1') {

//fast easy checkout comment out next line
    //   if ($reset_payment == true) tep_session_unregister('payment');
//fast easy checkout comment out next line
      // tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

//fast easy checkout add next 5 lines
if (!tep_session_is_registered('registered_now')) {  tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));  
} else {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
    }
     } else {
       tep_session_unregister('billto');
     }
// no addresses to select from - customer decided to keep the current assigned address
   } else {

     if (!tep_session_is_registered('billto')) tep_session_register('billto');
     $billto = $customer_default_address_id;


//fast easy checkout comment out next line
   // tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));


//fast easy checkout add next 5 lines
if (!tep_session_is_registered('registered_now')) {

 tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));  
} else {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
    }
   }
 }

// if no billing destination address was selected, use their own address as default
 if (!tep_session_is_registered('billto')) {
   $billto = $customer_default_address_id;
 }

you must also make the same changes to checkout_shipping_address.php

unfortunatly when i was making the instruction file i started from a modified version that i was making for my own site

my apologizes.

this changes are made to simply redirect to correct file if customer edit his billing or shipping address

i tried to make all changes commented so you can follow

Edited by nana
Link to comment
Share on other sites

Thanks Frank,

 

I'm trying to get this working with the latest version of Paypal Shopping Cart IPN so I may be back with more questions but I hope it will go smoothly. I'm making all the changes by hand, hence the question on the instalation instructions! Greg includes a suggested file to make his Paypal module compatible with the PWA contribution. I'm going to try using that.

Link to comment
Share on other sites

Hi. After installing fast easy checkout, I'm getting this error at password_forgotten.php:

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '=='Y'' at line 1

select customers_firstname, customers_lastname, customers_password, customers_id from customers where customers_email_address = '[email protected]' AND createaccount=='Y'

[TEP STOP]

 

Also, how do I add a field for State in the billing information area on create_account3.php?

 

Thanks!

Link to comment
Share on other sites

OTTO try changing

select customers_firstname, customers_lastname, customers_password, customers_id from customers where customers_email_address = '[email protected]' AND createaccount=='Y'

to

select customers_firstname, customers_lastname, customers_password, customers_id from customers where customers_email_address = '[email protected]' AND createaccount!='N'

i changed the file but seems to miss the instruction sorry this is my first contribution and i have to change from my highly modified site so i am making a few mistakes :blush:

as far as the state in the billing i will look into it and will post the code tommorrow

i guess i have to redo the instruction.

Link to comment
Share on other sites

I'm not sure if I have installed this correctly. Whenever I checkout without accout I find there are two problems.

 

Firstly, the existing customer login box contains an email as possibly a password.

 

Secondly, when I clear that information and continue to pay without account I get asked whether I would like to change the stored password.

 

Is this the expected behaviour for a non-logged-in user? It seems rather insecure.

Edited by radders
Link to comment
Share on other sites

Actually it turned out to be a saved password in Firefox. Not sure how that got in there but sorry for the false alarm!

 

David

A word of advice which should give you a lot less hassle.

This cart is primarily geared towards the IE browser, especially the admin section.

So when doing admin work just stick to IE. Nothing wrong with checking the Client side with other browsers but remeber if having a problem and your using another browser other than IE always go back to IE and check performances etc there first.

 

Cheers

John

Link to comment
Share on other sites

Hi John,

Yes well that will have to wait until the security holes have been plugged more effectively I'm afriad. Actually though I find that the cart is better geared to Firefox than it is to I.E. But sometimes I can borrow my daughter's old computer when testing for backwards compatibility :-)

 

Frank,

One thing I notice on this contribution using checkout1 is that although a password is asked for when creating an account it doesn't insist so that you can create an account without a password, try and change it through the 'My account' link and get told that the password must have at least n characters.

 

What is the idea behind this blank password feature?

 

Should we not be asking for a password at all or should we be insisting that it is more than n characters long?

 

I confirmed that your test site works this way too :-)

Link to comment
Share on other sites

if you choose to create an account it should insist on it. i made a mistake when i made the changes to move the password to language files easy solution

around line 61

if($password==''){
$password=TEMP_PASSWORD;
$confirmation=TEMP_PASSWORD;}

should be removed and placed after

   if ($error == false) {

in line 201 right before the sql function

Link to comment
Share on other sites

OTTO try changing
select customers_firstname, customers_lastname, customers_password, customers_id from customers where customers_email_address = '[email protected]' AND createaccount=='Y'

to

select customers_firstname, customers_lastname, customers_password, customers_id from customers where customers_email_address = '[email protected]' AND createaccount!='N'

i changed the file but seems to miss the instruction sorry this is my first contribution and i have to change from my highly modified site so i am making a few mistakes :blush:

as far as the state in the billing i will look into it and will post the code tommorrow

i guess i have to redo the instruction.

 

Ok. I will try that. Thanks for looking into the state in the billing.

Link to comment
Share on other sites

Wow, thanks Frank!

 

So create_account.php then has a section that goes like this:

 

    if ($error == false) {
  	 if($password==''){
       $password=TEMP_PASSWORD;
       $confirmation=TEMP_PASSWORD;}
     $sql_data_array =

......................

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...