Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Purchase without account for 2.3.4 and BS2334


chrispopp8

Recommended Posts

This is in regards to http://addons.oscommerce.com/info/9142

 

Under Modules -> Orders, I have the following:

  • "Login without Account Form" which is marked as FALSE for enabled. 
  • "Login Form" which is marked as FALSE for enabled.
  • "Create Account Link" which is marked as FALSE for enabled.

When I click on Checkout in my store, I am taken to /login.php where I see "Welcome, Please Sign In" and there's no button to continue and no boxes to fill out. 

 

So I go to "Login without Account Form" in Modules -> Orders and mark it as TRUE.

 

I now get the following on /login.php:

 

Purchase without account

Your introduction text....Change in includes/languages/english/modules/content/login/cm_pwa_login.php

 

and now I have a Continue button.. which takes me to account_pwa.php which asks me for my personal data. 

What I want to do is allow the customer to buy as a guest (hence "Purchase Without Account") but it looks like you have to have an account this way. I'm baffled. (and I did all steps in the instructions text file including the Optional (thankfully I saw that step 2.4 was after the Optional information but it looks like it's part of Optional so it's easily skipable).

 

Shouldn't my customers be able to go from Cart to Checkout without creating an account using this Add-On?

 

 

 

Link to comment
Share on other sites

Hi
 
PWA does not mean not to raise any data of your customers, but that no account is created and the personal data will be deleted after processing the order. PWA or not PWA - what you always need is some data to communicate with your customers (email) and to send them the sold items (address). What other data else you want to know from your customer is up to you to decide: Go to admin => configuration => customer details and set all the customers details to false which you don't want to ask. The telephone number you can directly deactivate in admin => modules => content => login without account form. Then only name, address and email remain on account_pwa.php to enter.
 
=> Purchase without account
Your introduction text....Change in includes/languages/english/modules/content/login/cm_pwa_login.php

My god, how do I make it actually more foolproof? Open catalog/includes/languages/english/modules/content/login/cm_pwa_login.php and enter the your text to read on the login page for the module!
 
By the way: If you are not happy with PWA you can give Better Checkout by mattjt83 a try - demo here. It's a very fine solution, but you have to pay for it.

 

J.J.

Link to comment
Share on other sites

  • 1 month later...

Hi

 

PWA does not mean not to raise any data of your customers, but that no account is created and the personal data will be deleted after processing the order. PWA or not PWA - what you always need is some data to communicate with your customers (email) and to send them the sold items (address). What other data else you want to know from your customer is up to you to decide: Go to admin => configuration => customer details and set all the customers details to false which you don't want to ask. The telephone number you can directly deactivate in admin => modules => content => login without account form. Then only name, address and email remain on account_pwa.php to enter.

 

=> Purchase without account

Your introduction text....Change in includes/languages/english/modules/content/login/cm_pwa_login.php

 

My god, how do I make it actually more foolproof? Open catalog/includes/languages/english/modules/content/login/cm_pwa_login.php and enter the your text to read on the login page for the module!

 

By the way: If you are not happy with PWA you can give Better Checkout by mattjt83 a try - demo here. It's a very fine solution, but you have to pay for it.

 

J.J.

how similar is your purchase without account compared with Better checkout?

Link to comment
Share on other sites

how similar is your purchase without account compared with Better checkout?

I have used both products. Both work very well, and I have received fantastic support from both developers.

 

In my last conversation with Matt (the developer of Better Checkout), he said that he had not finished updating Better Checkout for osC 234, specifically the Content Modules (account and login). He may have finished updating it since then, though.

 

Malcolm

Link to comment
Share on other sites

I have used both products. Both work very well, and I have received fantastic support from both developers.

 

In my last conversation with Matt (the developer of Better Checkout), he said that he had not finished updating Better Checkout for osC 234, specifically the Content Modules (account and login). He may have finished updating it since then, though.

 

Malcolm

 

Cool

thanks

 

I really like Better Checkout, thats exactly the type of checkout which i require. Looks brilliant.

Link to comment
Share on other sites

  • 4 months later...

Hi,

I have tried to install this three times now and I don't know what I'm doing wrong.  Followed the instructions.  The options for activating 'Login without Account Form' does not show up in the admin content module section. 

And when I click on the "Orders" link, this error message is there.
 

1054 - Unknown column 'o.customers_guest' in 'field list'

