API
Version 7.x > API > Checkout With No Address View modes: 
User avatar
Member
Member
bryanallott - 11/5/2013 11:41:07 PM
   
Checkout With No Address
Trying to achieve a checkout with no address at all specified- much the same as a local bricks and mortar store really where you walk in, buy something, leave: cashier never requests a shipping or billing address because standard tax is applied to the product regardless.

In our config, tax is applied to the billing address, and we have tax applied to products and hardwired the country of current billing/shipping address to the same country as the tax configuration.

So up to now, we've always requested an address (for shipping and billing) but for a downloadable product, requesting any kind of address is meaningless (we're now just a POS). How to save an order where all addresses = 0? Currently, I'm getting an error raised on SetOrder() where no billing address.

The error:

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_COM_Order_OrderBillingAddressID_COM_Adress". The conflict occurred in database "KenticoCMS7", table "dbo.COM_Address", column 'AddressID'.


Based on that, there doesn't seem to be anything I can get around with a config setting.

The main question I guess would be: how badly would I break the integrity of the Orders subsystem if I remove that Foreign Key? :)

User avatar
Member
Member
seanbun - 11/6/2013 12:39:09 AM
   
RE:Checkout With No Address
How about create a dummy address and get the AddressID from the database. hardcode to your check out procedure.

I know this is not ideal, but just a quick idea. ;)

User avatar
Member
Member
bryanallott - 11/6/2013 12:45:32 AM
   
RE:Checkout With No Address
Snap! :)

Pretty much what I'm doing right now. Either using the last used address for repeat customers or creating default blank addresses on the fly. It's not clean but not terrible mind you, and at worst, customers just see this blank address in their personal address book... which they can edit anyway.


User avatar
Certified Developer 13
Certified Developer 13
kentico_josefd - 11/7/2013 11:17:53 AM
   
RE:Checkout With No Address
Hi Bryan,

The option seabun suggested is by far the easiest solution. There needs to be some address assigned to shopping cart before it can be submitted as order. Making the checkout work without any address would require customization of multiple provider methods to work.

Regards,
Josef