Jump to content
ArtcoInc

Purchase without account for 2.3.4 and BS2334

Recommended Posts

@vmn,

Quote

1. If a new guest account is created with the same email as an old one, the old guest is removed from customers and address_book tables, but not
from customers_info, customers_basket and customers_basket_attributes tables. In the latter tables the previous guest row remains and a row for the new guest is created.

I'll add this. Thank you!

Quote

2. I decided to add a remainder to always click "Continue" (this may help reducing zombies):

I won't do this. Guests are already encouraged to tick the radios for keep account or no and use the continue button. The text would just make them think that if they do not use the button their account will stay, against what is expected when using guest checkout. Anyway, the account is also auto deleted if they continue browsing. It is only not deleted when they immediately close the browser window. Even then, the store owner will see the account flagged as a guest account in Admin and can manually delete it.

There will be always someone who does not read anything and close the browser.

What I'll consider is to add a site wide admin hook which will check on index page load or customer page load if there a re guest accounts older than one day and auto dlete them.

EDIT: I just checked some real stores for remaining guest accounts:

1. store:  525 guest accounts of 7769 total accounts
2. store: 178guest accounts of 7150 total accounts
3. store: 2 guest accounts of 595 total accounts

I believe it's not a real problem.

Quote

 

3. I also decided to hide the account navbar block for guests, because it may be a bit confusing to them, e.g. there is no order history for them.

in includes/modules/navbar_modules/nb_account.php

I won't add an additional modification to a core module or add an alternative module. I would rather disable the account menu by javascript in the ht module.

Anyway all of this will be only added in the next Phoenix version. Development of the older BS3 versions is stopped.

Thanks for your suggestions
Rainer

Edited by raiwa

Share this post


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

I'll add this. Thank you!

You are welcome!

#2: The original text "Thank You, I do not wish to keep my customer data stored, please delete my customer data." is not strictly true, because at least order processing data remains.
I admit, guest accounts hanging around is not a big problem, especially after adding the missing deletes.

#3. Good point. I review the ht module.

Share this post


Link to post
Share on other sites

I could not figure out how to make the #3 change in the ht module. The account block has no id and my jquery knowledge is limited.

I keep my change. I'ts so simple. I've got another, too. I hide the create account link, if the shopping cart is empty. Actually, I hide create account links everywhere, if the cart is empty. This may prevent fake accounts.

Share this post


Link to post
Share on other sites
8 minutes ago, vmn said:

I could not figure out how to make the #3 change in the ht module. The account block has no id and my jquery knowledge is limited.

You can of course do in your store what you consider. I'll just relay on the goal to change as little as possible core files. I'll have a look and try it for the next update.

Quote

I keep my change. I'ts so simple. I've got another, too. I hide the create account link, if the shopping cart is empty. Actually, I hide create account links everywhere, if the cart is empty. This may prevent fake accounts.

That's unrelated to PWA

Edited by raiwa

Share this post


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

I'll just relay on the goal to change as little as possible core files.

Would it make sense to ship your own header tag module?  Then you aren't changing core files.  You're creating a new file and can use configuration to uninstall the core version and install yours.  Which is better in that updates to the core file won't affect you and your version will persist through core updates without change. 

The header tag module would essentially be a copy of the one from core with your changes made to it directly. 

Note:  I haven't looked at the changes that you are actually making to see if this is feasible in your specific circumstance.  I'm just talking about the general theory of how to do something like this without core changes. 


Always back up before making changes.

Share this post


Link to post
Share on other sites
23 minutes ago, ecartz said:

Would it make sense to ship your own header tag module?  Then you aren't changing core files.  You're creating a new file and can use configuration to uninstall the core version and install yours.  Which is better in that updates to the core file won't affect you and your version will persist through core updates without change. 

The header tag module would essentially be a copy of the one from core with your changes made to it directly. 

Note:  I haven't looked at the changes that you are actually making to see if this is feasible in your specific circumstance.  I'm just talking about the general theory of how to do something like this without core changes. 

There is a misunderstood:

The  module @vmn suggested to modify is the account  navbar module and I would like to avoid:

1. apply changes in the core module

2. add an alternative navbar module which would need to be enabled instead of the core module.

PWA includes already an own ht module where it's much more elegant to add a script to just disable the account nb module.

4 hours ago, vmn said:

I could not figure out how to make the #3 change in the ht module. The account block has no id and my jquery knowledge is limited.

IN: includes/modules/header_tags/ht_pwa.php around line 122 add:

      if ( tep_session_is_registered('customer_is_guest') ) {
        $oscTemplate->addBlock('<script>$(".nb-account .dropdown-toggle").addClass("disabled");</script>', 'footer_scripts');
      }

so it should look like this:

        $oscTemplate->addBlock($guest_account_script, 'footer_scripts');
      }

      if ( tep_session_is_registered('customer_is_guest') ) {
        $oscTemplate->addBlock('<script>$(".nb-account .dropdown-toggle").addClass("disabled");</script>', 'footer_scripts');
      }

      // do things if a guest comes from checkout success

Just remembered that there are also the account header buttons.
I'll add tomorrow the code to address this also and we saved to modify or add 2 modules.

Edited by raiwa

Share this post


Link to post
Share on other sites

OK. This is the complete snippet for to disable navbar and header button account modules.

In the ht_pwa.php module add around line 122:

      if ( tep_session_is_registered('customer_is_guest') ) {
        if ( defined('MODULE_NAVBAR_ACCOUNT_STATUS') && MODULE_NAVBAR_ACCOUNT_STATUS == 'True' ) {
          $oscTemplate->addBlock('<script>$(".nb-account .dropdown-toggle").addClass("disabled");</script>', 'footer_scripts');
        }
        if ( defined('MODULE_CONTENT_HEADER_BUTTONS_STATUS') && MODULE_CONTENT_HEADER_BUTTONS_STATUS == 'True' ) {
          $oscTemplate->addBlock('<script>$(".cm-header-buttons .btn:nth-of-type(n+3)").addClass("disabled");</script>', 'footer_scripts');
        }
      }

 

