本文整理汇总了PHP中Mage_Payment_Model_Method_Abstract::isAvailable方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Payment_Model_Method_Abstract::isAvailable方法的具体用法?PHP Mage_Payment_Model_Method_Abstract::isAvailable怎么用?PHP Mage_Payment_Model_Method_Abstract::isAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Payment_Model_Method_Abstract
的用法示例。
在下文中一共展示了Mage_Payment_Model_Method_Abstract::isAvailable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isAvailable
public function isAvailable($quote = null)
{
$adminhtml = Mage::getModel('pulsestorm_crossareasession/manager')->getSessionData('adminhtml');
$adminUser = $adminhtml['admin']['user'];
$adminLoggedIn = isset($adminUser) && $adminUser->getId() && $adminUser->getIsActive();
return parent::isAvailable($quote) && $adminLoggedIn;
}
示例2: isAvailable
/**
* Check whether method is available
*
* @param Mage_Sales_Model_Quote|null $quote
* @return bool
*/
public function isAvailable($quote = null)
{
/* custom code written to round price here as roundPrice function was changed */
$_grand_price = Mage::app()->getStore()->roundPrice($quote->getGrandTotal());
$_grand_price = round($_grand_price, 2);
return parent::isAvailable($quote) && !empty($quote) && $_grand_price == 0;
}
示例3: isAvailable
/**
* Check whether payment method can be used
*
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
public function isAvailable($quote = null)
{
if (!(Mage_Payment_Model_Method_Abstract::isAvailable($quote) && $this->_pro->getConfig()->isMethodAvailable())) {
return false;
}
return $this->_commonMethod->isAvailable($quote);
}
示例4: isAvailable
/**
* Check whether payment method can be used
* @param Mage_Sales_Model_Quote
* @return bool
*/
public function isAvailable($quote = null)
{
if (parent::isAvailable($quote) === false) {
return false;
}
return true;
}
示例5: isAvailable
public function isAvailable($quote = null)
{
if (!Mage::helper('magenotification')->checkLicenseKey('Giftvoucher')) {
return false;
}
return parent::isAvailable($quote);
}
示例6: isAvailable
public function isAvailable($quote = null)
{
$showBase = parent::isAvailable($quote);
$configuredMethod = Mage::getStoreConfig('payment/payonpickup/shippingmethod_method');
return $showBase && $quote && $configuredMethod && $quote->getShippingAddress() && $quote->getShippingAddress()->getShippingMethod() && $quote->getShippingAddress()->getShippingMethod() == $configuredMethod;
// Check if the specified method is available
}
示例7: isAvailable
public function isAvailable($quote = null)
{
$result = $this->isBillMemberAvailable();
if ($result === true) {
return parent::isAvailable();
}
return false;
}
示例8: isAvailable
/**
* Check whether payment method can be used
* @param Mage_Sales_Model_Quote
* @return bool
*/
public function isAvailable($quote = null)
{
if (parent::isAvailable($quote) === false) {
return false;
}
// Check currency
$allowedCurrency = array('DKK', 'EUR', 'GBP', 'NOK', 'SEK', 'USD');
return in_array($quote->getQuoteCurrencyCode(), $allowedCurrency);
}
示例9: isAvailable
/**
* Check whether payment method can be used
*
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
public function isAvailable($quote = null)
{
$storeId = Mage::app()->getStore($this->getStore())->getId();
$config = Mage::getModel('paypal/config')->setStoreId($storeId);
if (!(Mage_Payment_Model_Method_Abstract::isAvailable($quote) && $config->isMethodAvailable($this->getCode()))) {
return false;
}
return $this->_commonMethod->isAvailable($quote);
}
示例10: isAvailable
/**
* Verify that the module has been setup
*
* @param null $quote
*
* @return bool
*/
public function isAvailable($quote = null)
{
// Check Magento's internal methods allow us to run
if (parent::isAvailable($quote)) {
// Validate the configuration is okay
return $this->_getWrapper()->validateCredentialsOnce();
} else {
// Otherwise it's a no
return false;
}
}
示例11: isAvailable
/**
* There is no point of having the svea methods available when
* grand total is 0
*/
public function isAvailable($quote = null)
{
if (!parent::isAvailable($quote)) {
return false;
}
$grandTotal = (double) $quote->getGrandTotal();
if ($grandTotal === 0.0) {
return false;
}
return true;
}
示例12: isAvailable
/**
* Check whether method is available
*
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
public function isAvailable($quote = null)
{
if (is_null($this->_isAvailable)) {
if (is_object($quote) && $quote->getCustomer()) {
$availableBA = Mage::getModel('sales/billing_agreement')->getAvailableCustomerBillingAgreements($quote->getCustomer()->getId());
$this->_canUseCheckout = count($availableBA) > 0;
}
$this->_isAvailable = parent::isAvailable($quote) && $this->_isAvailable($quote);
$this->_canUseCheckout = $this->_isAvailable && $this->_canUseCheckout;
}
return $this->_isAvailable;
}
示例13: isAvailable
/**
* Check whether payment method can be used
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
public function isAvailable($quote = null)
{
if (parent::isAvailable($quote) === false) {
return false;
}
// Check currency
$allowedCurrency = array('DKK', 'EUR', 'GBP', 'NOK', 'SEK', 'USD');
//if ($this->getConfigData('paymentview') === 'DIRECTDEBIT') {
// $allowedCurrency = array('NOK', 'SEK', 'USD');
//}
return in_array($quote->getQuoteCurrencyCode(), $allowedCurrency);
}
示例14: isAvailable
/**
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
public function isAvailable($quote = null)
{
$isAvailable = parent::isAvailable($quote);
if ($isAvailable) {
// Allow if billing and shipping address are the same.
$shippingAddress = $quote->getShippingAddress();
if ($shippingAddress->getSameAsBilling()) {
return true;
}
}
return false;
}
示例15: isAvailable
/**
* Check whether method is available
*
* @param Mage_Sales_Model_Quote $quote
* @return bool
*/
public function isAvailable($quote = null)
{
if (is_null($this->_isAvailable)) {
$this->_isAvailable = Mage_Payment_Model_Method_Abstract::isAvailable($quote) && $this->_isAvailable($quote);
if ($this->_isAvailable && is_object($quote)) {
$isAvailable = false;
$availableBA = Mage::helper('cls_paypal/orderstored_agreement')->getBillingAgreementIdFromSessionOrder();
$isAvailable = !empty($availableBA);
$this->_isAvailable = $isAvailable;
}
$this->_canUseInternal = $this->_isAvailable && $this->_canUseInternal;
}
return $this->_isAvailable;
}