/** * Check category permission is allowed * * @param Mage_Catalog_Model_Category $category * @return boolean */ public function isAllowedCategory($category) { $options = new Varien_Object(); $options->setCategory($category); $options->setIsAllowed(true); Mage::dispatchEvent('enterprise_catalog_permissions_is_allowed_category', array('options' => $options)); return $options->getIsAllowed(); }
public function isGuestCheckoutAllowed(Mage_Sales_Model_Quote $quote, $store = null) { if ($store === null) { $store = $quote->getStoreId(); } $guestCheckout = Mage::getStoreConfig('onepagecheckout/general/guest_checkout', $store); if ($guestCheckout == true) { $result = new Varien_Object(); $result->setIsAllowed($guestCheckout); Mage::dispatchEvent('checkout_allow_guest', array('quote' => $quote, 'store' => $store, 'result' => $result)); $guestCheckout = $result->getIsAllowed(); } return $guestCheckout; }
/** * Check whether customers registration is allowed * * @return bool */ public function isRegistrationAllowed() { $result = new Varien_Object(array('is_allowed' => true)); Mage::dispatchEvent('customer_registration_is_allowed', array('result' => $result)); return $result->getIsAllowed(); }
/** * Match any store witch country is allowed in * * @param string $country * * @return Mage_Core_Model_Store|null */ public function _matchAllowedCountry($country) { $stores = Mage::app()->getStores(); foreach ($stores as $store) { if (!$store->getIsActive()) { continue; } $result = new Varien_Object(array('is_allowed' => 1, 'store' => $store)); Mage::dispatchEvent('wh_geoip_redirect_match_allowed_country_before', array('result' => $result)); if ($result->getIsAllowed() && Mage::helper('webbhusetgeoip')->isCountryAllowed($country, $store)) { return $store; } } return null; }
/** * Check is allowed Guest Checkout * Use config settings and observer * * @param Mage_Sales_Model_Quote $quote * @param int|Mage_Core_Model_Store $store * @return bool */ public function isAllowedGuestCheckout(Mage_Sales_Model_Quote $quote, $store = null) { if ($store === null) { $store = $quote->getStoreId(); } $guestCheckout = Mage::getStoreConfigFlag(self::XML_PATH_GUEST_CHECKOUT, $store); if ($guestCheckout == true) { $result = new Varien_Object(); $result->setIsAllowed($guestCheckout); Mage::dispatchEvent('checkout_allow_guest', array('quote' => $quote, 'store' => $store, 'result' => $result)); $guestCheckout = $result->getIsAllowed(); } return $guestCheckout; }