select o.orders_id, o.customers_name, o.customers_guest, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by o.orders_id DESC limit 0, 20

 

Seems I need modify the database?  There's nothing in the instructions for that. 

I used the 21 Sep 2014 version.  I installed it on a fresh install of oscommerce 2.3.4 downloaded from the oscommerce site. 

I've looked over what I did over and over and it looks like all the files are there and the correct edits have been made. 

Any ideas?

Edited by element3
Link to comment
Share on other sites

@@element3

 

Hi Bruce

 

Just out of curiosity I quickly installed this PWA Addon into a fresh osC 2.3.4 shop. I placed an order and went to the admin area and clicked on the "Orders" link. No problems here.

I checked my database and the field customers_guest is there. I guess that gets installed automatically when placing an order.

Did you miss a step during the install? You better re-check the "optional part" of the install manual.

Oh, and you should install the version from 16 Oct. since that includes a bug-fix.

Edited by Tsimi
Link to comment
Share on other sites

@@De Dokta

 

Hi J.J.

 

I was just installing this into my BS shop when I saw this piece of code here.

  if(!tep_session_is_registered('customer_is_guest')) {         
   $email_order .=              EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n";
  }

that piece makes not much sense since a guest has no order history or account right?

Link to comment
Share on other sites

@@De Dokta

 

Hi J.J.

 

I was just installing this into my BS shop when I saw this piece of code here.

  if(!tep_session_is_registered('customer_is_guest')) {         
   $email_order .=              EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n";
  }

that piece makes not much sense since a guest has no order history or account right?

@@Tsimi

 

Hi Lambros

 

Read the code!

if(!tep_session_is_registered('customer_is_guest'))  means: if NOT a session "customer_is_guest" is registered - no? A guest get no link to an order history, a regular customer get one........

 

J.J.

Edited by De Dokta
Link to comment
Share on other sites

@@De Dokta

 

How "should" this PWA behave when paying with PayPal?

 

I think I have now everything correctly installed and it works fine with Bank transfer or COD payment methods.

But when using PayPal Standard I click on "checkout with out account", enter all data as always, then I get redirected to the PayPal payment site, complete the payment and get redirected back to the shop.

Now in my shop it shows the "Log Off" link which should not be because if I am a guest then I am not "logged in", right? Anyway looking at the admin area, there too the orders.php doesn't show a green check mark for that PayPal order.

So it is an order with an account. Looking at the customers area I can see a new account with all the data from the PayPal checkout process.

So in short, when I select PayPal to pay it creates and account even though I chose to checkout as guest.

 

Can you tell me what went wrong? Or is this the normal behaviour when using PayPal as payment method?

 

Danke.

Link to comment
Share on other sites

Tsimi,

Thanks for chiming in. 

I just did the whole thing "all over again."  For the fourth time.  Very carefully did every step.  Used the Oct. FIX version.  Got the exact same results.  Nothing shows up in my Content Module section to activate and I'm getting that same error on the Order section again.  Have no idea why the "Login without Account Form" isn't showing up in the Content Module.  Very, very frustrating.

Link to comment
Share on other sites

Tsimi,
 

I just tried something else.  I left out the optional part of the orders.php and now I'm not getting the error anymore on the Orders page.  Still no option for activating the module in the Content section.

Link to comment
Share on other sites

Just found out another error on the orders.php.  I just tried to update the status of a test order and got this error, again looking for the guest field.

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

select customers_name, customers_guest, customers_email_address, orders_status, date_purchased from orders where orders_id = '1'

[TEP STOP]

 

I'm thinking that guest field is created when the module is activated?  If I can just get that darn thing to show up so I can turn it on . . .

Edited by element3
Link to comment
Share on other sites

Duh. 

I just figured out the problem.  Rookie mistake.

I didn't notice there's a link at the top right of the Content Modules page for "install module."  I thought it was just supposed to have showed up in the list.

Anywho, I clicked on the install link and the pwa module was in that list.  I installed it and it's all working just fine now.

Link to comment
Share on other sites

  • 5 weeks later...

Well, I tested an order today using the guest account fearture and got the following error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/******/public_html/******/includes/languages/english/checkout_process.php on line 25.

I looked at line 25 and it's a blank line.  Right after line 25 is:

