本文整理汇总了PHP中Mage_Sales_Model_Quote_Address类的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Model_Quote_Address类的具体用法?PHP Mage_Sales_Model_Quote_Address怎么用?PHP Mage_Sales_Model_Quote_Address使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Mage_Sales_Model_Quote_Address类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _processGiftRules
/**
* Process the gift rules
*
* @param Mage_Sales_Model_Quote_Address $address
*/
protected function _processGiftRules($address)
{
$quote = $address->getQuote();
$store = Mage::app()->getStore($quote->getStoreId());
$validator = Mage::getSingleton('gift/rule_validator')->init($store->getWebsiteId(), $quote->getCustomerGroupId());
$validator->process($address);
}
示例2: fetch
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
if ($address->getDamageWaiverAmount() > 0) {
$address->addTotal(array('code' => $this->getCode(), 'title' => $this->getLabel(), 'value' => $address->getDamageWaiverAmount()));
}
return $this;
}
示例3: fetch
/**
* Add convenienceservice information to address
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Magentix_Convenienceservice_Model_Sales_Quote_Address_Total_Convenienceservice
*/
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
$amount = $address->getConvenienceserviceAmount();
$convenienceservicechargepercentage = Mage::getStoreConfig('convenience/convenience_group/convenienceservicechargepercentage');
$address->addTotal(array('code' => $this->getCode(), 'title' => Mage::helper('convenienceservice')->__("Service Tax ({$convenienceservicechargepercentage}% of Conv. Fee)"), 'value' => $amount));
return $this;
}
示例4: _saveAppliedTaxes
protected function _saveAppliedTaxes(Mage_Sales_Model_Quote_Address $address, $applied, $amount, $baseAmount, $rate)
{
$previouslyAppliedTaxes = $address->getAppliedTaxes();
$process = count($previouslyAppliedTaxes);
foreach ($applied as $row) {
if (!isset($previouslyAppliedTaxes[$row['id']])) {
$row['process'] = $process;
$row['amount'] = 0;
$row['base_amount'] = 0;
$previouslyAppliedTaxes[$row['id']] = $row;
}
if (!is_null($row['percent'])) {
$row['percent'] = $row['percent'] ? $row['percent'] : 1;
$rate = $rate ? $rate : 1;
$appliedAmount = $amount;
$baseAppliedAmount = $baseAmount;
} else {
$appliedAmount = 0;
$baseAppliedAmount = 0;
foreach ($row['rates'] as $rate) {
$appliedAmount += $rate['amount'];
$baseAppliedAmount += $rate['base_amount'];
}
}
if ($appliedAmount || $previouslyAppliedTaxes[$row['id']]['amount']) {
$previouslyAppliedTaxes[$row['id']]['amount'] = $appliedAmount;
$previouslyAppliedTaxes[$row['id']]['base_amount'] = $baseAppliedAmount;
} else {
unset($previouslyAppliedTaxes[$row['id']]);
}
}
$address->setAppliedTaxes($previouslyAppliedTaxes);
}
示例5: _isAddressActionable
/**
* Check if address actionable to calculate tax
*
* @param Mage_Sales_Model_Quote_Address $address
* @return bool
*/
protected function _isAddressActionable($address)
{
/** @var OnePica_AvaTax_Helper_Data $helper */
$helper = Mage::helper('avatax');
$storeId = $address->getQuote()->getStoreId();
return $helper->isAddressActionable($address, $storeId, OnePica_AvaTax_Model_Config::REGIONFILTER_TAX);
}
示例6: collect
/**
* Prepare Data to Storage for Order
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Magestore_Webpos_Model_Total_Quote_Cash
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
$quote = $address->getQuote();
$cashin = Mage::getSingleton('webpos/session')->getWebposCash();
if ($cashin && $cashin <= 0) {
return $this;
}
$baseCashin = $cashin / $quote->getStore()->convertPrice(1);
$quote->setWebposCash($cashin);
$quote->setWebposBaseCash($baseCashin);
if (!$quote->isVirtual() && $address->getAddressType() == 'billing') {
return $this;
}
$address->setWebposCash($quote->getWebposCash())->setWebposBaseCash($quote->getWebposBaseCash());
/*
$address->setTotalPaid($quote->getWebposCash())
->setBaseTotalPaid($quote->getWebposBaseCash());
*/
if ($quote->getWebposCash() >= $address->getGrandTotal()) {
/*
$address->setTotalRefunded($quote->getWebposCash() - $address->getGrandTotal())
->setBaseTotalRefunded($quote->getWebposBaseCash() - $address->getBaseGrandTotal());
if ($payment = $quote->getPayment()) {
if ($method = $payment->getMethodInstance()) {
$address->setTotalPaid($address->getTotalRefunded())
->setBaseTotalPaid($address->getBaseTotalRefunded());
}
}
*/
} else {
//$address->setGrandTotal($address->getGrandTotal() - $quote->getWebposCash() );
//$address->setBaseGrandTotal($address->getBaseGrandTotal() - $quote->getWebposBaseCash());
}
return $this;
}
示例7: collect
public function collect(Mage_Sales_Model_Quote_Address $address)
{
foreach ($address->getAllItems() as $item) {
Mage::getSingleton('rewards/redeem')->refactorRedemptions($item, false);
}
return parent::collect($address);
}
示例8: fetch
/**
* Add fee information to address
*
* @param Mage_Sales_Model_Quote_Address $address
* @return Brander_PaymentFee_Model_Sales_Quote_Address_Total_Fee
*/
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
$amount = $address->getFeeAmount();
$title = Mage::getModel('payment_fee/fee')->getTotalTitle(null, $address->getQuote());
$address->addTotal(array('code' => $this->getCode(), 'title' => $title, 'value' => $amount));
return $this;
}
示例9: _importCustomerAddressTo
protected function _importCustomerAddressTo(Mage_Sales_Model_Quote_Address $address)
{
$customerAddress = $this->getCustomer()->getPrimaryShippingAddress();
if ($customerAddress) {
$address->importCustomerAddress($customerAddress)->setSaveInAddressBook(0);
}
}
示例10: fetch
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
if (!method_exists($address->getQuote(), 'isR4q') || !$address->getQuote()->isR4q() || Mage::helper('request4quote')->isTaxEstimatesEnabled()) {
parent::fetch($address);
}
return $this;
}
示例11: fetch
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
if ($amount = $address->getAffiliateCredit()) {
$address->addTotal(array('code' => $this->getCode(), 'title' => $this->_getConfigHelper()->__('Paid by Affiliate Credit'), 'value' => $amount));
}
return $this;
}
示例12: fetch
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
$amt = $address->getPaymentInstallmentFeeAmount();
if ($amt != 0) {
$address->addTotal(array('code' => $this->getCode(), 'title' => Mage::helper('adyen')->__('Installment Fee'), 'value' => $amt));
}
return $this;
}
示例13: fetchTotals
public function fetchTotals(Mage_Sales_Model_Quote_Address $address)
{
$amount = $address->getGiftcertAmount();
if ($amount) {
$address->addTotal(array('code' => 'giftcert', 'title' => AO::helper('giftcert')->__('Gift Certificate') . ' (' . $address->getGiftcertCode() . ')', 'value' => -$amount, 'output' => true));
}
return $this;
}
示例14: collect
/**
* Collect gift wrapping tax totals
*
* @param \Mage_Sales_Model_Quote_Address $address
* @return $this
*/
public function collect(Mage_Sales_Model_Quote_Address $address)
{
$storeId = $address->getQuote()->getStore()->getId();
if ($this->_getAvaTaxDataHelper()->isAvataxEnabled($storeId)) {
return $this;
}
return parent::collect($address);
}
示例15: testRenderAddress
public function testRenderAddress()
{
$block = new Mage_Paypal_Block_Express_Review();
$addressData = (include __DIR__ . '/../../../Sales/_files/address_data.php');
$address = new Mage_Sales_Model_Quote_Address($addressData);
$address->setAddressType('billing');
$this->assertContains('Los Angeles', $block->renderAddress($address));
}