本文整理匯總了PHP中eZShopFunctions::setPreferredUserCountry方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZShopFunctions::setPreferredUserCountry方法的具體用法?PHP eZShopFunctions::setPreferredUserCountry怎麽用?PHP eZShopFunctions::setPreferredUserCountry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZShopFunctions
的用法示例。
在下文中一共展示了eZShopFunctions::setPreferredUserCountry方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: fetchUserCountry
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 );
}
示例2:
$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);