Cpup Posted June 21, 2021 Share Posted June 21, 2021 Hi, Is there a way for the customer to only use just their name/username, email and password to register? I sell digital music only and don't require a shipping address. I think some customers are reluctant to register and buy with their address required? Link to comment Share on other sites More sharing options...
bsmither Posted June 21, 2021 Share Posted June 21, 2021 This would require some modifications to the checkout pages (removing form fields, changing core code to not check for missing data, etc) -- but entirely do-able. You should verify that the payment gateway does not require an address for any sort of credit card verification to match the card's billing address. Link to comment Share on other sites More sharing options...
Cpup Posted June 26, 2021 Author Share Posted June 26, 2021 Hi @bsmither, I only use PayPal and Stripe, so they redirect for payments, so it should be fine. Link to comment Share on other sites More sharing options...
bsmither Posted June 26, 2021 Share Posted June 26, 2021 Do you charge tax? Link to comment Share on other sites More sharing options...
Cpup Posted June 27, 2021 Author Share Posted June 27, 2021 I include it in the price. Link to comment Share on other sites More sharing options...
bsmither Posted June 27, 2021 Share Posted June 27, 2021 Ok, good to know. I've been tracing the code. I think I am at the last obstacle. Link to comment Share on other sites More sharing options...
bsmither Posted June 28, 2021 Share Posted June 28, 2021 This project all looks good so far, but be aware that since Billing and Delivery fields are now blank, email templates and a couple of other outputs need editing to remove the odd blank areas. Link to comment Share on other sites More sharing options...
Cpup Posted June 29, 2021 Author Share Posted June 29, 2021 Thanks @bsmither, great stuff! The only email required for purchase is an invoice and the link to the download. Link to comment Share on other sites More sharing options...
bsmither Posted June 29, 2021 Share Posted June 29, 2021 Let's try what has been developed so far. Several settings you need to make in the Store Settings: Be sure there are no enabled shipping modules. Disable initial shipping and tax estimates. Checked. Allow delivery to non-invoice address. Unchecked. Allow order Processing status to be skipped. Checked (maybe). Allow physical orders even if no shipping options are available. Checked. These settings seem to be irrelevant for a digital-only shopping basket, but, set these just to make sure. There will be three edits to the Foundation skin, two in the template content.checkout.confirm.php and one in the template element.js_foot.php. If you are not using Foundation, we need to explore how to implement this in the skin you are using. content.checkout.confirm.php Line 180, from: </address> {if $TERMS_CONDITIONS} To: </address> </div> {if $TERMS_CONDITIONS} Line 137, from: <h3>{$LANG.address.billing_address}</h3> {if !$ALLOW_DELIVERY_ADDRESS}{$LANG.address.ship_to_billing_only}{/if} To: <div class="hide" id="address_billing"> <h3>{$LANG.address.billing_address}</h3> {if !$ALLOW_DELIVERY_ADDRESS}{$LANG.address.ship_to_billing_only}{/if} element.js_foot.php Line 13, from: <script>{literal}$(document).foundation({equalizer:{equalize_on_stack:true}});$('.bxslider').bxSlider({auto:true,captions:true});$('.chzn-select').chosen({width:"100%",search_contains:true});{/literal}</script> To: <script>{literal}$("address").parent().remove();$(document).foundation({equalizer:{equalize_on_stack:true}});$('.bxslider').bxSlider({auto:true,captions:true});$('.chzn-select').chosen({width:"100%",search_contains:true});{/literal}</script> The above wraps the billing address group of form elements in a div block similar to how the delivery address group is done. This allows for a javascript function to remove the groups of code -- not simply hide it which would still submit empty form fields, causing problems later on. There is an edit to be made in the core code file /classes/cubecart.class.php. Fortunately, there is a nearby hook we can write a code snippet against, but let's try the edit first. (Be aware, upgrades will undo this edit - that's why hooks exist.) /classes/cubecart.class.php Near line 967, from: $GLOBALS['smarty']->assign('VAL_CUSTOMER_COMMENTS', isset($this->_basket['comments']) ? $this->_basket['comments'] : ''); foreach ($GLOBALS['hooks']->load('class.cubecart.construct.confirm') as $hook) { include $hook; } To: $GLOBALS['smarty']->assign('VAL_CUSTOMER_COMMENTS', isset($this->_basket['comments']) ? $this->_basket['comments'] : ''); $this->_basket['billing_address']['user_defined'] = true; $this->_basket['delivery_address']['user_defined'] = true; $this->_basket['customer'] = $_POST['user']; foreach ($GLOBALS['hooks']->load('class.cubecart.construct.confirm') as $hook) { include $hook; } These three new lines are necessary to put required values in the basket that would have been done had there been anything from Billing that arrived in $_POST. The required basket values are the result of what would have been generated from validating the $_POST payload -- billing address fields, delivery address fields, etc. But, since none of that is now in $_POST, we need to fake a few things. Within this validation section of the code, there are a few other things that may need to be dealt with: Still need to check T&C's are agreed to, validate reCaptcha, check email for valid format and prior use, password matching if the customer actually wants to create an account, valid phone number format, and creating a ghost customer in CubeCart_customers database table (important because currently, the billing and delivery name fields in CubeCart_order_summary are empty). I still need to test this having taken an order through a simulated payment transaction. Link to comment Share on other sites More sharing options...
Cpup Posted June 30, 2021 Author Share Posted June 30, 2021 Hi @bsmither, I've tried it on my test cubecart, but I can't register as a customer and getting the following: The following errors were detected: The verification code was incorrect. Please try again. I registered via admin. It's now asking for a billing address before continuing with purchase. Link to comment Share on other sites More sharing options...
bsmither Posted June 30, 2021 Share Posted June 30, 2021 Yes, actually wanting to create an account is one of the things that needs further work. As well as a need to check that T&C's are agreed to, validate reCaptcha, etc, as mentioned earlier. Can you test the sequence as a ghost customer? That is, do not try to create an account. Link to comment Share on other sites More sharing options...
Cpup Posted June 30, 2021 Author Share Posted June 30, 2021 I just get a blank screen. I used a promotional code as I don't have a test payment gateway, so not sure if it makes a difference? But I get the following in the browser bar: https://test.understated-records.co.uk/chris/index.php?_a=complete Link to comment Share on other sites More sharing options...
bsmither Posted June 30, 2021 Share Posted June 30, 2021 I am testing with the Print Order Form. It doesn't go past Pending. A promo code that effectively zeros the total? CubeCart does push that to Complete. Do you have a PHP error_log? Link to comment Share on other sites More sharing options...
bsmither Posted June 30, 2021 Share Posted June 30, 2021 I see that your OP specifies that you want your customers to be able to register (their option, I suppose). That still leaves the obstacles to be solved are at the checkout stage. There is no requirement that the customer create an entry in the Addressbook. But now, as a logged-in user, a different part of the checkout.confirm template is put in play. That needs to be sussed out. Link to comment Share on other sites More sharing options...
Cpup Posted July 2, 2021 Author Share Posted July 2, 2021 I received the email with download link still though. If logged in it won't let me access it, but if not, the link automatically downloads the product. Link to comment Share on other sites More sharing options...
bsmither Posted July 2, 2021 Share Posted July 2, 2021 "If logged in it won't let me access it" That's odd. I'll look into it. Link to comment Share on other sites More sharing options...
Cpup Posted November 9, 2021 Author Share Posted November 9, 2021 Hi @bsmitheris there an update on this topic? I am hoping that in a new update of CubeCart in the future, there maybe a checkbox option in admin which allows digital downloads to be bought without having to fill out the billing/delivery address? Is this something that maybe possible @Al Brookbanks? Link to comment Share on other sites More sharing options...
Al Brookbanks Posted November 10, 2021 Share Posted November 10, 2021 On 11/9/2021 at 7:34 AM, Cpup said: Hi @bsmitheris there an update on this topic? I am hoping that in a new update of CubeCart in the future, there maybe a checkbox option in admin which allows digital downloads to be bought without having to fill out the billing/delivery address? Is this something that maybe possible @Al Brookbanks? Most payment methods require a billing address as establishments are required by law to keep tax records. Selling without knowing your customer isn't widely considered to be acceptable in civilised countries so there are no plans to remove billing address from the checkout I'm afraid. https://en.wikipedia.org/wiki/Know_your_customer Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.