Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

fast easy checkout


nana

Recommended Posts

//fast easy checkout start
$check_status_query = tep_db_query("select customers_name, ,customers_id, createaccount from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$cID . "'");
$check_status = tep_db_fetch_array($check_status_query);

//fast easy checkout end

..and to post it

Created Account: <?php echo $check_status['createaccount']; ?>

 

 

havent tested at all but i think it should work any where that cID is available it is customers_id

Link to comment
Share on other sites

  • Replies 1.7k
  • Created
  • Last Reply

Top Posters In This Topic

i have:

//fast easy checkout start
$check_status_query = tep_db_query("select customers_name, customers_company, customers_email_address, customers_id, orders_status, date_purchased, ipaddy, ipisp, customers_referer_url, createaccount from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
	$check_status = tep_db_fetch_array($check_status_query);
	 $cust_id = $check_status['customers_id'];
//fast easy checkout end

 

&

<?php echo $check_status['createaccount']; ?>

 

nothing shows :(

 

and when i try to update:

1054 - Unknown column 'createaccount' in 'field list'

 

select customers_name, customers_company, customers_email_address, customers_id, orders_status, date_purchased, ipaddy, ipisp, customers_referer_url, createaccount from orders where orders_id = '61273'

 

[TEP STOP]

Link to comment
Share on other sites

first i have changed the code a little

?

 

make sure cID is available or use $customers_id instead if available or you have to get it

how do i know if it's available or not?

Link to comment
Share on other sites

Hi,

 

In checkout_account3.php I have same problem akmac in post 809 had when no account creation was selected by user- yet application still needs password -error message was a popup with :

"password must contain 5 characters etc"

 

I see that he got the issue resolved but I was unable to find the solution in the thread.

 

I did download and install the latest contribution for hiding the password. I updated checkout_account3.php, account_box.php and form_check.js.php. Check out with account works great. So the problem is only when an account is not created.

 

It sound's like the problem is in form_check.js.php. Here is what I have: (test site is: roominakit.com/home-decor-shop/index.php

 

Thanks for your help.

 

Dee

 

<?php
/*
 $Id: form_check.js.php,v 1.9 2003/05/19 19:50:14 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<script language="javascript"><!--
var form = "";
var submitted = false;
var error = false;
var error_message = "";

function check_input(field_name, field_size, message) {
 if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
var field_value = form.elements[field_name].value;

if (field_value == '' || field_value.length < field_size) {
  error_message = error_message + "* " + message + "\n";
  error = true;
}
 }
}

function check_radio(field_name, message) {
 var isChecked = false;

 if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
var radio = form.elements[field_name];

for (var i=0; i<radio.length; i++) {
  if (radio[i].checked == true) {
	isChecked = true;
	break;
  }
}

if (isChecked == false) {
  error_message = error_message + "* " + message + "\n";
  error = true;
}
 }
}

function check_select(field_name, field_default, message) {
 if (form.elements[field_name] && (form.elements[field_name].type != "hidden")) {
var field_value = form.elements[field_name].value;

if (field_value == field_default) {
  error_message = error_message + "* " + message + "\n";
  error = true;
}
 }
}

function check_password(field_name_1, field_name_2, field_size, message_1, message_2) {
 if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
var password = form.elements[field_name_1].value;
var confirmation = form.elements[field_name_2].value;

if (password == '' || password.length < field_size) {
  error_message = error_message + "* " + message_1 + "\n";
  error = true;
} else if (password != confirmation) {
  error_message = error_message + "* " + message_2 + "\n";
  error = true;
}
 }
}

function check_password_new(field_name_1, field_name_2, field_name_3, field_size, message_1, message_2, message_3) {
 if (form.elements[field_name_1] && (form.elements[field_name_1].type != "hidden")) {
var password_current = form.elements[field_name_1].value;
var password_new = form.elements[field_name_2].value;
var password_confirmation = form.elements[field_name_3].value;

if (password_current == '' || password_current.length < field_size) {
  error_message = error_message + "* " + message_1 + "\n";
  error = true;
} else if (password_new == '' || password_new.length < field_size) {
  error_message = error_message + "* " + message_2 + "\n";
  error = true;
} else if (password_new != password_confirmation) {
  error_message = error_message + "* " + message_3 + "\n";
  error = true;
}
 }
}

function check_form(form_name) {
 if (submitted == true) {
alert("<?php echo JS_ERROR_SUBMITTED; ?>");
return false;
 }

 error = false;
 form = form_name;
 error_message = "<?php echo JS_ERROR; ?>";

<?php if (ACCOUNT_GENDER == 'true') echo '  check_radio("gender", "' . ENTRY_GENDER_ERROR . '");' . "\n"; ?>

 check_input("firstname", <?php echo ENTRY_FIRST_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_FIRST_NAME_ERROR; ?>");
 check_input("lastname", <?php echo ENTRY_LAST_NAME_MIN_LENGTH; ?>, "<?php echo ENTRY_LAST_NAME_ERROR; ?>");

<?php if (ACCOUNT_DOB == 'true') echo '  check_input("dob", ' . ENTRY_DOB_MIN_LENGTH . ', "' . ENTRY_DATE_OF_BIRTH_ERROR . '");' . "\n"; ?>

 check_input("email_address", <?php echo ENTRY_EMAIL_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_EMAIL_ADDRESS_ERROR; ?>");
 check_input("street_address", <?php echo ENTRY_STREET_ADDRESS_MIN_LENGTH; ?>, "<?php echo ENTRY_STREET_ADDRESS_ERROR; ?>");
 check_input("postcode", <?php echo ENTRY_POSTCODE_MIN_LENGTH; ?>, "<?php echo ENTRY_POST_CODE_ERROR; ?>");
 check_input("city", <?php echo ENTRY_CITY_MIN_LENGTH; ?>, "<?php echo ENTRY_CITY_ERROR; ?>");

<?php if (ACCOUNT_STATE == 'true') echo '  check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '");' . "\n"; ?>

 check_select("country", "", "<?php echo ENTRY_COUNTRY_ERROR; ?>");

 check_input("telephone", <?php echo ENTRY_TELEPHONE_MIN_LENGTH; ?>, "<?php echo ENTRY_TELEPHONE_NUMBER_ERROR; ?>");

 check_password("password", "confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_ERROR_NOT_MATCHING; ?>");
 check_password_new("password_current", "password_new", "password_confirmation", <?php echo ENTRY_PASSWORD_MIN_LENGTH; ?>, "<?php echo ENTRY_PASSWORD_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR; ?>", "<?php echo ENTRY_PASSWORD_NEW_ERROR_NOT_MATCHING; ?>");

 if (error == true) {
alert(error_message);
return false;
 } else {
submitted = true;
return true;
 }
}

//--></script>

<script type="text/javascript">
if (document.getElementById) onload = function () {
document.getElementById ('toggle').onclick = function () {document.getElementById ('lorem').className = this.checked ? 'show' : 'hide'}
document.getElementById ('lorem').className = 'hide'
}
</script>

<style type="text/css">
.hide {display:none}
.show {display:block}
</style>

Link to comment
Share on other sites

Frank,

 

I added a conditional check in form check file to test if account was created. Works now. Amazing what one can accomplish when they get some sleep:)

 

Again thanks for the contributions and your incredible support.

 

Dee

Link to comment
Share on other sites

i just checked the database, you're right. i just noticed i had accidentally had: <?php echo $order['createaccount']; ?> trying to display it.

 

i commented it out and tried nana's suggestion again. still nothing shows :(

Link to comment
Share on other sites

Hi,

 

I installed this file the other day, but one prob, it says one-off purchase under the Create an Account?, how would I change this to say one time purchase??

 

Thank you,

Michael

Michael

Link to comment
Share on other sites

eww from the top of my head you have to do you need two sql querries one from table orders for customers_id when orders_id is oID and second from table customers and use that value for customers_id

 

Michael

try includes/languages/english/fast_account.php

Link to comment
Share on other sites

Hi,

 

I installed this file the other day, but one prob, it says one-off purchase under the Create an Account?, how would I change this to say one time purchase??

 

Thank you,

Michael

edit:

catalog/includes/languages/english/fast_account.php

 

look for:

define('NO_ACCOUNT', 'No thanks, this is a one-off purchase.');

 

and change

define('NO_ACCOUNT', 'whatever you want here');

Link to comment
Share on other sites

Great Contrib, although I may have a bug.

 

When creating an account, with no cookies. When you press the continue button after filling in details about your account your passed to the login page, logging in just brings you back to the create account page. I think this only happens if user does not allow cookies.

 

rgds

Paul

Link to comment
Share on other sites

eww from the top of my head you have to do you need two sql querries one from table orders for customers_id when orders_id is oID and second from table customers and use that value for customers_id

how would i be able to do that?

Link to comment
Share on other sites

Hi, Eww,

 

You login to PhPMyAdmin, in CPanel (I dont know about the other control panels, just that one (b/c I have used it all my life.)) its called MySQL Databases go down to the bottom of the page & click PhPMyAdmin, then when the next screen comes up, select your db from the drop down & then at the top where it says SQL click that, & put in the sql code.

 

Thank you,

Michael

Michael

Link to comment
Share on other sites

Hi, Eww Again,

 

I found this in a file, I am going to be running, this may help you Eww.

 

SSH up to your server/site, using putty.

 

cd /tmp

mysql -u USER -p OSCOMMERCE_DATABASE < ./WHAT_EVER_FILE_YOUR_SQL'ING.SQL

 

Thank you,

Michael

Edited by mrgtec

Michael

Link to comment
Share on other sites

Great Contrib, although I may have a bug.

 

When creating an account, with no cookies. When you press the continue button after filling in details about your account your passed to the login page, logging in just brings you back to the create account page. I think this only happens if user does not allow cookies.

 

rgds

Paul

I tested my shop in Firefox with cookies disabled, and could checkout whitout any problems.

 

I haven't merged checkout_shipping.php and checkout_payment.php though.

 

// Fredrik

Link to comment
Share on other sites

One more question - I'm trying to use fec and osCommerce paypal IPN v1.1.

It all works fine until the point I hit "back to merchant" on paypal. It brings me back to a login screen. When I log in, it takes me to the page right before I place the order. The order shows up in my order history as placed, but all the items are still in my shopping cart. Help!

I'm currently going to the paypal sandbox, so I can put in dummy transactions until it's working right. I'm searching all IPN threads as well, but so far I'm not finding a solution to this problem.

Link to comment
Share on other sites

Hi, Eww,

 

You login to PhPMyAdmin, in CPanel (I dont know about the other control panels, just that one (b/c I have used it all my life.)) its called MySQL Databases go down to the bottom of the page & click PhPMyAdmin, then when the next screen comes up, select your db from the drop down & then at the top where it says SQL click that, & put in the sql code.

 

Thank you,

Michael

i'm not sure what you mean? i have already run the sql query from this contribution. the problem i'm having is i cannot pull the info from the database to post on admin/orders.php to tell me whether or not the customer has an account

Link to comment
Share on other sites

redrum,

In config set goto > sessions and set everything to false.

Then turn off your cookies and let me know what happens.

 

Basically i test everything on my xp laptop, and for some reason, i cannot carry the session id in a cookie on localhost, i have to pass the session ID in the URL to enable checking out etc. When on this setting, it gives the errors I explain above, however when i send up the entire shop to my live *nix server, it works fine.

Link to comment
Share on other sites

paul your problem most probably is from incorrect information in your configure.php

i do not use cookies myself and do not have a problem

 

eww try something like this to get the customer id before the block of code that you used before

and the other code to get the value of createaccount and then echo the value

 

$check_my_query = tep_db_query("select customers_name, customers_id, from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
$my_querry_result = tep_db_fetch_array($check_my_query);
$cID = $my_querry_result['customers_id'];

Edited by nana
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...