Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Cant add address to the register.php page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 10-30-2012, 02:38 PM
 
tagteam tagteam is offline
 

eXpert
  
Join Date: Jan 2012
Posts: 227
 

Default Re: Cant add address to the register.php page

Ha Ha sorry, I was watching the Arsenal v Reading Capital One match and not paying attention. I see they are different, so still just wondering where to put that code.
Thanks
__________________
Version 4.7.8
Reply With Quote
  #22  
Old 11-11-2012, 01:34 PM
 
Chrisweb2 Chrisweb2 is offline
 

Member
  
Join Date: Feb 2008
Posts: 10
 

Default Re: Cant add address to the register.php page

My address_book.php file has the below on line 76

Code:
} elseif ($current_area != 'C') {

after the closing tag on line 87 I just added

Code:
elseif ($current_area == 'C' && !empty($address_book)) { $address_book = func_customer_save_address_book_indb($address_book, @$ship2diff, @$existing_address, @$new_address); }
__________________
X-Cart Gold 4.4.5
Reply With Quote
  #23  
Old 07-11-2014, 01:48 AM
 
Ben G Ben G is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 100
 

Default Re: Cant add address to the register.php page

Thanks to all for contributing this code.

After hours of trying work through this step on 4.6.3 with no luck, I disabled Email Account Activation. As soon as it was disabled, the code worked perfectly - thanks.

As a wholesale only site, I by default have all new registrations set to suspended (waiting for our admin approval before being active).

Does anyone know how to work this into the Email Account Activation module?
__________________
Ben
X-Cart 4.6.6 Gold Plus - lots of modules
X-Cart 4.7.9 Gold Plus - lots of modules
Reply With Quote
  #24  
Old 07-25-2014, 05:36 AM
  mcanitano's Avatar 
mcanitano mcanitano is offline
 

eXpert
  
Join Date: Feb 2006
Location: Melbourne, FL
Posts: 216
 

Default Re: Cant add address to the register.php page

We've added the code to all three required files:

include/register.php
include/address_book.php
skin/common_files/customer/main/register.tpl

It now registers the customer's address with the address book during registration, but while a customer is logged in and they go to view the "My Account" page, the address fields are missing, and it shows this section (see attached photo also):

Code:
Billing address Save as a new address Update existing address Ship to a different address


We are using X-Cart v4.5.5
Attached Thumbnails
Click image for larger version

Name:	myaccount.png
Views:	242
Size:	13.1 KB
ID:	3842  
__________________
Marcello Canitano
New Site: X-Cart v4.5.5 GOLD
X-Cart Mobile v1.4.3
X-Payments v1.0.6
CDSEO Pro v2
Total Server Solutions xCDN

www.silverhorseracing.com
Reply With Quote
  #25  
Old 07-26-2014, 04:15 AM
 
Ben G Ben G is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 100
 

Default Re: Cant add address to the register.php page

The missing address fields according my Webmaster mode is from customer/main/register_address_fields.tpl - see Alex's code below (from page 1 of this thread).

Quote:
Originally Posted by qualiteam
This is possible, but a slight modification is required:

1. alter the "skin/common_files/customer/main/register.tpl" template and replace this code:
Code:
{include file="customer/main/register_address_info.tpl"}
with this:
Code:
{include file="customer/main/register_address_info.tpl" need_address_info='Y'}

2. add corresponding smarty assign statement in "include/register.php" script.

PHP Code:
$smarty->assign('address_fields'$address_fields); 

I don't see this file in your list of modified files.

Sounds like you missed this one or you applied to just the common files.
If you are using a custom skin (e.g. Ideal Responsive) you need to make the change to
Quote:
ideal_responsive/customer/main/register_address_fields.tpl

Any other skin changes in the code mentioned also need to be made to your custom skin files (if they exist), not just common files.

I just registered a test customer on my site and can confirm the code does work properly in 4.6.3.

Hope it helps.
__________________
Ben
X-Cart 4.6.6 Gold Plus - lots of modules
X-Cart 4.7.9 Gold Plus - lots of modules
Reply With Quote
  #26  
Old 07-26-2014, 04:44 AM
  ADDISON's Avatar 
ADDISON ADDISON is offline
 

X-Man
  
Join Date: Jan 2008
Posts: 2,613
 

Default Re: Cant add address to the register.php page

Address Book in XC is like a pain in the ass. Over the years I recommended to write a module from scratch to allow add/remove/change in Address Book (field type, position). Also I recommended when creating a new field to select its destination: Contact, Shipping/Billing. Imagine you have two type of customers with different registration fields, how can you do it by default? You simply can't. There are at least 2 shopping carts which allow a true Address Book. If it cannot be implemented someone could create it as a module. Sad to see in year 2014 such of issues. Sorry guys!
__________________
X-Cart Next: Business 5.2 (learning and testing)
X-Cart Classic: Gold and Gold Plus 4.7
Lots of Modules and Customizations
OS in use: Red Hat Enterprise, Fedora, CentOS, Debian, Ubuntu, Linux Mint, Kali Linux
Ideas for Server configuration (basicaly): Nginx/Pound (reverse proxy), Apache/Nginx (webserver), Squid/Varnish (cache server), HHVM or (PHP-FPM + PHP 5.6 + opcache), MariaDB/Percona MySQL Server, Redis (storing sessions)

You can catch my ideas here: http://ideas.x-cart.com
Reply With Quote
  #27  
Old 07-28-2014, 10:38 AM
 
designguru designguru is offline
 

X-Adept
  
Join Date: Dec 2010
Posts: 418
 

Default Re: Cant add address to the register.php page

Did anyone finally get this working properly?

It's amazing that in 2014 such simple things are coming around like a huge problem and needs custom coding

What I found out more and more: X-Cart 4.x is programmed more by technical ascpects without thinking too much about usability. That is the main case why leading design and theme pages do not list x-cart.

Just think about 5000 lines of css and still write css into tpl files which makes it a pain to edit

Sorry, for the off-topic part, but it's frustrating some times.
__________________
X-Cart Pro 4.6.2 with many modules
X-CART Pro 4.4.1
Reply With Quote
  #28  
Old 08-20-2014, 12:29 PM
  mcanitano's Avatar 
mcanitano mcanitano is offline
 

eXpert
  
Join Date: Feb 2006
Location: Melbourne, FL
Posts: 216
 

Default Re: Cant add address to the register.php page

How do you hide the Billing/Shipping address fields when a customer has already registered, is logged in and updating their current profile on the 'My Account' tab?


Code:
www.example.com/register.php?mode=update

EDIT:

I was simply lazy and figured it out, in customer/main/register_address_info.tpl:


Change
Code:
{if $need_address_info}

to
Code:
{if $need_address_info and !$login}
__________________
Marcello Canitano
New Site: X-Cart v4.5.5 GOLD
X-Cart Mobile v1.4.3
X-Payments v1.0.6
CDSEO Pro v2
Total Server Solutions xCDN

www.silverhorseracing.com
Reply With Quote
  #29  
Old 04-25-2015, 08:26 AM
 
ppi ppi is offline
 

Newbie
  
Join Date: Jan 2015
Posts: 4
 

Default Re: Cant add address to the register.php page

Okay, I feel like I'm a second from getting this right...

I followed the following instructions / suggestions

1) Added the following code to skin/common_files/customer/main/register.tpl
Quote:
{include file="customer/main/register_address_info.tpl" need_address_info='Y'}

