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