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

Save Multiple Ship-to Addresses Completed

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 02-02-2006, 03:19 PM
 
electronics4less electronics4less is offline
 

Advanced Member
  
Join Date: Jul 2005
Posts: 38
 

Default

I think I have a fix for this..I will post as soon as I test it out.
__________________
X-cart v4.0.8
Reply With Quote
  #32  
Old 02-26-2006, 03:59 PM
 
wicnz wicnz is offline
 

Newbie
  
Join Date: Nov 2005
Posts: 4
 

Default Missing alternate profiles

I think there is something missing from the quoted Javascript for register_contact_info.tpl

I cannot see how/where alt_profiles is populated to allow the drop-down boxes to populate.

I have applied this mod, can create the alternate shipping profiles, but they never appear in the drop-down lists.

This is with XCart Gold 4.0.16

Thanks for any assistance.
Regards,
Stu
__________________
WIC NZ Ltd. IT Management, Web hosting and co-location.
Reply With Quote
  #33  
Old 07-12-2006, 01:46 AM
 
xcell67 xcell67 is offline
 

Senior Member
  
Join Date: Dec 2003
Posts: 149
 

Default

Doesn't work for me either. I didn't get any errors but this is what happens. I register an account and then go to the modify page. I change the address, and then click on submit. Then I wait for it to reload, and I click on create saved profile. Clicking on that takes me to register.php?mode=update?action=cart. The address is not saved into the dropdown.

I tried this on 4.1.2.
Reply With Quote
  #34  
Old 07-22-2006, 07:27 AM
 
mrkenzie mrkenzie is offline
 

Senior Member
  
Join Date: May 2006
Posts: 182
 

Default

Has anyone gotten this to work? I am getting the following error:

Quote:
PHP Notice: Undefined variable: createAltFunc in C:\wwwxcart\createAlt.php on line 17 PHP Notice: Undefined variable: createAltFunc in C:\wwwxcart\createAlt.php on line 74 PHP Notice: Undefined variable: createAltFunc in C:\wwwxcart\createAlt.php on line 155

This is in 4.1.0.

It is like the information is not posting to createAlt.php. I can not figure out what is wrong.

THanks.
__________________
Mike Kenzie
X Cart Gold Ver. 4.1.3
X-RMA
X-AOM
X-Product Comparison
Reply With Quote
  #35  
Old 07-26-2006, 05:47 AM
 
manningbrothers manningbrothers is offline
 

Advanced Member
  
Join Date: Feb 2006
Posts: 52
 

Default Question

Hi - has anyone gotten this to work on 4.1 as of yet? And if so what did you do to get this to work?

This is a great mod and would be very useful on my site!
__________________
X-Cart version 4.3.2, 4.4.2, Windows OS
Reply With Quote
  #36  
Old 06-18-2007, 12:06 PM
  rubberneck's Avatar 
rubberneck rubberneck is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 161
 

Default Re: Save Multiple Ship-to Addresses Completed

Is there a working version of this for 4.1.7? We really need this one in one of our carts.

thanks.
__________________
--
Version 4.0.17 Gold
Version 4.1 Gold
Version 4.4 Gold
Reply With Quote
  #37  
Old 08-17-2007, 09:20 PM
  rubberneck's Avatar 
rubberneck rubberneck is offline
 

Senior Member
  
Join Date: Feb 2003
Posts: 161
 

Default Re: Save Multiple Ship-to Addresses Completed

Bump. Anyone figured this out?
__________________
--
Version 4.0.17 Gold
Version 4.1 Gold
Version 4.4 Gold
Reply With Quote
  #38  
Old 03-20-2008, 05:04 PM
 
hal@dbswebsite.com hal@dbswebsite.com is offline
 

Member
  
Join Date: Mar 2008
Posts: 12
 

Default Re: Save Multiple Ship-to Addresses Completed

This is what I did on 4.1.9 to make it work (sorry if it wraps). I'm new at xcart so I am winging this.

First, the queries to populate the selectboxes are nowhere in this thread. This is what I have near the end of register.php:

