本文整理匯總了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'.