本文整理汇总了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);