| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Shipping/Billing Names upon Register | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
Shipping/Billing Names upon Register
Modded with: X-Cart 3.5.7
Always make a backup before applying any mod! Here is a quick file list: include/register.php, include/func.php, skin1/main/register_billing_address.tpl, skin1/main/register_shipping_address.tpl 1) X-Cart Admin Patch/Upgrade Apply this SQL patch: Code:
This will add 4 new fields to the customers table. 2) Edit include/func.php and find the following in the func_userinfo() function defination: Code:
Replace with: Code:
3) Edit skin1/main/register_billing_address.tpl find: Code:
Replace with: Code:
Find the {/if} after the </tr> of the lastname area, and remove or comment it out {*/if*} You may also want to comment out the title field of the billing form as well. 4) Edit skin1/main/register_shipping_address.tpl: And remove or comment out the {if $action eq "cart"} around the title, firstname and lastname fields so they show on all register forms. You may also want to remove or comment out the shipping title field. 5) Edit include/register.php and modify the update query: Code:
To the above. 6) Also update the insert statement of new customers: Code:
Note the b_firstname,b_lastname and s_firstname,s_lastname fields and variables. This Should Do the trick, Ive done some moderate testing on this mod on a local copy so let me know if you find any snags.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#2
|
|||||||
|
|||||||
Hi Boomer
Thanks again for all the help you provide to the users of this forum. You have helped me out numerous times. I tried many different ways to get the checkout process to carry thru the information typed in during step one of the checkout. Using the anonymous process, which is the only process I use in my store, I was not able to get the first and last names for shipping and billing info to do exactly what I needed. I applied your mod, which you so nicely posted above, to my store. For the first time the first and last name info for shipping and billing info started to carry thru from step 1 to step 3 of the checkout. With some further adjustment to the include\func.php file, I was able to get it to do exactly what I needed. Here is the revision you posted to the func.php file: $userinfo["b_title"] = $userinfo["s_title"] ? $userinfo["s_title"] : $userinfo{"title"]; $userinfo["b_firstname"] = $userinfo["s_firstname"] ? $userinfo["s_firstname"] : $userinfo["firstname"]; $userinfo["b_lastname"] = $userinfo["s_lastname"] ? $userinfo["s_lastname"] : $userinfo["lastname"]; Here is the revision I made: empty($userinfo["s_title"])? $userinfo["s_title"] = $userinfo["b_title"] : $userinfo["s_title"] = $userinfo["s_title"]; empty($userinfo["s_firstname"])? $userinfo["s_firstname"] = $userinfo["b_firstname"] : $userinfo["s_firstname"] = $userinfo["s_firstname"]; empty($userinfo["s_lastname"]) ? $userinfo["s_lastname"] = $userinfo["b_lastname"] : $userinfo["s_lastname"] = $userinfo["b_lastname"]; Now in my 3.5.7 store, If the user leaves the shipping info empty at step 1 of checkout, the shipping info (including first and last name) will be filled in automatically with the billing info and carried thru to step 3 of checkout. If the user fills in the shipping info at step 1 of checkout, the shipping info (including first and last names) will be filled in with the shipping info they entered, and carried thru to step 3 of checkout. I've not tested this with all the payment methods in my store yet, but I don't see any problems with the moderate testing I've done. Thank you for helping me streamline the checkout process. Mike
__________________
Mike X-Cart Gold Version 4.6.0 PHP 5.2.17 |
|||||||
#3
|
|||||||
|
|||||||
Another forum member pointed out a mistake in the code I listed above. The last line should be:
empty($userinfo["s_lastname"]) ? $userinfo["s_lastname"] = $userinfo["b_lastname"] : $userinfo["s_lastname"] = $userinfo["s_lastname"]; Sorry for any confusion. Mike
__________________
Mike X-Cart Gold Version 4.6.0 PHP 5.2.17 |
|||||||
#4
|
|||||||
|
|||||||
Jut thought I'd make a post here to let people know this problem has been fixed with the 3.5.8 version of XCart.
Mike
__________________
Mike X-Cart Gold Version 4.6.0 PHP 5.2.17 |
|||||||
#5
|
|||||||
|
|||||||
Hi Guys,
I've just applied this code and it works (running 3.5x branch). Instead of having the shipping name coppied with the billing though, I prefer to allow the user to leave it blank without it being forceably overwritten with the billing name details. Note that the original post by Boomer did not seem to work for the shipping name as it seemed to be substituted with the billing name after a re-save of the registration info, however the post by mikebo seemed to fix that problem, but in my case I didn't want that behaviour, rather I wanted to allow the option to leave the first and last name blank for the shipping. So for my implementation, here's what I did (using Boomers code as a model): 1) X-Cart Admin Patch/Upgrade Apply this SQL patch: Code:
This will add 4 new fields to the customers table. 2) Edit include/func.php and find the following in the func_userinfo() function definition: Code:
replace it with: Code:
3) Edit skin1/main/register_billing_address.tpl find: Code:
and replace with Code:
4) Edit skin1/main/register_shipping_address.tpl: And remove or comment out the {if $action eq "cart"} around the title, firstname and lastname fields so they show on all register forms. You may also want to remove or comment out the shipping title field. 5) Edit include/register.php and modify the update query to: Code:
6) Also update the insert statement of new customers to: Code:
__________________
----------------------------------------- X-Cart5 v5.2.16 (Live) ----------------------------------------- |
|||||||
#6
|
|||||||
|
|||||||
First of all thanks for this mod!
I've carefully followed the instructions of boomer, then implemented the revision of mikobo and got it partial working: phpmyadmin shows me that the shipping first & lastname are written to the datebase, but strange enough the shipping namefields in the registerform are still populated with the billing first- & lastname... I hope somebody can help me with this. Many thanks in advance! Jerrad
__________________
X-Cart 4.0.12 Heavy modified with paid, free and forum mods. PHP 5.2.5 | MYSQL 5.0.51a |
|||||||
#7
|
|||||||||
|
|||||||||
Re: Shipping/Billing Names upon Register
Quote:
Are you trying to apply this mod with a different version of X-Cart than the 3.5.x branch?
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#8
|
|||||||
|
|||||||
Oeps, I've got 4.0.12...
Strange enough it seems to work oke during checkout - customer can give a different shipping first - and last name, which gets saved without any problems. But when a customer registers for the first time or wants to update his/her profile with different shipping information, the first - and last name gets overwritten by the billing names. Address, zipcode and city are saved correctly. So with {if $action eq "cart"} all the shipping information can be saved without any problem. Any other $action will only save the address, but not the first - and last name... Any ideas how to solve this? Thanks in advance!
__________________
X-Cart 4.0.12 Heavy modified with paid, free and forum mods. PHP 5.2.5 | MYSQL 5.0.51a |
|||||||
#9
|
|||||||
|
|||||||
This must be a bug
This is either a bug or poor design, the other day, a customer asked me to update his shipping address on database (he was an elderly gentelman, could not figure out himself), anyways when I went to the use profile page, bingo! there were no fields to update for the shipping name and lastname.
I was confused and went to the database to see if the customer table has s_firstname, s_lastname fields and bingo, they are not there! Shipping firstname and lastname are only saved to the database when an order was placed. However if the user just registers but does not complete the checkout then the shipping firstname and lastname are replaced with billing name/lastname. On the payment page, there is a modify profile link, and when you go there and update info, it does not not store that data unless you complete the order. That does not sound right to me. In my customer's case he was so confused and he sent an email and updated shipping name/lastname that way, cause he wants it to be shipped to his granddaughter. This weird setup should definitely be fixed in the next release. koksal
__________________
x-cart 4.0.16 (linux) location: USA |
|||||||
|
|||
X-Cart forums © 2001-2020
|