| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
2 Address Lines | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||||
|
|||||||||
If you are using Windows the best search tool is SEARCH, but instead of making a search for a file, you make a search for a string inside a directory, that way it searches internally inside each file and tells you where the string is.
Well, at least with Windows 2000.
__________________
It doesn\'t matter what is done... it is how it is done. ============================= XCart Version: 3.5.3 -> Dmcigars.com XCart Version: 4.1.3.... |
|||||||||
#12
|
|||||||
|
|||||||
Hi,
I LOVE this mod, BUT I've just noticed that it has a minor flaw. In include/register.php, there is some coding that looks like this: if (empty($s_address)) $s_address = $b_address; This will automatically fill in address line 1 for the shipping section with the information from address line from the billing section if the customer leaves the shipping section empty. This code is done for most of the shiping section like city, zip code, state, etc. But here comes the problem, if you want to do this automatically filling for your newly created s_address2 from this mod, itll look like this: if (empty($s_address2)) $s_address2 = $b_address2; The problem is say the customer filled in: Billing section Address: 2904 Happy Oaks Rd. Address 2: Apt# 290 Shipping section Address: 5810 Sappy Blvd. Address 2: (he leaves it blank) Although he left address 2 blank, the xcart will automatically fill it in causing it to become: Shipping section Address: 5810 Sappy Blvd. Address 2: Apt# 290 The same thing will happen if he were to leave the address line 2 blank for the billing section but filled in the address line 2 for the shipping section. Can someone please tell me the php code to tell xcart to only fill in s_address 2 with b_address 2 IF b_address matches s_address I tried this: if (empty($s_address2) & $b_address = $s_address) $s_address2 = $b_address2; but no success. If someone can get the code, the cart will only fill it in if the first address lines match, otherwise it will correctly leave it empty. Thanks. |
|||||||
#13
|
|||||||||
|
|||||||||
Quote:
Instead of doing this steps, in case you don't have phpmyadmin, you can use this SQL query in patch/upgrades in your X-Cart admin to achieve the same: Code:
Great documentation btw
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart. |
|||||||||
#14
|
|||||||||
|
|||||||||
I took the lazy route to solve this problem by using s_title and b_title (which I commented out in their usual locations) as new text entry variables for 2nd shipping and billing address lines. It works, but I've yet to crack the problem cited by xcell67 above. X-Cart is filling in s_title with the value in b_title when s_title is missing, and my newbie attempts to write logic to to prevent this have failed.
Question: When I go back to modify address info as entered from my site after submitting it, X-Cart has filled in the missing shipping variables with what it finds in the billing variables. In what part of the code is this substitution taking place? Anyone know how to modify that code to pull off the type of conditional substitution described by xcell67? And X-Cart developers, if you're reading, I love your product but this is a highly needed feature. |
|||||||||
#15
|
|||||||||
|
|||||||||
To answer my own question above (originally asked by xcell67), here's the necessary logic to have two-line address entry that correctly deals with differences in the shipping and billing address (1 vs. 2 line address).
In includes/register.php, find the section below and modify it as shown in the comments with the designation VJ. I first modified register_billing_address.tpl and register_shipping_address.tpl to use company as the second billing address line and fax as the second shipping address line, but if you used different variables, adjust the code below accordingly. With this code, a customer can enter two address lines in the billing address and one address line in the shipping address, and not have the second billing address line automatically added to the shipping address (as would happen if you used s_title and b_title, as I had originally). A missing shipping address will still be copied correctly in full. Code:
|
|||||||||
#16
|
|||||||||
|
|||||||||
nice work! this is a quick and easy mod
you'll also need to modify customer/main/customer_details.tpl and the e-mails
__________________
X-Cart Gold 4.0.17 & 4.0.18 Linux Server Hands-On Hosting http://www.CoreCases.com - Ipod Cases http://www.InnovativeOutlet.com - Pet Plants and other cool stuff you need |
|||||||||
#17
|
|||||||
|
|||||||
I've had this mod running for a while, but I have one issue with the mod....
In my order invoice, I use the line... {$order.s_address2} The problem is that if someone doesn't have a second address line, the line is left blank. For Example: John Does 111 John Lane John, MN 11111 Is there an if else statement I can write into the template to make it so the line appears only if it isn't blank? For example a statement that does this... { if address line two contains data } display data {else} don't display line {if} Thanks for any help. |
|||||||
#18
|
|||||||||
|
|||||||||
Yeah, I should have been more complete in my post. In customer_details.tpl, use something like this. I used the variable company for the 2nd address line, but if you did something else, change this code accordingly:
Code:
|
|||||||||
#19
|
|||||||
|
|||||||
That did it! Many thanks.
-Bradley |
|||||||
#20
|
|||||||
|
|||||||
ok, I must be doing something (luckly i backed up the two .php files) because when i copied and pasted the new additions into the two files listed earlier in this post my store would no long show up...
I am guessing that there is not an easier way to do any of this but why hasn't x-cart made this simpler to do?! It's seams to be a very vital part to be edited by each diffrent store... I have alot of modifcations to do to the registration page could someone repost a complete and accurate listing of what it shown above? if all else fails i would be willing to offer payment (not a ton but some $$ worth your time) for someone that can help or do this and a few other mods for me... -adam mccombs
__________________
x-cart version 3.5.10 |
|||||||
|
|||
X-Cart forums © 2001-2020
|