Share this post


Link to post
Share on other sites
On 11/24/2019 at 1:07 PM, vmn said:

1. If a new guest account is created with the same email as an old one, the old guest is removed from customers and address_book tables, but not

from customers_info, customers_basket and customers_basket_attributes tables. In the latter tables the previous guest row remains and a row for the new guest is created.

In account_pwa.php

find
      $check_guest = tep_db_fetch_array($check_guest_query);
      if ( tep_not_null($check_guest) ) {
        tep_db_query("delete from customers where customers_id = '". $check_guest['customers_id'] . "' and customers_guest = '1'");
        tep_db_query("delete from address_book where customers_id = '". $check_guest['customers_id'] . "' and customers_guest = '1'");
      }

insert after the second delete

        //VMN2019.11.23 delete also these
        tep_db_query("delete from customers_info where customers_info_id = '". $check_guest['customers_id'] ."'");
        tep_db_query("delete from customers_basket where customers_id = '". $check_guest['customers_id'] ."'");
        tep_db_query("delete from customers_basket_attributes where customers_id = '". $check_guest['customers_id'] ."'"); 

This needs to be added also in includes/modules/header_tags/ht_pwa.php line 58

Share this post


Link to post
Share on other sites

Uploaded update for Phoenix:

Purchase without account 4.0.1

Changes Version. 4.0.1
- updated core reference for Phoenix 1.0.4.0 in admin/reviews.php
- replaced deprecated <u></u> tags with alert-link class in shop language files. Thanks to @Demitry
- added sql to delete guest account data also from customers_info, customers_basket and customers_basket_attributes tables when the guest account is deleted. Thanks to @vmn
- disable navbar account menu and header account buttons during guest checkout. Thanks to @vmn
- updated scripts for checkout success to restyled Phoenix 1.0.2.6+ version..

4 versions included:
Phoenix 1.0.2.0 and lower: (old review write page "reviews_write_pwa.php")
Phoenix 1.0.2.1 and higher: (new reviews module "ext/modules/content/reviews/write_pwa.php")
Phoenix 1.0.2.6 and higher:  (restyled checkout success modules")
Phoenix 1.0.4.0 and higher:  (updated review stars in admin/reviews.php")

Edited by raiwa

Share this post


Link to post
Share on other sites

@raiwa I'm using the latest version of Phoenix. The PWA form does not appear on login page. I have it installed in admin.

Is there anything else I should check?

Thanks

Share this post


Link to post
Share on other sites
4 hours ago, discxpress said:

@raiwa I'm using the latest version of Phoenix. The PWA form does not appear on login page. I have it installed in admin.

Is there anything else I should check?

Thanks

Check If you have all Files copied

Edited by raiwa

Share this post


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

@raiwa i couldn't get PWA to work so I tried to remove it and now I'm getting a database error.

 

Thanks

1054 error.png

This is not related to PWA

Edited by raiwa

Share this post


Link to post
Share on other sites
40 minutes ago, discxpress said:

Ok. It didn't happen until I installed PWA

 

2 hours ago, discxpress said:

@raiwa i couldn't get PWA to work so I tried to remove it and now I'm getting a database error.

1. What is correct, you got the error since you installed it or since you removed it?

2. PWA doesn't add, remove or modify anything in the reviews table. It only uses modifications in admin/reviews.php and in admin/customers.php. There are queries on the reviews table in these files, but unchanged by the PWA modifications.

In which page you get this error?

I'm pretty sure you modified something else apart of the PWA installation.

If you do not find the solution, recover your backup (you made a backup? sure?)

3. The PWA login module can only not show if you missed to copy the template file or the language file, or you didn't installit/turn it on in admin, or you  copied a wrong version (very outdated PWA version)

Please consider that PWA is working in hundreds of stores since years. No one has reported any similar problems.

 

Edited by raiwa

Share this post


Link to post
Share on other sites

3. PWA login module. I just checked again. Clean unmodified Phoenix 1.0.4.0 installation. Added the PWA files and modified files. Installed the PWA login and header tag module and all works like expected. Maybe you didn't install the header tag module?

image.png.ad50e2f913b1148b4db6f48cc811dec5.png

5 minutes ago, discxpress said:

@raiwa Thanks I will try again. 

What is the latest version for Phoenix?

 

On 11/26/2019 at 7:31 PM, raiwa said:

Uploaded update for Phoenix:

Purchase without account 4.0.1

Changes Version. 4.0.1
- updated core reference for Phoenix 1.0.4.0 in admin/reviews.php
- replaced deprecated <u></u> tags with alert-link class in shop language files. Thanks to @Demitry
- added sql to delete guest account data also from customers_info, customers_basket and customers_basket_attributes tables when the guest account is deleted. Thanks to @vmn
- disable navbar account menu and header account buttons during guest checkout. Thanks to @vmn
- updated scripts for checkout success to restyled Phoenix 1.0.2.6+ version..

4 versions included:
Phoenix 1.0.2.0 and lower: (old review write page "reviews_write_pwa.php")
Phoenix 1.0.2.1 and higher: (new reviews module "ext/modules/content/reviews/write_pwa.php")
Phoenix 1.0.2.6 and higher:  (restyled checkout success modules")
Phoenix 1.0.4.0 and higher:  (updated review stars in admin/reviews.php")

 

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

×