本文整理匯總了PHP中eZShopFunctions::priceAttribute方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZShopFunctions::priceAttribute方法的具體用法?PHP eZShopFunctions::priceAttribute怎麽用?PHP eZShopFunctions::priceAttribute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZShopFunctions
的用法示例。
在下文中一共展示了eZShopFunctions::priceAttribute方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: priceAttributeIdentifier
static function priceAttributeIdentifier($productClass)
{
$identifier = '';
$classAttribute = eZShopFunctions::priceAttribute($productClass);
if (is_object($classAttribute)) {
$identifier = $classAttribute->attribute('identifier');
}
return $identifier;
}
示例2: foreach
$db->begin();
foreach ($classList as $class) {
if (eZShopFunctions::isSimplePriceClass($class)) {
$classID = $class->attribute('id');
$objectListCount = eZContentObject::fetchSameClassListCount($classID);
if ($objectListCount == 0) {
$cli->output("No objects found for '" . $class->attribute('name') . "' class");
continue;
}
$cli->output("Processing objects of the '" . $class->attribute('name') . "' class");
$defaultCurrency = currencyForLocale();
if (!$defaultCurrency) {
$script->shutdown(1);
}
$defaultCurrencyCode = $defaultCurrency->attribute('code');
$priceClassAttribute = eZShopFunctions::priceAttribute($class);
$priceClassAttributeID = $priceClassAttribute->attribute('id');
// replace 'ezprice' class attribute with 'ezmultiprice'.
$priceClassAttribute->setAttribute('data_type_string', 'ezmultiprice');
$priceClassAttribute->setAttribute(eZMultiPriceType::DEFAULT_CURRENCY_CODE_FIELD, $defaultCurrencyCode);
$priceClassAttribute->store();
unset($GLOBALS['eZContentClassAttributeCache'][$priceClassAttributeID]);
// update objects
$offset = 0;
$limit = 1000;
$cli->output('Converting', false);
while ($offset < $objectListCount) {
$objectList = eZContentObject::fetchSameClassList($class->attribute('id'), true, $offset, $limit);
$offset += count($objectList);
foreach ($objectList as $object) {
$contentObjectID = $object->attribute('id');