本文整理汇总了PHP中Mage_Sales_Model_Quote::getAppliedRuleIds方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote::getAppliedRuleIds方法的具体用法?PHP Mage_Sales_Model_Quote::getAppliedRuleIds怎么用?PHP Mage_Sales_Model_Quote::getAppliedRuleIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Model_Quote
的用法示例。
在下文中一共展示了Mage_Sales_Model_Quote::getAppliedRuleIds方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPoints
/**
* Retrieve points delta for action
*
* @param int $websiteId
* @return int
*/
public function getPoints($websiteId)
{
$pointsDelta = 0;
if ($this->_quote) {
// known issue: no support for multishipping quote // copied comment, not checked
if ($this->_quote->getAppliedRuleIds()) {
$ruleIds = explode(',', $this->_quote->getAppliedRuleIds());
$ruleIds = array_unique($ruleIds);
$data = Mage::getResourceModel('enterprise_reward/reward')->getRewardSalesrule($ruleIds);
foreach ($data as $rule) {
$pointsDelta += (int) $rule['points_delta'];
}
}
}
return $pointsDelta;
}
示例2: toOrder
/**
* Convert quote model to order model
*
* @param Mage_Sales_Model_Quote $quote
* @return Mage_Sales_Model_Order
*/
public function toOrder(Mage_Sales_Model_Quote $quote, $order = null)
{
if (!$order instanceof Mage_Sales_Model_Order) {
$order = Mage::getModel('sales/order');
}
/* @var $order Mage_Sales_Model_Order */
$order->setStoreId($quote->getStoreId())->setQuoteId($quote->getId())->setRemoteIp($quote->getRemoteIp())->setCustomerId($quote->getCustomerId())->setCustomerEmail($quote->getCustomerEmail())->setCustomerFirstname($quote->getCustomerFirstname())->setCustomerLastname($quote->getCustomerLastname())->setCustomerGroupId($quote->getCustomerGroupId())->setCustomerTaxClassId($quote->getCustomerTaxClassId())->setCustomerNote($quote->getCustomerNote())->setCustomerNoteNotify($quote->getCustomerNoteNotify())->setCustomerIsGuest($quote->getCustomerIsGuest())->setBaseCurrencyCode($quote->getBaseCurrencyCode())->setStoreCurrencyCode($quote->getStoreCurrencyCode())->setOrderCurrencyCode($quote->getQuoteCurrencyCode())->setStoreToBaseRate($quote->getStoreToBaseRate())->setStoreToOrderRate($quote->getStoreToQuoteRate())->setCouponCode($quote->getCouponCode())->setGiftcertCode($quote->getGiftcertCode())->setIsVirtual($quote->getIsVirtual())->setIsMultiPayment($quote->getIsMultiPayment())->setAppliedRuleIds($quote->getAppliedRuleIds());
Mage::dispatchEvent('sales_convert_quote_to_order', array('order' => $order, 'quote' => $quote));
return $order;
}
示例3: _getQuoteRewardsRuleIds
/**
*
* @param Mage_Sales_Model_Quote $quote
*/
protected function _getQuoteRewardsRuleIds($quote)
{
$all_rule_ids = explode(',', $quote->getAppliedRuleIds());
$all_rr_ids = array();
foreach ($all_rule_ids as $rule_id) {
$salesrule = $this->getRule($rule_id);
if ($salesrule->isPointsRule()) {
$all_rr_ids[] = $rule_id;
}
}
return $all_rr_ids;
}