// if no shipping method has been selected, redirect the customer to the shipping method selection page
  if (!tep_session_is_registered('shipping') || !tep_session_is_registered('sendto')) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
  }

  if ( (tep_not_null(MODULE_PAYMENT_INSTALLED)) && (!tep_session_is_registered('payment')) ) {
    tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));
 }

// avoid hack attempts during the checkout procedure by checking the internal cartID
  if (isset($cart->cartID) && tep_session_is_registered('cartID')) {
    if ($cart->cartID != $cartID) {
      tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
    }
  }

  include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_PROCESS);

 

Any ideas as to why I'm getting this error?

Link to comment
Share on other sites

@@element3

 

You were searching in the wrong file for reason for this error. Your code snippets are from catalog/checkout_process, while the error message tells you that there's a mistake in catalog/includes/languages/english/checkout_process.php. There you should find something like:

define('EMAIL_WARNING', 'NOTE: This email address has been submitted by a visitor to our online-shop. If you were not this visitor, please send a message to:  ' . STORE_OWNER_EMAIL_ADDRESS . 'Thank you for your purchase and have a nice day.');

 

J.J.
 

Link to comment
Share on other sites

@@De Dokta

 

What would it take to ..

 

When the Guest is entering their information into account_pwa.php , to have it check to see if the guest's email address is already entered in the database?

 

Possible scenarios :

 

* a guest has returned to make another purchase. (will show up in the orders table)

 

* a registered guest has forgotten that they have an account, and is using the guest checkout (will show up in the customers table)

 

Malcolm

Link to comment
Share on other sites

@@ArtcoInc

 

Hi Malcolm

 

Yes I know that the email validation is a problem: Originally I had it completly taken out from account_pwa.php. Then I got a mail where someone complained, that when a customer logs in as a guest, but does not complete the checkout process (so the data are not deleted), and later wants to register as a customer, an error message comes that the email already exists.

So I put back the email validation. Now the same problem appears if a guest leaves before the checkout process is completed: If he comes back later again and wants again to purchase as a guest he gets the same error message that the email already exists.

I have thought to build in a routine which checks the DB regularly for guest entries older than e.g. 24 hours and deletes them automatically.
It's not that complicated, but at the moment I just don't have time, to do this and especially to test thoroughly.
 
J.J.
Link to comment
Share on other sites

@@De Dokta Thanks your addon work!

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

@@De Dokta

 

Yes, thank you for *all* of your work!

 

I have been trying to mod up checkout_success_pwa.php to include a 'one last time' chance for the guest to create an account. It adds a block of text, two password entry fields, and two buttons: 'Register' and 'Decline'.

 

If the guest declines, their account is deleted per the stock code. If the guest chooses to register, the account is kept, and the account and the order are flagged as 'not' a guest. The problem I am having now is to get the newly entered password into the new customer's account.

 

Once I figure out how to save the password, I'll look into password error checking (too short, password does not match confirmation, etc). And somewhere along the line, I think it should check to see if the new email address is already in a customer's profile.

 

I'm still working on this. In case anyone else is interested, here's what I have so far ... (still very rough test code)

