marcello 18 Posted July 15, 2015 (edited) I installed this add on (BS version) and thought why not create a content module that would apply to the normal checkout_success process. I was able to successfully create a module that when placed in front of product notifications would disable that module (more so a simple hack, I'm sure there is a better solution and am open to suggestions). I'd gladly share the code for people to test and improve. The main benefits is we do not have to maintain a separate checkout_success.php page. This should provide seamless integration with Paypal or other modules that will redirect back to checkout_success.php. PS - I also made a tweak to the login module to make it more consistent with the default New Customer module. (Again, just tweaks) Edited July 15, 2015 by marcello Share this post Link to post Share on other sites
ArtcoInc 364 Posted July 16, 2015 @@marcello I installed this add on (BS version) and thought why not create a content module that would apply to the normal checkout_success process. I was able to successfully create a module that when placed in front of product notifications would disable that module (more so a simple hack, I'm sure there is a better solution and am open to suggestions). I'd gladly share the code for people to test and improve. The main benefits is we do not have to maintain a separate checkout_success.php page. This should provide seamless integration with Paypal or other modules that will redirect back to checkout_success.php. PS - I also made a tweak to the login module to make it more consistent with the default New Customer module. (Again, just tweaks) Yes, I'd be interested is seeing what you have done :) Malcolm Get the latest Responsive osCommerce CE (community edition) here . Share this post Link to post Share on other sites
marcello 18 Posted July 16, 2015 I just created a branch off my github of 234BS Edge. https://github.com/crazy-colorado/Responsive-osCommerce/compare/master...crazy-colorado:PWA_Addon Didn't want to post an addon. This should allow you to compare files. Note that checkout_process didn't need to have the tep_redirect modified from the original file. 1 ArtcoInc reacted to this Share this post Link to post Share on other sites
vampirehunter 16 Posted July 22, 2015 I just created a branch off my github of 234BS Edge. https://github.com/crazy-colorado/Responsive-osCommerce/compare/master...crazy-colorado:PWA_Addon Didn't want to post an addon. This should allow you to compare files. Note that checkout_process didn't need to have the tep_redirect modified from the original file. Hi this sounds good. so its basically the PWA is being added as a content module? im a bit confused on this bit here // 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(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . - EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; + EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n"; + + 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"; + } + + $email_order .= EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; + if(tep_session_is_registered('customer_is_guest')) { + $email_order .= EMAIL_WARNING . "\n\n"; + } if ($order->info['comments']) { $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } why is the order number, invoice url and date ordered having to be removed? is this affecting the PWA process? If its working as a module, thats fantastic. thanks Share this post Link to post Share on other sites
marcello 18 Posted July 22, 2015 (edited) @@vampirehunter Yes. The code creates a PWA login module. I have tested it and all works well. Regarding your question, the information you referenced is included in the email confirmation. The account history page link is removed, this is due to the customer not having access after the order is placed. Edited July 22, 2015 by marcello Share this post Link to post Share on other sites
vampirehunter 16 Posted July 23, 2015 @@vampirehunter Yes. The code creates a PWA login module. I have tested it and all works well. Regarding your question, the information you referenced is included in the email confirmation. The account history page link is removed, this is due to the customer not having access after the order is placed. Cool thanks do you still have the issue of where if a customer as a guest abandons their cart, that the database is not cleared? thanks Share this post Link to post Share on other sites
marcello 18 Posted July 23, 2015 No. I have not spent time addressing that portion of the code. My focus was to take the existing addon and make it a checkout module; thus, eliminating the need to maintain a separate checkout_success.php. I am not the original maintainer of this addon and was offering my code for their acceptance. Share this post Link to post Share on other sites
newburns 8 Posted September 9, 2015 Is it possible to have the PWA check for whether it is installed before query database table for customers_guest ? Here is the issue: Unless the module is installed and the DB inserts are ran on the installation, the Orders page is broken looking for the customers_guest entry The module adds and removes the entry based on the installation. Therefore, the installation should run a check for whether it's installed before running the query. Or the db entries need to be installed initially. Download my repo and you will see what I mean. Without installing the "Login without an Account" module, the orders page is broken. https://github.com/newburns/osCommerce-234-bootstrap-wADDONS Share this post Link to post Share on other sites
newburns 8 Posted September 9, 2015 I have found the issue, but I don't really know how to fix it. Basically, the content module alters the DATABASE upon installation of Account without Login However, the orders.php requires o.customers_guest which is only available when Account without Login is installed. Which poses a problem when it is not installed. The DB table can't be found. Install the module, and BOOM, everything is working. Uninstall the module (which removes the DB tables) and BOOM, orders.php doesn't work anymore. Any ideas how to alter orders.php to only query whenever the module is installed? https://github.com/newburns/osCommerce-234-bootstrap-wADDONS/blob/c59d2383a8ddbdb1190c23ceb18ac636580f77a9/admin/orders.php#L378-L388 Share this post Link to post Share on other sites
♥Tsimi 525 Posted September 9, 2015 (edited) Why not keep it installed but set it to false or true? Why would you want to install/uninstall the module all the time? Usually people install, setup and use. I guess you could add some sort of if else check. If module installed and enabled use query1 else query2. Edited September 9, 2015 by Tsimi Share this post Link to post Share on other sites
newburns 8 Posted September 10, 2015 The issue is upon first deployment, when you download my repo, the orders page is broken without real cause as to why. Is there a way to have it installed by default, but set to false? Share this post Link to post Share on other sites
marcello 18 Posted September 10, 2015 @@newburns I understand what you are getting at; however, this addon does make a few changes to the core code. One way to make it not error if it is removed is to change the following lines in admin/orders $check_status_query = tep_db_query("select customers_name, customers_guest, customers_email_address, orders_status, date_purchased, cc_number, cc_cvv2 from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); to $check_status_query = tep_db_query("select customers_name, " . ( defined('MODULE_CONTENT_PWA_LOGIN_STATUS') ? "customers_guest, " : '' ) . " customers_email_address, orders_status, date_purchased, cc_number, cc_cvv2 from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'"); This will keep your orders page from not loading if the module is not installed. Share this post Link to post Share on other sites
newburns 8 Posted September 10, 2015 Thanks @@marcello It was a little more than that, but I got it figured out. There were three lines that needed that check Share this post Link to post Share on other sites
GoCastaway 0 Posted October 10, 2015 Hi,I installed the PWA several times on this template: http://mobilewebs.net/mojoomla/demo/oscommerce/osmart/ Tried both version, but when checking out PWA don't show up on the login page, I just get the Create new customer and excisting customer login. At the Admin the module is installed, and there is a product in the shopping cart. Any help please? Share this post Link to post Share on other sites
♥raiwa 1,419 Posted February 25, 2016 Hello @@De Dokta, Just found one issue with PWA and Google analytics header tag module. To get the E-Commerce Tracking option to register guest orders, the Google Analytics header tag module should be modified: Line 44: if ( (MODULE_HEADER_TAGS_GOOGLE_ANALYTICS_EC_TRACKING == 'True') && (basename($PHP_SELF) == 'checkout_success.php' || basename($PHP_SELF) == 'checkout_success_pwa.php') && tep_session_is_registered('customer_id') ) { || basename($PHP_SELF) == 'checkout_success_pwa.php' added in that line. Maybe it would be good to add optional instructions or the modified header tag module module to the PWA package. Kindest regards Rainer About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 25, 2016 @@raiwa De Dokta hasn't been online since July last year, neither here nor in the German Forum. I messaged him a couple times and also send him a few E-Mails but no answer thus far. So either something happened in his life or he has a different reason to be absent. Share this post Link to post Share on other sites
♥raiwa 1,419 Posted February 25, 2016 Hello Lambros @@Tsimi, Wasn't aware of this. There are no public uploads allowed to the package. Is there a way to get it unblocked by a team member? Or is the above post enough or should I upload a new package? What is your opinion? Thank you and kind regards Rainer About Me: http://forums.oscommerce.com/user/249059-raiwa/ Need help? How To Get The Help You Need Is your version of osC up to date? You'll find the latest osC community version CE Phoenix here. Public Phoenix Change Log Cheat Set on Google Sheets Share this post Link to post Share on other sites
♥Tsimi 525 Posted February 25, 2016 I don't know if any team member can unlock an addon but I think you better start a new one and mention via link that your addon is based on his PWA. Or something like that. Share this post Link to post Share on other sites
Sam-AUST 5 Posted July 10, 2016 Hi this sounds good. so its basically the PWA is being added as a content module? im a bit confused on this bit here // 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(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" . - EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; + EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n"; + + 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"; + } + + $email_order .= EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; + if(tep_session_is_registered('customer_is_guest')) { + $email_order .= EMAIL_WARNING . "\n\n"; + } if ($order->info['comments']) { $email_order .= tep_db_output($order->info['comments']) . "\n\n"; } why is the order number, invoice url and date ordered having to be removed? is this affecting the PWA process? If its working as a module, thats fantastic. thanks In my case if a guest account is not used, both the invoice link line and date line show TWICE in the order process email - surely I'm not the only one? Share this post Link to post Share on other sites
♥14steve14 628 Posted October 6, 2016 I am having a problem with this addon. A customer previously purchased from my store using the PWA feature. He later decided to use te PWA feature and purchase comething else at a later date. He got the warning message that he already had an account and should use that. Obviously he didnt have a password so could go no further, so contacted me. I looked and found his order and also that he did indeed have his details saved to the customer list, which should not have happened. I changed his email address so he could make his purchase, and once he had made his latest purchase I checked again and his details are in the customers list. I have tried now tried to make a test purchase using the PWA feature and the customers details I entered are kept in the customers list. There is also no tick to show that the order was a guest checkout. I have manually checked the files and installation and have also tried uploading the original files again, and after reinstalling the modules still have the same problems. I have run out of ideas. Can any one offer any suggestions on how to ensure that the customer details are removed from the system. REMEMBER BACKUP, BACKUP AND BACKUP Get the latest Responsive osCommerce CE (community edition) here It's very easy to over complicate what are simple things in life Share this post Link to post Share on other sites
♥Tsimi 525 Posted October 6, 2016 (edited) @@14steve14 Hi Steve It's been a while since I had a look at this PWA addon but as far I remember the customer data gets only deleted when an order is successfully placed. When the guest goes through the order process he will get redirected to the checkout_success_pwa.php page which is where the magic happens. Inside that file you find this piece of code that deletes the customer data from the database after a successful order. <?php if (tep_session_is_registered('customer_is_guest')){ 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'); } If a customer browses through your shop as guest and adds products to the cart and goes away and returns at a later time he won't be able to continue nor use the same mail address. Unless you delete his customer entry through the admin area. Regarding your other issue with the check icon I have no idea why that would happen. I installed this a while back into a test shop and all worked fine in the back end. Edited October 6, 2016 by Tsimi Share this post Link to post Share on other sites
♥14steve14 628 Posted October 6, 2016 I have decided to remove it for now, whilst further tests are made. It may be a case of getting someone t code it so it does work as I want. REMEMBER BACKUP, BACKUP AND BACKUP Get the latest Responsive osCommerce CE (community edition) here It's very easy to over complicate what are simple things in life Share this post Link to post Share on other sites
Mikepo 77 Posted October 6, 2016 I've been testing this addon, seems to work OK for me, The tick (check icon) does appear on the orders list. I also checked that if a guest customer added a product to the basket, and starts the purchase process using the PWA module, and then decides not to purchase, the customers details are stored in the customer account table. So if the customer returns and tries to purchase another product, using the PWA module, osC prevents him from completing the process because his email address exists in the database, as a customer record. What is needed is a check on the customer table (customers.php) to show that the customer was a guest and therefore didn't complete the PWA process. That way we can identify these customers as guests and delete them using phpMyAdmin. If that seems a sensible way of doing this I'll try and code it was post it. Mike 1 ArtcoInc reacted to this osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!) Share this post Link to post Share on other sites
burt 5,435 Posted October 6, 2016 I haven't used this addon, so don't know it, but here's a potential idea; on create_account (or whatever page this PWA system has for signing up clients) have some logic at the email_address field so that when the email address is input, it quickly and in the background looks up to see if that customers exists (and presumably has the "guest" flag). If both are true, silently nuke that ghost guest account... 2 Tsimi and Mikepo reacted to this Help shape the future of Phoenix; join the Phoenix Club Share this post Link to post Share on other sites
Mikepo 77 Posted October 6, 2016 OK this is what I've done In customers.php FIND: <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_FIRSTNAME; ?></td> ADD AFTER: <!--PWA--> <td class="dataTableHeadingContent" align="right"><?php echo GUEST; ?></td> -------------------------------------------------------------------------------------- FIND: $customers_query_raw = "select c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_lastname, c.customers_firstname"; REPLACE WITH: $customers_query_raw = "select c.customers_id, c.customers_guest, c.customers_lastname, c.customers_firstname, c.customers_email_address, a.entry_country_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_id = a.customers_id and c.customers_default_address_id = a.address_book_id " . $search . " order by c.customers_guest DESC, c.customers_lastname, c.customers_firstname"; ---------------------------------------------------------------------------------------------------- FIND: <td class="dataTableContent"><?php echo $customers['customers_firstname']; ?></td>ADD AFTER: <!-- PWA --> <td class="dataTableContent" align="right"><?php echo $customers['customers_guest'] == '1' ? tep_image(DIR_WS_ICONS . 'tick.gif') : ''; ?></td>----------------------------------------------------------------------------------------------------- This should list all the customers showing whether the guest field is ticked, and the table is ordered on the customers_guest field, so you see these first. So after a day or two, and the customer hasn't finished the PWA order you can delete the customer. Hope this helps, do test this first. Now I've just read the post from burt above, and that sounds like a better solution. I'll try that another day. Mike osC CE live - developing osC Phoenix adding modules with no core changes(awesome and easy!) Share this post Link to post Share on other sites