violinman Posted July 8, 2017 Share Posted July 8, 2017 Hello, I am now testing card payments. When I am returned from the secure payment page (CardStream/CharityClear) I have two problems, if I use the button "print invoice" it takes me to a login/register page which I don't want, I just want to be able to print the invoice. I have removed other references to Login/Register but cannot find where to disable this one. the second problem is that when it returns from the payment page the customer details are not displayed even though I can see them in the source code? Thank you all, Brian Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 8, 2017 Share Posted July 8, 2017 The first problem seems to be indicative of having lost the cookie that CubeCart uses to keep track of who you are. When you hover the mouse over the link to print that order's invoice, what does the browser say the URL is? If the URL is different than the domain of the cookie, then the browser will not send the appropriate cookie, if any cookie at all. Interesting about the second problem. I hear you say that, having asked the browser to show the source HTML of the page being displayed, the source seems to not be what is actually being displayed. In my experience with Firefox, certain browser settings will show the source from the page as it sits in the cache, and other settings will actually fetch a fresh page from the server and show the source HTML of what was returned. This result will be different if that request did not send the cookie. So, please verify that your browser is sending an appropriate cookie with all page requests, and that the URLs are all to the target store (as opposed to a test store). Quote Link to comment Share on other sites More sharing options...
violinman Posted July 8, 2017 Author Share Posted July 8, 2017 Hi bsmither, the URL is the same as the domain but you may recall that the site is not live yet, getting the payment bit working is the last task hopefully before I take it live. How do I bypass the Login/Register page that the print invoice button launches? I am using Safari as it is a MAC computer. Strange though it shows the heading "Customer Information" but no content and then "Order Summary" with the table below with the information in it and I can see the customer details which it should display in the source code! All URLs are to the target store, cookies are enabled in Safari settings. I feel really stuck with this problem, just don't know what to do. Brian This is the actual print invoice button link, I have just changed the website name: <p><a href="http://mysite.com/index.php?_a=receipt&cart_order_id=170708-203157-3354" target="_blank" class="button"><i class="fa fa-print"></i> Print Invoice</a></p> and yet it opens a login/register page! Brian Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 8, 2017 Share Posted July 8, 2017 "How do I bypass the Login/Register page that the print invoice button launches?" That's not how CubeCart works. We need to suss out why CubeCart is behaving this way. "and yet it opens a login/register page!" CubeCart will always verify that there is a valid user that is represented by the cookie. If no cookie, no user, no user-based page, but will try to get the 'unknown visitor' to log in. You say cookies are enabled in Safari, but does Safari have a diagnostic panel where one can view the actual traffic in and out of the browser? I would ask that you observe the actual cookie that the browser is (or is not) sending to your store when the link to print the invoice is clicked on. Quote Link to comment Share on other sites More sharing options...
violinman Posted July 8, 2017 Author Share Posted July 8, 2017 Hello, I have not a clue how to observe the cookie in Safari, I also have Chrome, would I be able to see it in Chrome? You say that is not how CubeCart works but I managed to disable the code that required login or register when you went through checkout, in fact I think it was you who told me which file I would find it in. Is there no way globally to remove the need to register or login? My site does not need it and in fact it is a hinderance as most of my clients only visit the once. Brian Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 8, 2017 Share Posted July 8, 2017 (edited) CubeCart allows for a 'ghost' customer to check out. A ghost customer can add items to a shopping basket and checkout without creating a store account. At checkout, however, CubeCart will still require the customer provide an email address and physical address. (There are those attempting to circumvent the required physical address because the store has 100% digital inventory.) For this situation, a ghost customer has no account that CubeCart can validate against when making a query from the database based solely on the order number. But you are saying that you are logged in as a customer with a customer account (email/password). I think we are still at the place wanting to solve the disparity between what is seen on the page and the HTML source of that page. I understand that Chrome has a diagnostic feature, but alas, I do not use Chrome. Edited July 8, 2017 by bsmither Quote Link to comment Share on other sites More sharing options...
violinman Posted July 9, 2017 Author Share Posted July 9, 2017 I don't want any customer to have to login or register but anyone placing an order does have an "identity" in that their order details, email and name and address are passed to the secure payment page so in that sense it is a "ghost" customer. The CardStream/CharityClear plugin has by default the index.php as the redirectURL which is where it returns to after the card details are entered and submitted. I might try using a different page. When you mention a "ghost" customer is that something that has to be enabled in admin or should it just happen ? Brian Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 9, 2017 Share Posted July 9, 2017 An unintended consequence, I believe, of your wanting to remove any login to print a receipt is that anyone can make repeated attempts at guessing an order number and get a result. (It may take a while, but still possible.) Quote Link to comment Share on other sites More sharing options...
violinman Posted July 9, 2017 Author Share Posted July 9, 2017 Highly unlikely, the order number returned from CardStream is 16 digits long with a couple of hyphens as well! My old site which I have been running for 17 years is probably less secure than CubeCart but I have never had an issue with hackers, probably partly to do with the items I sell. Brian Quote Link to comment Share on other sites More sharing options...
violinman Posted July 9, 2017 Author Share Posted July 9, 2017 This is the actual print invoice button link, I have just changed the website name: <p><a href="http://mysite.com/index.php?_a=receipt&cart_order_id=170708-203157-3354" target="_blank" class="button"><i class="fa fa-print"></i> Print Invoice</a></p> and yet it opens a login/register page! Brian Quote Link to comment Share on other sites More sharing options...
bsmither Posted July 9, 2017 Share Posted July 9, 2017 In /classes/cubecart.class.php, there is private function _receipt(). This gets the order data and populates the receipt template. The first test is to make sure the cart_order_id is included in the URL, as well as either the customer being logged in OR the customer's email address is included in the URL. The link does not include the email address, so we must assume CubeCart considers the customer is actually logged in. Is this the case? (Or, there is a bug in that CubeCart should be adding the ghost customer's email address to this link.) Should this test fail, the next code to execute is to bounce the visitor to the login page. Quote Link to comment Share on other sites More sharing options...
violinman Posted July 9, 2017 Author Share Posted July 9, 2017 The cart order number is included in the URL but not the email address. The customer is not logged in so it is possibly a bug if the URL should include the email address. I tried another purchase and this time when I pressed "print invoice" I went through the register process, it then showed the printer dialogue and allowed me to print the invoice, it also displayed it on screen. Basically CubeCart is insisting the customer is logged in. I am surprised this is not an option that can be enabled or disabled in Admin, not all sites want or need clients to register, in my business it is a disadvantage! I do appreciate your time and effort in trying to solve the problem Brian Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 9, 2017 Share Posted July 9, 2017 @violinman Have you added a request for the login option capability on the Feature Request board? If not, please do, and be sure to link your request to this forum thread. Your request is more likely to get votes if you put a link to it here, as well. Quote Link to comment Share on other sites More sharing options...
violinman Posted July 10, 2017 Author Share Posted July 10, 2017 Problem now solved, thank you all for your input. Because it seemed like a bug in CubeCart I asked CubeCart support for help, they have fixed it for me. Brian Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 10, 2017 Share Posted July 10, 2017 Good to hear! I don't see the fix displayed on GitHub yet. When it shows up, it needs to be shared here. Quote Link to comment Share on other sites More sharing options...
violinman Posted July 11, 2017 Author Share Posted July 11, 2017 I just did! Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted July 12, 2017 Share Posted July 12, 2017 In case someone else would like their store setup to not require logging in or registering: VOTE for https://features.cubecart.com/topic/have-the-need-for-customers-to-register-an-admin-choice Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.