<?php
/*
  $Id$

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

  Copyright (c) 2014 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');
  $action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

  $error = false;


  switch ($action) {
    case 'create':

      $customer_id = $HTTP_GET_VARS['cID'];
      $customers_password = tep_encrypt_password($password);

      tep_db_query("update " . TABLE_ORDERS . " set customers_guest = '0' where customers_id = '" . (int)$customer_id . "'");
      tep_db_query("update " . TABLE_CUSTOMERS . " set customers_guest = '0' where customers_id = '" . (int)$customer_id .

"'");


      tep_db_query("update " . TABLE_CUSTOMERS . " set customers_password = '" . $customers_password . "' where customers_id

= '" . (int)$customer_id . "'");

      tep_redirect(tep_href_link(FILENAME_DEFAULT));

    break;



    case 'decline':
      $customer_id = $HTTP_GET_VARS['cID'];
      tep_db_query("update " . TABLE_ORDERS . " set customers_guest = '1' where customers_id = '" . (int)$customer_id . "'");

      tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . (int)$customer_id . "' and customers_guest

= '1'");

      tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "'");
      tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'");

      tep_session_unregister('customer_default_address_id');
      tep_session_unregister('customer_first_name');
      tep_session_unregister('customer_country_id');
      tep_session_unregister('customer_zone_id');
      tep_session_unregister('customer_is_guest');

      tep_redirect(tep_href_link(FILENAME_DEFAULT));
    break;

  }



// if the customer is not logged on, redirect to start page
  if (!tep_session_is_registered('customer_id')) {
    tep_redirect(tep_href_link(FILENAME_DEFAULT));
  }

  require(DIR_WS_LANGUAGES . $language . '/' . 'checkout_pwa.php');

  $breadcrumb->add(NAVBAR_TITLE_1);
  $breadcrumb->add(NAVBAR_TITLE_2);

  $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . "
                                where customers_id = '" . (int)$customer_id . "'
                                order by date_purchased desc limit 1");

  $orders = tep_db_fetch_array($orders_query);

  $products_array = array();
  $products_query = tep_db_query("select products_id,
                                         products_name,
                                         products_quantity
                                  from " . TABLE_ORDERS_PRODUCTS . "
                                  where orders_id = '" . (int)$orders['orders_id'] . "'
                                  order by products_name");

  while ($products = tep_db_fetch_array($products_query)) {
    $products_array[] = array('id' => $products['products_id'],
                              'text' => $products['products_name'],
                              'qty' => $products['products_quantity']);
  }

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


  <div class="page-header">
    <h1><?php echo HEADING_TITLE; ?></h1>
  </div>


  <div class="contentContainer">
    <div class="contentText">
      <div class="alert alert-success">
        <?php echo TEXT_SUCCESS; ?>
      </div>
    </div>

    <div class="contentText">
      <div class="form-group">
        <label class="control-label-null col-xs-4"><br />
          <?php echo ITEMS; ?>
        </label>

        <div class="col-xs-8"><br />

<?php
          $products_displayed = array();
          echo '<table>';

          for ($i=0, $n=sizeof($products_array); $i<$n; $i++) {
            echo '<tr>';
            if (!in_array($products_array[$i]['id'], $products_displayed)) {

              echo '<td>';
              echo    $products_array[$i]['qty'] . 'x';
              echo '</td>';

              echo '<td>';
              echo '    ';
              echo '</td>';

              echo '<td>';
              echo    $products_array[$i]['text'];
              echo '</td>';

            }
            echo '</tr>';
          }
          echo '</table>';

?>

        </div>

      </div>
    </div>

    <div class="clearfix"></div>
    <br />



<?php
    if (tep_session_is_registered('customer_is_guest')) {
?>

      <div class="contentText">
        <div>
          <?php echo TEXT_ASK_TO_REGISTER; ?>
        </div>
      </div>


<?php

      $password = tep_db_prepare_input($HTTP_POST_VARS['password']);

      if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {
        $error = true;

        $messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
      } elseif ($password != $confirmation) {
        $error = true;

        $messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
      }

?>

      <div class="contentText">
        <div class="form-group has-feedback">
          <label for="inputPassword" class="control-label col-xs-3">
            <?php echo ENTRY_PASSWORD; ?>
          </label>
          <div class="col-xs-9">

<?php
            echo tep_draw_password_field('password', NULL, 'required aria-required="true" id="inputPassword" placeholder="' .

ENTRY_PASSWORD . '"');
//        echo FORM_REQUIRED_INPUT;
            if (tep_not_null(ENTRY_PASSWORD_TEXT)) echo '<span class="help-block">' . ENTRY_PASSWORD_TEXT . '</span>';
?>

          </div>
        </div>

        <div class="form-group has-feedback">
          <label for="inputConfirmation" class="control-label col-xs-3">
            <?php echo ENTRY_PASSWORD_CONFIRMATION; ?>
          </label>
          <div class="col-xs-9">

<?php
            echo tep_draw_password_field('confirmation', NULL, 'required aria-required="true" id="inputConfirmation"

placeholder="' . ENTRY_PASSWORD_CONFIRMATION . '"');
//        echo FORM_REQUIRED_INPUT;
            if (tep_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT)) echo '<span class="help-block">' .

ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>';
?>

          </div>
        </div>
      </div>

      <BR /><BR /><BR /><BR />

      <div class="contentText">
        <div class="buttonSet">
          <span class="pull-left">
            <?php echo '<a href="' . tep_href_link('checkout_success_pwa.php', tep_get_all_get_params(array('cID', 'action'))

. 'cID=' . $customer_id . '&action=create') . '">' . tep_draw_button('Create Account', 'glyphicon-pencil', NULL, 'primary',

NULL, 'btn-success') . '</a>'; ?>
          </span>


          <span class="pull-right">
            <?php echo '<a href="' . tep_href_link('checkout_success_pwa.php', tep_get_all_get_params(array('cID', 'action'))

. 'cID=' . $customer_id . '&action=decline') . '">' . tep_draw_right_button('No thank you', 'glyphicon-chevron-right', NULL,

'primary', NULL, 'btn-default') . '</a>'; ?>
          </span>

        </div>
      </div>


      <br /><br />

<?php


      
    } else {   // if (tep_session_is_registered('customer_is_guest')) {

?>

      <div class="contentText">
        <div class="alert alert-info">
          <?php echo TEXT_THANKS_FOR_SHOPPING; ?>
        </div>
      </div>


<?php
    } // if (tep_session_is_registered('customer_is_guest')) {
?>



<?php

    if (DOWNLOAD_ENABLED == 'true') {
      include(DIR_WS_MODULES . 'downloads.php');
    } else {
      tep_session_unregister('customer_id');
    }
?>

  </div>


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

And the file: catalog/includes/languages/english/checkout_pwa.php

<?php
/*
  $Id$

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

  Copyright (c) 2014 osCommerce
  Released under the GNU General Public License
*/