Code:
$alt_profile_names = func_query_column("select s_address from xcart_shipping_addresses where login = '$userinfo[login]'"); if(is_array($alt_profile_names)) $smarty->assign("alt_profile_names",$alt_profile_names); $alt_profiles = func_query_column("select profile from xcart_shipping_addresses where login = '$userinfo[login]'"); if(is_array($alt_profiles)) $smarty->assign('alt_profiles',$alt_profiles);


I had to make several changes to createAlt.php:

Code:
<?php require "top.inc.php"; require "config.php"; // HB 2008-03-19, we need to initialize xcart. require_once('init.php'); db_connect($sql_host, $sql_user, $sql_password); // HB 2008-03-19, this variable was not set. $createAltFunc = $_POST['createAltFunc']; if (!isset($createAltFunc)) die('Post Error for CreateAltFunc'); if($createAltFunc == "create"){ Header("Content-type: text/html"); #$my_alt = array_pop(func_query_first("select max(profile) from alt_profiles where login='$uname'")); #if($my_alt == null){ # $my_alt = 0; #} // first write the existing data to alt_profiles in the appropriate place $data = func_query_first("select * from xcart_customers where login='$uname'"); $profile = func_query_first("select max(profile) as max from xcart_shipping_addresses where login='$uname'"); #$profile0 = 0 + $profile[max]; $profile0 = 0 + $data[profile]; $profile1 = $profile0 + 1 + $profile[max]; foreach($data as $me => $crap){ #print "ME $me $crap"; } db_query("update xcart_customers set profile=$profile1 where login='$uname'"); //db_query("delete from xcart_shipping_addresses where login='$uname' and profile=$profile0"); //db_query("insert into xcart_shipping_addresses (login, profile, firstname, lastname, s_address, s_city, s_state, s_country, s_zipcode ) values ('$uname', $profile0, '$data[firstname]','$data[lastname]', '$data[s_address]','$data[s_city]','$data[s_state]','$data[s_country]','$data[s_zip code]')"); db_query("insert into xcart_shipping_addresses (login, profile, s_firstname, s_title, s_lastname, s_address, s_city, s_state, s_country, s_zipcode ) values ('$uname', $profile1, '$s_firstname', '$s_title' , '$s_lastname', '$s_address\n$s_address_2', '$s_city','$s_state','$s_country','$s_zipcode')"); //db_query(); //Header("Location: register.php?mode=update&action=cart"); //switch to this profile #Header("Content-type: text/html"); $sdata = db_query("select * from xcart_sessions_data"); while ($row = db_fetch_array($sdata)) { $mdata = unserialize($row[data]); #print "$mdata[login] $row[sessid]"; if($mdata[login] == $uname){ $mdata[s_firstname] = $data[s_firstname]; $mdata[s_lastname] = $data[s_lastname]; $mdata[s_title] = $data[s_title]; $sessid = $row[sessid]; $new; foreach($mdata as $key => $value){ #print "MDATA $key $mdata[$key]"; if($key != "extended_userinfo"){ $new[$key] = $value; } else{ $edata = unserialize($mdata[$key]); $edata[s_firstname] = $data[s_firstname]; $edata[s_lastname] = $data[s_lastname]; $edata[s_title] = $data[s_title]; $new[$key] = serialize($edata); } } db_query("update xcart_sessions_data set data = '".serialize($new)."' where sessid='$sessid' "); #break; } } #//Header ("Location: createAlt.php?createAltFunc=switch&switchProfile=$profile0&uname=$uname" ); Header("Location: register.php?mode=update&action=cart"); } elseif($createAltFunc == "switch"){ // save data to alt_profile on switch // write current profile back to alt_profiles // get the data $data = func_query_first("select * from xcart_customers where login='$uname'"); // save the data // but first check to make sure the record exists $exists = array_pop(func_query_first("select count(*) from xcart_shipping_addresses where login='$uname' and profile=$data[profile]")); if($exists == 0){ db_query("insert into xcart_shipping_addresses (login, profile) values ('$uname', $data[profile])"); } // foreach($data as $key => $value){ // HB, 2008-03-20, spits errors, and do we need this ???? // db_query("update xcart_shipping_addresses set $key='$value' where login='$uname' and profile=$data[profile]"); // } // then copy the desired profile's data over the old $data = func_query_first("select * from xcart_shipping_addresses where login='$uname' and profile=$switchProfile"); foreach($data as $key => $value){ if($key == "profile"){ db_query("update xcart_customers set profile=$value where login='$uname'"); } // HB 2008-03-20, added 'addr_id' elseif($key == "s_firstname" || $key == "s_lastname" || $key == "s_title" || $key == 'addr_id'){ //dont need to run these into main db } else{ db_query("update xcart_customers set $key='$value' where login='$uname'"); } } // now update the session #Header("Content-type: text/html"); $sdata = db_query("select * from xcart_sessions_data"); while ($row = db_fetch_array($sdata)) { $mdata = unserialize($row[data]); #print "$mdata[login] $row[sessid]"; if($mdata[login] == $uname){ $new; $sessid = $row[sessid]; foreach($mdata as $key => $value){ #print "MDATA $key $mdata[$key]"; if($key != "extended_userinfo"){ //HB 2008-03-20, addslashes. $new[$key] = addslashes($value); } else{ $edata = unserialize($mdata[$key]); foreach($mdata as $ekey => $eval){ if($key == "extended_userinfo"){ foreach($eval as $euikey => $euival){ #print "EUIkey $euikey value $euival"; if($euikey == "s_firstname"){ #print "VAL FOUND $eval[$euikey]"; $eval[$euikey] = $data[s_firstname]; } if($euikey == "s_lastname"){ #print "VAL FOUND $eval[$euikey]"; $eval[$euikey] = $data[s_lastname]; } if($euikey == "s_title"){ #print "VAL FOUND $eval[$euikey]"; $eval[$euikey] = $data[s_title]; } } } $edata[$ekey] = $eval; #print "key $ekey value $eval"; } #$edata[s_firstname] = $data[s_firstname]; #$edata[s_lastname] = $data[s_lastname]; #$edata[s_title] = $data[s_title]; $new[$key] = serialize($edata); } } db_query("update xcart_sessions_data set data = '".serialize($new)."' where sessid='$sessid' "); #break; } } #Header("Content-type: text/html"); Header("Location: register.php?mode=update&action=cart"); } elseif($createAltFunc == "delete"){ db_query("delete from xcart_shipping_addresses where login='$uname' and profile=$deleteProfile"); Header("Location: register.php?mode=update&action=cart"); } ?>

