Exemplo n.º 1
0
 function canAddProduct($contentObject)
 {
     $error = eZError::SHOP_OK;
     $productType = eZShopFunctions::productTypeByObject($contentObject);
     if ($productType === false) {
         $error = eZError::SHOP_NOT_A_PRODUCT;
     } else {
         if (!eZShopFunctions::isSimplePriceProductType($productType)) {
             $error = eZShopFunctions::isPreferredCurrencyValid();
         }
         if ($error === eZError::SHOP_OK) {
             $basketType = $this->type();
             if ($basketType !== false && $basketType !== $productType) {
                 $error = eZError::SHOP_BASKET_INCOMPATIBLE_PRODUCT_TYPE;
             }
         }
     }
     return $error;
 }
Exemplo n.º 2
0
 static function setPreferredCurrencyCode($currencyCode)
 {
     $error = eZShopFunctions::isPreferredCurrencyValid($currencyCode);
     if ($error === eZError::SHOP_OK) {
         eZPreferences::setValue('user_preferred_currency', $currencyCode);
     }
     return $error;
 }