define('NAVBAR_TITLE_1', 'Checkout');
define('NAVBAR_TITLE_2', 'Success');
define('NAVBAR_TITLE_3', 'Personal Details');
define('HEADING_TITLE', 'Guest Checkout');
define('TITLE_PLEASE_SELECT', 'Please select: ');
define('TEXT_ORIGIN_LOGIN', '<font color="#FF0000"><small><strong>NOTE:</strong></small></font> If you already have an account with us, please login at the <a href="%s"><u>login page</u></a>.');
define('TEXT_SUCCESS', 'Your order has been successfully entered, and will be shipped as soon as possible!');
define('ITEMS', 'Items purchased: ');
define('TEXT_THANKS_FOR_SHOPPING', 'Thanks for shopping with us online!');

define('TEXT1', 'Even though you a Guest, we still need to know where to ship your order.');

define('TEXT_ASK_TO_REGISTER', 'Thank you for shopping with us. You still have one last opportunity to create an account with us. Doing so, you will be able to shop faster, stay up-to-date on the status of this order, and keep track of previous orders. All we need is for you to enter a password to create your new account.');

?>

Malcolm

Link to comment
Share on other sites

To make sure that a guest is not using an email address that is already registered to a customer, in:  account_pwa.php

 

 

Find:

    if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
      $error = true;
      $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);

    } elseif (tep_validate_email($email_address) == false) {

      $error = true;
      $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }

Replace with:

    if (strlen($email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
      $error = true;
      $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR);

    } elseif (tep_validate_email($email_address) == false) {

      $error = true;
      $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);

    } else {
      $check_email_query = tep_db_query("select count(*) as total from " . TABLE_CUSTOMERS . " where customers_email_address

= '" . tep_db_input($email_address) . "'");
      $check_email = tep_db_fetch_array($check_email_query);
      if ($check_email['total'] > 0) {
        $error = true;

        $messageStack->add('create_account', ENTRY_EMAIL_ADDRESS_ERROR_EXISTS_GUEST);
      }
    }

To use an error message specific to this error, add the following definition to: /includes/english/english.php

define('ENTRY_EMAIL_ADDRESS_ERROR_EXISTS_GUEST', 'The E-Mail Address you are using is already registered to an existing customer. If this is not you, you may continue to check out as a guest, but you must use another email address. Otherwise, please log into your account with this e-mail address. If you do not remember your password, we can send you a new temporary password.');

HTH

 

Malcolm

Link to comment
Share on other sites

  • 2 weeks later...

Hi Malcolm

 

what is that? I am not able to se anything like that in the header tags module:

 

To activate the datepicker on the page, go to Admin -> Modules -> Header Tags, choose the entry Datepicker JQuery and click Edit. In the file list choose account_pwa.php and click Save.

 

Another question:

 

I am selling downloadable software, is it possible to only require:

 

  1. name
  2. email

and leave the rest as an option for the costumer?

 

kind regards

 

Kurt K

 

 

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...