ChrisColeman Posted April 29, 2017 Share Posted April 29, 2017 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. Quote Link to comment Share on other sites More sharing options...
ChrisColeman Posted May 1, 2017 Author Share Posted May 1, 2017 Or maybe a HOOK ? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 1, 2017 Share Posted May 1, 2017 It's going to take a coder to know how to answer your question. @bsmither is on sporadically right now, so it may be awhile before the right person sees your post. If no one helps in a couple of days, please bump your post. Quote Link to comment Share on other sites More sharing options...
ChrisColeman Posted May 1, 2017 Author Share Posted May 1, 2017 Yes, thanks for the reply - anyway I found a way around my problem using SMARTY but its a bit messy .. Chris. Quote Link to comment Share on other sites More sharing options...
bsandall Posted May 1, 2017 Share Posted May 1, 2017 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! Quote Link to comment Share on other sites More sharing options...
ChrisColeman Posted May 1, 2017 Author Share Posted May 1, 2017 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. Quote Link to comment Share on other sites More sharing options...
ChrisColeman Posted May 6, 2017 Author Share Posted May 6, 2017 Anybody there ? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted May 6, 2017 Share Posted May 6, 2017 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. Quote Link to comment Share on other sites More sharing options...
ChrisColeman Posted May 6, 2017 Author Share Posted May 6, 2017 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. 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.