本文整理匯總了PHP中SpecificPrice::ppInit方法的典型用法代碼示例。如果您正苦於以下問題:PHP SpecificPrice::ppInit方法的具體用法?PHP SpecificPrice::ppInit怎麽用?PHP SpecificPrice::ppInit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類SpecificPrice
的用法示例。
在下文中一共展示了SpecificPrice::ppInit方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: IN
`id_shop` IN(0, ' . (int) $id_shop . ') AND
`id_currency` IN(0, ' . (int) $id_currency . ') AND
`id_country` IN(0, ' . (int) $id_country . ') AND
`id_group` IN(0, ' . (int) $id_group . ') AND
`id_customer` IN(0, ' . (int) $id_customer . ')
AND
(
(`from` = \'0000-00-00 00:00:00\' OR \'' . $now . '\' >= `from`)
AND
(`to` = \'0000-00-00 00:00:00\' OR \'' . $now . '\' <= `to`)
)
ORDER BY `from_quantity` ASC, `id_specific_price_rule` ASC, `score` DESC
');
$targeted_prices = array();
$last_quantity = array();
foreach ($res as $specific_price) {
if (!isset($last_quantity[(int) $specific_price['id_product_attribute']])) {
$last_quantity[(int) $specific_price['id_product_attribute']] = $specific_price['from_quantity'];
} elseif ($last_quantity[(int) $specific_price['id_product_attribute']] == $specific_price['from_quantity']) {
continue;
}
$last_quantity[(int) $specific_price['id_product_attribute']] = $specific_price['from_quantity'];
if ($specific_price['from_quantity'] > PP::getSpecificPriceFromQty((int) $id_product)) {
$targeted_prices[] = $specific_price;
}
}
return $targeted_prices;
}
}
SpecificPrice::ppInit();