Jump to content
ArtcoInc

Purchase without account for 2.3.4 and BS2334

Recommended Posts

10 hours ago, raiwa said:

The fact that guest accounts are auto deleted on successful checkout is one of main features and it makes sense. It is just what customers using guest checkout like. Only the strictly required order data is kept stored.

So if a customer attempts a purchase using PWA and leaves before completing checkout, is this what I should be seeing? 

Admin > Customers

Is that the purpose of the Guest Checkmark?  Just to let me know that...this person backed out and left? 

guest.PNG.5636e183a8da6a92464f8060fc2518da.PNG

Regarding the other problems, I guess I need to do a full re-install of PWA.  There are 'optional' edits throughout that contribution that I skipped.  For example, I don't use Reviews in my website, so...no need to do those modifications, right?  I don't know what is wrong, but...I'll figure it out!

- Andrea

 

Share this post


Link to post
Share on other sites
1 hour ago, puggybelle said:

So if a customer attempts a purchase using PWA and leaves before completing checkout, is this what I should be seeing? 

Admin > Customers

Is that the purpose of the Guest Checkmark?  Just to let me know that...this person backed out and left? 

guest.PNG.5636e183a8da6a92464f8060fc2518da.PNG

 

YEs, or maybe using a external payment service like PayPal standard he didn't come back to your store after payment and the account didn't get auto deleted on checkout success page. So in these cases you can identify guest accounts and delete them yourself in admin if you wish.

Share this post


Link to post
Share on other sites

I uninstalled my version of Purchase Without Account...not entirely sure what it really was now...and installed the latest version, 3.0.5

The newest version is working beautifully for me.

I do a poor job of keeping track of what I install and what I change and I think that comes back to haunt me sooner or later.

Thank You, @raiwa, for your continued help and patience.  All is well again!

- Andrea

Share this post


Link to post
Share on other sites

Need help please.

I have installed the PWA for BS 3.0.5 and I am having some issues.

1. Within checkout_process.php on line  echo $OSCOM_Hooks->call('checkout_process', 'PwaCheckoutMailMod'); (I also tried with this version:   echo $OSCOM_Hooks->call('pwa', 'PwaCheckoutMailMod');) I am getting the following error
       Fatal error: Call to a member function call() on null in /home/.../public_html/checkout_process.php on line 261 
        After deleting that line got another error on line:
        tep_session_is_registered('customer_is_guest') ? tep_redirect(tep_href_link('checkout_success_pwa.php', '', 'SSL')) : tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
        which says checkout_success_pwa.php' file not found, and really that file is not within the new files list so after changing that line back to the original  tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL')); the orders goes through and is recorded into the database.

2. On checkout_success.php page, I do get the radio buttons generated by tpl_cm_cs_pwa_keep_account.php, asking  if the customer wants to Proceed to set a password.... or ,Thank You, I do not wish to keep my customer data stored... I select  Proceed to set a password, and hit Continue, which deletes the guest account and forwards to account.php page.

 

I would appreciate your feedback.

 

Share this post


Link to post
Share on other sites

Hello Ed @edo.script,

Point 1:

It looks like you tried to install/update PWA 3.0.5 over the old GOLD version from @De Dokta. It also seems you are mixing code provided from older PWA 2.x versions with PWA 3.0.5.

The code you mention under point 1 is not used any more in PWA 3.0.5.

Please complete uninstall your old PWA version before installing PWA 3.0.5, there are no update instructions available for that old version.

For the hook call in checkout_process.php:
$OSCOM_Hooks->call('pwa', 'PwaCheckoutMailMod');) . This is from an older PWA 2.x version. Please do not try to mix code from older version. Use only the coding provided in PWA 3.0.5.

PWA 3.0.5 is for 2.3.4.1 FROZEN BS which includes the hook call in application_top.php at the very end:

  $OSCOM_Hooks->register(basename($PHP_SELF, '.php'));

Only if you do not have this in application_top.php you need to add to checkout_process.php:

$OSCOM_Hooks->call('checkout_process', 'PwaCheckoutMailMod');

Observe that the "echo" you have in front is totally wrong.

 

Point 2:

Redo your installation like explained before. Make sure that you have the Header Tag module and the checkout_success content module correct installed.

Share this post


Link to post
Share on other sites
11 hours ago, raiwa said:

Hello Ed @edo.script,

Point 1:

It looks like you tried to install/update PWA 3.0.5 over the old GOLD version from @De Dokta. It also seems you are mixing code provided from older PWA 2.x versions with PWA 3.0.5.

The code you mention under point 1 is not used any more in PWA 3.0.5.

Please complete uninstall your old PWA version before installing PWA 3.0.5, there are no update instructions available for that old version.