That may have gotten mangled.

I don't remember anything else signficant.

I did move the "Create New Profile" button from after the main submit button, to up where it makes more sense in the form. Seems to work fine there, though I have not really tested any of this much.

Thanks for the original post. Saved me beaucoup time.
__________________
Hal v5.7
xcart v4.1.9
Reply With Quote
  #39  
Old 04-25-2008, 02:14 PM
 
feeble_fuel feeble_fuel is offline
 

Member
  
Join Date: Mar 2008
Posts: 27
 

Default Re: Save Multiple Ship-to Addresses Completed

This looks like a great mod and would like to implement. I was wondering if there is full clean code/instructions for this mod somewhere for 4.1.9?

Is there somewhere where you can download mods in a contained .zip folder and a version tracker?

I've seen this for other open source products but haven't come across it here.

Thanks!
__________________
Kelly

X-Cart DB Version: 4.1.9 GOLD
- X-AOM (Advanced Order Management)

Reply With Quote
  #40  
Old 04-26-2008, 10:15 AM
 
l0st l0st is offline
 

Advanced Member
  
Join Date: Mar 2008
Posts: 69
 

Default Re: Save Multiple Ship-to Addresses Completed

yeah I'd like to use this too.
__________________
X-Cart Gold v. 4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 10:55 PM.

   

 
X-Cart forums © 2001-2020