function fetchUserCountry() { // Get country saved in user preferences. $country = eZShopFunctions::getPreferredUserCountry(); if ( !$country ) { // If not found, get country from user object // and save it to the preference. $country = eZShopFunctions::getUserCountry(); if ( $country ) eZShopFunctions::setPreferredUserCountry( $country ); } return array( 'result' => $country ); }
$root->appendChild($placeNode); $stateNode = $doc->createElement("state", $state); $root->appendChild($stateNode); $countryNode = $doc->createElement("country", $country); $root->appendChild($countryNode); $commentNode = $doc->createElement("comment", $comment); $root->appendChild($commentNode); $collectNode = $doc->createElement("collect", $collect); $root->appendChild($collectNode); $xmlString = $doc->saveXML(); $order->setAttribute('data_text_1', $xmlString); $order->setAttribute('account_identifier', "twrv2"); $order->setAttribute('ignore_vat', 0); $order->store(); $db->commit(); eZShopFunctions::setPreferredUserCountry($country); $http->setSessionVariable('MyTemporaryOrderID', $order->attribute('id')); $module->redirectTo('/shop/confirmorder/'); return; } else { $tpl->setVariable("input_error", true); } } $tpl->setVariable("first_name", $firstName); $tpl->setVariable("last_name", $lastName); $tpl->setVariable("email", $email); $tpl->setVariable("street1", $street1); $tpl->setVariable("street2", $street2); $tpl->setVariable("zip", $zip); $tpl->setVariable("place", $place); $tpl->setVariable("state", $state);