For the hook call in checkout_process.php:
$OSCOM_Hooks->call('pwa', 'PwaCheckoutMailMod');) . This is from an older PWA 2.x version. Please do not try to mix code from older version. Use only the coding provided in PWA 3.0.5.

PWA 3.0.5 is for 2.3.4.1 FROZEN BS which includes the hook call in application_top.php at the very end:


  $OSCOM_Hooks->register(basename($PHP_SELF, '.php'));

Only if you do not have this in application_top.php you need to add to checkout_process.php:


$OSCOM_Hooks->call('checkout_process', 'PwaCheckoutMailMod');

Observe that the "echo" you have in front is totally wrong.

 

Point 2:

Redo your installation like explained before. Make sure that you have the Header Tag module and the checkout_success content module correct installed.

Thanks Rainer, for the detailed explanation. I will work on it and post the update here.

Share this post


Link to post
Share on other sites
On 5/17/2019 at 12:48 PM, edo.script said:

Thanks Rainer, for the detailed explanation. I will work on it and post the update here.

Hello Rainer,

I have removed the previous installation and I am reinstalling the PWA.

It looks like the PWA Guest Checkout Documentation (the Word document) may need to be updated.

Since I have massive changes to the original files I need to apply the PWA changes manually.
So I would appreciate if you can give me an update. I have downloaded from: https://apps.oscommerce.com/5f3nn&purchase-without-account-bs
the Purchase without account BS 3.0.5 dated: 24th February 2019

Thank you in advance.

Here is what's confusing, you mentioned that the hook call should be in application_top.php at the very end, however on page 4-5 of the instruction it reads:

2.1.b. checkout_process.php;
Find:
// lets start with the email confirmation
  $email_order = STORE_NAME . "\n" . 
                 EMAIL_SEPARATOR . "\n" . 
                 EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link('account_history_info.php', 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
  if ($order->info['comments']) {
    $email_order .= tep_db_output($order->info['comments']) . "\n\n";  }

Replace by:
// lets start with the email confirmation
  $email_order = STORE_NAME . "\n" . 
                 EMAIL_SEPARATOR . "\n" . 
                 EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                 EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link('account_history_info.php', 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                 EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
// PWA guest checkout
  echo $OSCOM_Hooks->call('pwa', 'PwaCheckoutMailMod');
  if ($order->info['comments']) {
    $email_order .= tep_db_output($order->info['comments']) . "\n\n";
  }

 

P.S. Meanwhile, within modified_files folder I don't see the application_top.php file.

Edited by edo.script
Adding to the content

Share this post


Link to post
Share on other sites

Hello @edo.script,

PWA series 3.x is intended for 2.3.4.1 BS CE FROZEN. All instructions, files and references are for this version only.

If your store version is a previous EDGE version, you need to know how hooks work and to be able to adapt the instructions/code references to your store.

Otherwise please use the last series 2 version ( Purchase without account BS 2.5r2 )

The most important difference in FROZEN is that hooks registry is done automatically in application_top.php. But you do not need to adit this file in any PWA version. Tht's whi it is not included in the package and there is no need for it.

If your store version is previous you need to add the hook registry manually like I posted befor to the page files where hooks are used.

The modification in the instructions are the hook call which is the second part you need to get the hook working.

Please understand that it is impossible to include accurate instructions for all BS CE versions which are out there. There are hundreds of them.

The latest versions of my add ons are all for FROZEN which is the recommended actual and stable version for users which are not skilled in coding.

 

Share this post


Link to post
Share on other sites

I'm using 2.341 frozen too and since 3 days ago my logoff button from the bottom has disappeared and it stays logged in the whole time. I didn't add any addons that day and didnt make any significant changes. Anyone has any idea? 

Share this post


Link to post
Share on other sites
13 hours ago, raiwa said:

Hello @edo.script,

PWA series 3.x is intended for 2.3.4.1 BS CE FROZEN. All instructions, files and references are for this version only.

If your store version is a previous EDGE version, you need to know how hooks work and to be able to adapt the instructions/code references to your store.

Otherwise please use the last series 2 version ( Purchase without account BS 2.5r2 )

The most important difference in FROZEN is that hooks registry is done automatically in application_top.php. But you do not need to adit this file in any PWA version. Tht's whi it is not included in the package and there is no need for it.

If your store version is previous you need to add the hook registry manually like I posted befor to the page files where hooks are used.

The modification in the instructions are the hook call which is the second part you need to get the hook working.

Please understand that it is impossible to include accurate instructions for all BS CE versions which are out there. There are hundreds of them.

The latest versions of my add ons are all for FROZEN which is the recommended actual and stable version for users which are not skilled in coding.

 

Thanks Rainer, that makes sense now. My version is 2.3.4.

Share this post


Link to post
Share on other sites
30 minutes ago, edo.script said:

Thanks Rainer, that makes sense now. My version is 2.3.4.

 

So I have done some small modifications, including commenting out the hook line (which frankly I'm not familiar with): echo $OSCOM_Hooks->call('checkout_process', 'PwaCheckoutMailMod') in checkout_process.php, and now everything seems to be working fine. Except if the customer clicks on Proceed to set a password option on checkout_success.php page the account gets deleted. I did some debugging and noticed that in ht_pwa.php the $messageStack->output('account') is blank. Therefore the following condition is not satisfied:

        if ( defined('MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_STATUS') && MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_STATUS == 'True' && 
             basename($PHP_SELF) == 'account.php' && strpos($messageStack->output('account'), 'alert-success') ) { 

and so the guest account is deleted here:

        } elseif ( basename($PHP_SELF) != 'download.php' && basename($PHP_SELF) != 'set_password.php' && substr(basename($PHP_SELF), 0, 😎 != 'checkout' ) {
          // else delete guest account
          $this->delete_guest_account();
        }


So my question: would it be a bad idea if I remove the strpos($messageStack->output('account'), 'alert-success') and modify the above condition?

Modifying from:

        if ( defined('MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_STATUS') && MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_STATUS == 'True' && 
             basename($PHP_SELF) == 'account.php' && strpos($messageStack->output('account'), 'alert-success') ) { 

to:

  if ( defined('MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_STATUS') && MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_STATUS == 'True' && 
             basename($PHP_SELF) == 'account.php' ) { 

 

And my second question or why does the $messageStack->output('account') return blank value?

Thank you in advance.

Share this post


Link to post
Share on other sites

Another minor modification that could be useful, or at least it is for me. If the guest decides to create an account then the guest key is removed from customer's account, however it is not removed from customer's order. So I have added a new line to do that in ht_pwa.php:

       if ( tep_session_is_registered('customer_is_guest') && isset($navigation->snapshot['page']) && $navigation->snapshot['page'] == 'checkout_success.php' ) {
        if ( defined('MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_STATUS') && MODULE_CONTENT_CHECKOUT_SUCCESS_PWA_KEEP_ACCOUNT_STATUS == 'True' && 
             basename($PHP_SELF) == 'account.php' ) { 
          // Unregister and remove guest from customers table if password is successful set
          tep_session_unregister('customer_is_guest');
          tep_db_query("update customers set customers_guest = '0' where customers_id = '" . (int)$customer_id . "'");
          tep_db_query("update orders set customers_guest = '0' where customers_id = '" . (int)$customer_id . "'");
 

Everything else looks good and work great.

Great module.

Thank you!

Edited by edo.script

Share this post


Link to post
Share on other sites
10 hours ago, edo.script said:

 

So I have done some small modifications, including commenting out the hook line (which frankly I'm not familiar with): echo $OSCOM_Hooks->call('checkout_process', 'PwaCheckoutMailMod') in checkout_process.php, and now everything seems to be working fine.

As I do not know which PWA version you are using, it's difficult to give exact advice. If you remove the hook call in checkout_procerss.php, the order confirmation e-mail will not be modified and still contain the link to the order in the customers account. This doesn't make sense for guest orders.

If you are using PWA 3 series, the hook call is that one you posted. For the 2.x series the hook call is different. Please use the version for your store and follow exactly the instructions.

Your other modifications are up to you. I'm sure that everything works correct in a correct installation for the correct version. Please consider that PWA is out since years and used in many shops. No one reported the problems you have until now.

It makes sense to keep the guest orders flagged even the customer opts in to create a regular account. Shop owners like to keep track on which orders have been made with gueat checkout. This modification is up to you.

Edited by raiwa

Share this post


Link to post
Share on other sites
12 hours ago, raiwa said:

As I do not know which PWA version you are using, it's difficult to give exact advice. If you remove the hook call in checkout_procerss.php, the order confirmation e-mail will not be modified and still contain the link to the order in the customers account. This doesn't make sense for guest orders.

If you are using PWA 3 series, the hook call is that one you posted. For the 2.x series the hook call is different. Please use the version for your store and follow exactly the instructions.

Your other modifications are up to you. I'm sure that everything works correct in a correct installation for the correct version. Please consider that PWA is out since years and used in many shops. No one reported the problems you have until now.

It makes sense to keep the guest orders flagged even the customer opts in to create a regular account. Shop owners like to keep track on which orders have been made with gueat checkout. This modification is up to you.

Thank you Rainer. I assume I need to look for the upgrade log and upgrade from 2.3.4 to 2.3.4.1 BS CE FROZEN and then do a clean installation of the latest PWA.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×