Ejemplo n.º 1
0
 /**
  * @param $product
  * @return bool
  */
 private function showPP($product, $cart)
 {
     if (!isset($this->klarna_virtuemart) || !$this->klarna_virtuemart instanceof Klarna_virtuemart) {
         return FALSE;
     }
     if (!VMKLARNA_SHOW_PRODUCTPRICE) {
         vmDebug('Klarna: showPP', 'dont show price because VMKLARNA_SHOW_PRODUCTPRICE');
         return FALSE;
     }
     // the price is in the vendor currency
     // convert price in NLD currency= euro
     $price = KlarnaHandler::convertPrice($product->prices['salesPrice'], $this->cData['vendor_currency'], 'EUR', $cart->pricesCurrency);
     if (strtolower($this->cData['country_code']) == 'nl' && !KlarnaHandler::checkNLpriceCondition($price)) {
         vmDebug('showPP', 'dont show price for NL', $this->cData['country_code'], $price);
         return FALSE;
     }
     if ($price <= $this->cData['min_amount'] and !empty($this->cData['min_amount'])) {
         return FALSE;
     }
     return TRUE;
 }