2) Added the following code to include/register.php
Quote:
if (empty($userinfo)) {
$smarty->assign('address_fields', $address_fields);
}
Beneath this code
Quote:
$smarty->assign('is_areas', $is_areas);

At this point the fields show, but they don't post to the address book, so I added this code as suggested below the code above in include/register.php
Quote:
} elseif ($current_area == 'C' && !empty($address_book)) {
$address_book = func_customer_save_address_book_indb($address_book , @$ship2diff, @$existing_address, @$new_address);
}

Upon adding that the registration page would not load at all, so I removed it, and continued onto the suggestion of adding that last bit of code to include/address_book.php

The page loads, the fields show, but I'm still at the point that the data entered into the address fields does not show up in the address book.

I've gone through this thread from top to bottom and back again, and I'm stumped as to what I missed Help?

Gina
x-cart v4.6.5
__________________
4.6
Reply With Quote
  #30  
Old 06-05-2015, 04:17 AM
 
Carzilla Carzilla is offline
 

Advanced Member
  
Join Date: May 2012
Posts: 39
 

Default Re: Cant add address to the register.php page

Hello Gina,

I've had the same problem as you had, I added all the code everyone suggested, but alas the addres book didn't get updated.

I've solved it now - albeit not perfect - but it works good enough for me.

In include/address_book.php, add:

Code:
elseif (!empty($address_book)) { func_admin_save_address_book($address_book, $newuser_info['id'], $address_book_additional_values); }

After the "elseif ($current_area != 'C')" block.

Now it saves the data! The only problem is that the user still has this one 'empty' address book entry... but that's a problem for another day.

Too bad X-Cart itself doesn't really solve this problem. With all due respect, this is core functionality in 2015.
__________________
X-Cart 4.6.2
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 12:04 PM.

   

 
X-Cart forums © 2001-2020