/**
  * Returns singleton oxVatSelector object instance or create new if needed
  *
  * @return oxVatSelector
  */
 public static function getInstance()
 {
     if (!self::$_instance instanceof oxVatSelector) {
         self::$_instance = oxNew('oxVatSelector');
     }
     return self::$_instance;
 }
Пример #2
0
 /**
  * Applies VAT to article
  *
  * @param oxPrice $oPrice Price object
  * @param double  $dVat   VAT percent
  *
  * @return null
  */
 protected function _applyVAT(oxPrice $oPrice, $dVat)
 {
     startProfile(__FUNCTION__);
     $oPrice->setVAT($dVat);
     if (($dVat = oxVatSelector::getInstance()->getArticleUserVat($this)) !== false) {
         $oPrice->setUserVat($dVat);
     }
     stopProfile(__FUNCTION__);
 }