Jump to content

Checkout Question


Recommended Posts

If a user attemps to checkout without an address he/she is redirected as follows -
 

Quote

 

cubecart.class.php (1550)

// no address found - lets redirect to the 'add address' page
 $GLOBALS['gui']->setInfo($GLOBALS['language']->account['error_address_billing']);
 httpredir('?_a=addressbook&action=add');

 

Which is fine ..

However if the user does have an address book but has not defined a defaut address he is still directed to httpredir('?_a=addressbook&action=add');, would it not be better in this case to

Quote

redirect to httpredir('?_a=addressbook&action=edit');

, which could provide both edit and add options.

Chris.

 

Link to comment
Share on other sites

There isn't currently a hook that would work, but it seems you are comfortable enough poking around in the code so why not simply edit it to do what you want?

One thing I would be wary of, not having tested it, is what is the behavior of the addressbook's edit page if the customer doesn't have any addresses? It might be necessary to check what getAddresses returns before deciding to send the customer to 'add' or 'edit'. Or 'edit' might always work. Only one way to find out! ;)

 

Link to comment
Share on other sites

Well I did consider changing the code - but I dont want to have to change it again each time CubeCart makes a new release (£$!?), also I have about 8 or 10 CubeCart stores to maintain, some quite old so I may have to multiply the above several times therefore need a satisfactory solution 

Well yes that is the crux of the problem - The return from the core code is ambiguous - There's a whole bunch of code in the foundation skin which is just unecessary but I think it was put there to get around the return from the core code; However there is possibly a different reason so I should not speculate on that.

Happy Days ..

Chris.

Link to comment
Share on other sites

It might be a good idea to private message Bsmither, so he'll see your post when he pops in. He's in the middle of moving his household and not on here much right now. If anyone can suggest a snippet or other coding solution, he would be able to.

Link to comment
Share on other sites

No problem, I can wait I have implemented my own solution using SMARTY but would like something better because have multiple stores to support, and because I have to present an ambiguous message to users.

Just to reiterate ..

As mentioned above maybe a new Hook is possible.

The problem occurs because when the PHP code returns 'no address available' it does so even is there are addresses in the address book, if none of those is designated as a billing address.

If I had a HOOK I could return some thing different like 'There are address(s) in the address book but none are designated as the billing address' or just ''There are no addresses in the address book", appropriately.

Currently in both sets of circumstances the user is redirected to 'add a new address'.

Chris.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...