本文整理汇总了PHP中eZShopFunctions::isSimplePriceClass方法的典型用法代码示例。如果您正苦于以下问题:PHP eZShopFunctions::isSimplePriceClass方法的具体用法?PHP eZShopFunctions::isSimplePriceClass怎么用?PHP eZShopFunctions::isSimplePriceClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZShopFunctions
的用法示例。
在下文中一共展示了eZShopFunctions::isSimplePriceClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
// script initializing
require 'autoload.php';
global $cli;
global $currencyList;
$currencyList = false;
$cli = eZCLI::instance();
$script = eZScript::instance(array('description' => "\n" . "This script will convert objects with 'price' datatype to\n" . "the objects with 'multiprice' datatype.\n", 'use-session' => false, 'use-modules' => true, 'use-extensions' => true, 'user' => true));
$script->startup();
$scriptOptions = $script->getOptions("", "", array(), false, array('user' => true));
$script->initialize();
$convertedObjectsCount = 0;
$classList = eZContentClass::fetchList();
$db = eZDB::instance();
$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'.