protected function _load($name)
 {
     if (isset(self::$_shortcuts[$name])) {
         return self::$_shortcuts[$name]['replace'];
     }
     return parent::_load($name);
 }
 protected function _load($name)
 {
     switch ($name) {
         case 'country_name':
             return Mage::getModel('directory/country')->load($this->country_id)->getName();
     }
     return parent::_load($name);
 }
Пример #3
0
 public function __construct($arguments = null)
 {
     parent::__construct();
     if ($arguments && isset($argument['id'])) {
         $this->_store = Mage::app()->getStore((int) $argument['id']);
     } else {
         $this->_store = Mage::app()->getStore();
     }
 }
 protected function _load($name)
 {
     switch ($name) {
         case 'name':
             return $this->{'attribute_set_name'};
         default:
             return parent::_load($name);
     }
 }
 protected function _load($name)
 {
     switch ($name) {
         case 'code':
             return $this->customer_group_code;
         default:
             return parent::_load($name);
     }
 }
 protected function _load($name)
 {
     switch ($name) {
         case 'is_in_stock':
             return (bool) parent::_load($name);
         case 'qty':
             $qty = parent::_load($name);
             return $this->is_qty_decimal ? (double) $qty : (int) $qty;
         default:
             return parent::_load($name);
     }
 }
 protected function _load($name)
 {
     $elems = explode('.', $name, $limit = 2);
     $count = count($elems);
     $last_index = $count - 1;
     if ($count == 2) {
         switch ($elems[0]) {
             case 'o':
             case 'option':
                 return $this->_getOption($elems[1]);
         }
     }
     switch ($name) {
         case 'price-tax+discount':
             return (double) $this->base_original_price - $this->discount_amount / $this->qty;
         case 'price-tax-discount':
             return (double) $this->base_original_price;
         case 'price+tax+discount':
             /*echo 'base_original_price '.$this->base_original_price.'';
             		echo ' + (tax_amount '.$this->tax_amount.'';
             		echo ' - discount_amount '.$this->discount_amount.')';
             		echo '/ '.$this->qty.'<br>';
             		echo ' ::: = '.($this->base_original_price+($this->tax_amount-$this->discount_amount)/$this->qty).'<br>';*/
             return (double) $this->base_original_price + ($this->tax_amount - $this->discount_amount) / $this->qty;
         case 'price+tax-discount':
             return (double) $this->price_incl_tax;
         case 'weight':
             if ($this->_type == 'bundle' && $this->getProduct()->weight_type == 0) {
                 return (double) parent::_load($name);
             }
             return $this->qty * $this->getProduct()->weight;
         default:
             return parent::_load($name);
     }
 }
Пример #8
0
 public function __construct()
 {
     parent::__construct();
     $this->_timestamp = (int) Mage::getModel('core/date')->timestamp();
 }
Пример #9
0
 public function __get($name)
 {
     switch ($name) {
         case 'items':
             return $this->_items;
         case 'free_shipping':
             if (isset($this->_free_shipping)) {
                 return $this->_free_shipping;
             }
             $free_shipping = parent::__get('free_shipping');
             if (!$free_shipping) {
                 foreach ($this->_items as $item) {
                     $free_shipping = $item->free_shipping;
                     if (!$free_shipping) {
                         break;
                     }
                 }
             }
             return $this->_free_shipping = $free_shipping;
     }
     return parent::__get($name);
 }