本文整理汇总了PHP中Varien_Object::setCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Object::setCode方法的具体用法?PHP Varien_Object::setCode怎么用?PHP Varien_Object::setCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Varien_Object
的用法示例。
在下文中一共展示了Varien_Object::setCode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initTotals
public function initTotals()
{
$parent = $this->getParentBlock();
$paymentMethod = $parent->getOrder()->getPayment()->getMethodInstance()->getCode();
if (!in_array($paymentMethod, self::$_allowed_methods)) {
return $this;
}
if ($parent->getOrder()->getBasePayexPaymentFeeTax()) {
$total = new Varien_Object();
$total->setLabel(Mage::helper('payex')->__('Payment fee (Incl.Tax)'));
$total->setValue($parent->getOrder()->getPayexPaymentFee() + $parent->getOrder()->getPayexPaymentFeeTax());
$total->setBaseValue($parent->getOrder()->getPayexBasePaymentFee() + $parent->getOrder()->getPayexBasePaymentFeeTax());
$total->setCode('payex_payment_fee_with_tax');
$parent->addTotalBefore($total, 'tax');
}
if ($parent->getOrder()->getBasePayexPaymentFee()) {
$total = new Varien_Object();
$total->setLabel(Mage::helper('payex')->__('Payment fee (Excl.Tax)'));
$total->setValue($parent->getOrder()->getPayexPaymentFee());
$total->setBaseValue($parent->getOrder()->getPayexBasePaymentFee());
$total->setCode('payex_payment_fee');
$parent->addTotalBefore($total, 'payex_payment_fee_with_tax');
}
return $this;
}
示例2: initTotals
public function initTotals()
{
$parent = $this->getParentBlock();
$this->_invoice = $parent->getInvoice();
if ($this->_invoice->getCodFee()) {
$cod = new Varien_Object();
$cod->setLabel($this->__('Cash on Delivery fee'));
$cod->setValue($this->_invoice->getCodFee());
$cod->setBaseValue($this->_invoice->getBaseCodFee());
$cod->setCode('cod_fee');
if (Mage::helper('cashondelivery')->displayCodBothPrices()) {
$cod->setLabel($this->__('Cash on Delivery fee (Excl.Tax)'));
$codIncl = new Varien_Object();
$codIncl->setLabel($this->__('Cash on Delivery fee (Incl.Tax)'));
$codIncl->setValue($this->_invoice->getCodFee() + $this->_invoice->getCodTaxAmount());
$codIncl->setBaseValue($this->_invoice->getBaseCodFee() + $this->_invoice->getBaseCodTaxAmount());
$codIncl->setCode('cod_fee_incl');
$parent->addTotalBefore($cod, 'tax');
$parent->addTotalBefore($codIncl, 'tax');
} elseif (Mage::helper('cashondelivery')->displayCodFeeIncludingTax()) {
$cod->setValue($this->_invoice->getCodFee() + $this->_invoice->getCodTaxAmount());
$cod->setBaseValue($this->_invoice->getBaseCodFee() + $this->_invoice->getBaseCodTaxAmount());
$parent->addTotalBefore($cod, 'tax');
} else {
$parent->addTotalBefore($cod, 'tax');
}
}
return $this;
}
示例3: initType
/**
* Initialize the block data
*
* @param string $format template used to format the address
* @return self
*/
public function initType($format)
{
$type = new Varien_Object();
$type->setCode('address_verification')->setTitle('Address Verification Suggestion')->setDefaultFormat($format)->setHtmlEscape(true);
$this->setType($type);
return $this;
}
示例4: render
/**
* @param Mage_Customer_Model_Address_Abstract $address
* @param null $format
* @param string $template
* @param string $helper
*
* @return string
*/
public function render(Mage_Customer_Model_Address_Abstract $address, $format = null, $template = '', $helper = '')
{
$type = new Varien_Object();
$type->setCode('html');
$this->setType($type);
$format = Mage::app()->getLayout()->createBlock('pdfcustomiser/pdf_block')->setPdfHelper($helper)->setTemplate($template)->toHtml();
return parent::render($address, $format);
}
示例5: testGetQuoteCurrency
public function testGetQuoteCurrency()
{
$quote = Mage::getModel('sales/quote');
$this->assertEquals(Mage::app()->getStore($quote->getStoreId())->getBaseCurrencyCode(), Mage::helper('ops/quote')->getQuoteCurrency($quote));
$forcedCurrency = new Varien_Object();
$forcedCurrency->setCode('USD');
$quote->setForcedCurrency($forcedCurrency);
$this->assertEquals('USD', Mage::helper('ops/quote')->getQuoteCurrency($quote));
}
示例6: initTotals
public function initTotals()
{
if ($this->giftwrapAmount() > 0) {
$total = new Varien_Object();
$total->setCode('giftwrap');
$total->setValue($this->giftwrapAmount());
$total->setBaseValue(0);
$total->setLabel('Gift wrap');
$parent = $this->getParentBlock();
$parent->addTotal($total, 'subtotal');
}
}
示例7: initTotals
public function initTotals()
{
if ($this->discountAmount() != 0) {
$total = new Varien_Object();
$total->setCode('webposdiscount');
$total->setValue(-$this->discountAmount());
$total->setBaseValue(0);
$total->setLabel('Discount(Admin)');
$parent = $this->getParentBlock();
$parent->addTotal($total, 'subtotal');
}
}
示例8: addToBlock
public function addToBlock($block)
{
$order = $block->getOrder();
$label = Mage::getStoreConfig('payment/' . $order->getPayment()->getMethod() . '/surcharge_label');
$fee = new Varien_Object();
$fee->setCode('surcharge_incl');
$fee->setLabel($label);
$fee->setBaseValue(10);
$fee->setValue(11);
$block->addTotalBefore($fee, 'shipping');
return $block;
}
示例9: initTotals
public function initTotals()
{
$parent = $this->getParentBlock();
if ($this->_invoice->getCodFee()) {
$cod = new Varien_Object();
$cod->setLabel($this->__('Refund Cash on Delivery fee'));
$cod->setValue($parent->getSource()->getCodFee());
$cod->setBaseValue($parent->getSource()->getBaseCodFee());
$cod->setCode('cod_fee');
$parent->addTotalBefore($cod, 'adjustment_positive');
}
return $this;
}
示例10: _loadActionsConfig
/**
* Load actions config
*
* @return void
* @throws Mage_Core_Exception
*/
protected function _loadActionsConfig()
{
foreach ($this->getActionsConfigNode()->children() as $code => $node) {
$config = new Varien_Object();
$config->setCode($code);
$model = Mage::getModel($node);
if (!$model instanceof Smile_MageCache_Model_Action) {
Mage::throwException(Mage::helper('smile_magecache')->__('Class of "%s" action is not valid', $code));
}
$config->setModel($model);
self::$_actionsConfig[$code] = $config;
}
}
示例11: setRedirect
/**
* Additionally check for session messages in several domains case
*
* @param string $url
* @param int $code
* @return Mage_Core_Controller_Response_Http
*/
public function setRedirect($url, $code = 302)
{
/**
* Use single transport object instance
*/
if (self::$_transportObject === null) {
self::$_transportObject = new Varien_Object();
}
self::$_transportObject->setUrl($url);
self::$_transportObject->setCode($code);
Mage::dispatchEvent('controller_response_redirect', array('response' => $this, 'transport' => self::$_transportObject));
return parent::setRedirect(self::$_transportObject->getUrl(), self::$_transportObject->getCode());
}
示例12: initTotals
public function initTotals()
{
// var_dump($this->discountAmount());
if ($this->discountAmount() != 0) {
$total = new Varien_Object();
$total->setCode('onestepcheckoutdiscount');
$total->setValue(-$this->discountAmount());
$total->setBaseValue(-$this->baseDiscountAmout());
$total->setLabel('Discount(Admin)');
$parent = $this->getParentBlock();
$parent->addTotal($total, 'subtotal');
}
}
示例13: initTotals
public function initTotals()
{
$amount = $this->getLuckydrawDiscount();
if (floatval($amount)) {
$total = new Varien_Object();
$total->setCode('luckydraw_discount');
$total->setValue($amount);
$total->setBaseValue($this->getBaseLuckydrawDiscount());
$total->setLabel('Lucky Draw Discount');
$parent = $this->getParentBlock();
$parent->addTotal($total, 'subtotal');
}
}
示例14: initTotals
public function initTotals()
{
$amount = $this->getAffiliateplusDiscount();
if (floatval($amount)) {
$total = new Varien_Object();
$total->setCode('affiliateplus_discount');
$total->setValue($amount);
$total->setBaseValue($this->getBaseAffiliateplusDiscount());
$total->setLabel('Affiliate Discount' . $this->getAffiliateCouponLabel());
$parent = $this->getParentBlock();
$parent->addTotal($total, 'subtotal');
}
}
示例15: initTotals
public function initTotals()
{
$parent = $this->getParentBlock();
if ($parent->getSource()) {
$fee = new Varien_Object();
$fee->setLabel($this->__('Refund Payment fee'));
$fee->setValue($parent->getSource()->getCapayableFee());
$fee->setBaseValue($parent->getSource()->getBaseCapayableFee());
$fee->setCode('payment_fee');
$fee->setBlockName('capayable_fee');
$parent->addTotalBefore($fee, 'adjustment_positive');
}
return $this;
}