Dear All,
I have a COPY button with the following code inside.
The aim is to copy the invoice address into shipping address.
Everything works well but at the end SC do not write data to destination shipping fields :
{ShipName} = {address_string[0][0]};
{ShipAddress} = {address_string[0][1]}; {ShipCity} = {address_string[0][2]}; {ShipRegion} = {address_state[0][0]};
{ShipPostalCode} = {address_string[0][3]}; {ShipCountry} = {address_country[0][0]};
What I’m wronging ? Why eco has all the right values but final assignment do not work ?
Has I to use SQL command UPDATE ?
Bye
Giovannino
//Copy all data about customer into Ship to fields
$check_sql = "SELECT CompanyName, Address, City, State, PostalCode, Country FROM customers WHERE CustomerID = ". {CustomerID} ;
sc_lookup(address_string, $check_sql);
echo " RAG SOC " . {address_string[0][0]} ;
if (isset({address_string[0][0]})) // Row found
{
$check_sql_state = “SELECT description FROM counties where county_ID =”. {address_string[0][3]} ;
sc_lookup(address_state, $check_sql_state);
echo " <br/> STATO " . {address_state[0][0]} ;
$check_sql_country = “SELECT description FROM countries where country_ID =”. {address_string[0][5]} ;
sc_lookup(address_country, $check_sql_country);
echo " <br/> NAZIONE " . {address_country[0][0]} ." - “.{address_string[0][1]}.” - “.
{address_string[0][2]}.” - “. {address_state[0][0]}.” - “.{address_string[0][3]}.” - ". {address_country[0][0]};
{ShipName} = {address_string[0][0]};
{ShipAddress} = {address_string[0][1]}; {ShipCity} = {address_string[0][2]}; {ShipRegion} = {address_state[0][0]};
{ShipPostalCode} = {address_string[0][3]}; {ShipCountry} = {address_country[0][0]};
echo " <br/> Ship name e address ". {ShipName}. " - " .{ShipAddress} ;
}
else // No row found
{
sc_alert(“Attenzione dati Cliente non esistenti !!”);
}