@@ 84-92 (lines=9) @@ | ||
81 | * Disable controller actions when gift cards are disabled. |
|
82 | * @return self |
|
83 | */ |
|
84 | public function preDispatch() |
|
85 | { |
|
86 | parent::preDispatch(); |
|
87 | if (!$this->_config->isEnabledFlag) { |
|
88 | // when gift cards are disabled, forward requests to 404 pages |
|
89 | $this->setFlag('', static::FLAG_NO_DISPATCH, true)->_forward('/noroute'); |
|
90 | } |
|
91 | return $this; |
|
92 | } |
|
93 | /** |
|
94 | * Check the balance of a gift card. |
|
95 | */ |
@@ 55-66 (lines=12) @@ | ||
52 | * |
|
53 | * @return self |
|
54 | */ |
|
55 | public function preDispatch() |
|
56 | { |
|
57 | parent::preDispatch(); |
|
58 | if (!$this->_config->isEnabledFlag) { |
|
59 | // when the payment method is disabled, prevent dispatching actions from |
|
60 | // this controller. |
|
61 | $this->setFlag('', static::FLAG_NO_DISPATCH, true)->_forward( |
|
62 | '/noroute' |
|
63 | ); |
|
64 | } |
|
65 | return $this; |
|
66 | } |
|
67 | ||
68 | /** |
|
69 | * return true if a guest is allowed to checkout without registering |