Difference between revisions of "Zen Cart extensibility"
Karl Jones (Talk | contribs) |
Karl Jones (Talk | contribs) |
||
Line 14: | Line 14: | ||
Adding a notifier at specific processing points in the popular (e.g. <code>orders.php</code>, <code>customer.php</code>) admin pages, and providing observer code to insert their customization, may help installation and upgrade processes go much more smoothly. | Adding a notifier at specific processing points in the popular (e.g. <code>orders.php</code>, <code>customer.php</code>) admin pages, and providing observer code to insert their customization, may help installation and upgrade processes go much more smoothly. | ||
+ | |||
+ | == Require login for EZ page == | ||
+ | |||
+ | <code>/includes/modules/pages/page/header_php.php</code> | ||
+ | |||
+ | around line 23: | ||
+ | |||
+ | <code> | ||
+ | if ($ezpage_id == 0) zen_redirect(zen_href_link(FILENAME_DEFAULT)); | ||
+ | Right below that, insert the following code, substituting '55' with the number of the page to 'protect': | ||
+ | Code: | ||
+ | if ($ezpage_id == 55) { | ||
+ | if (!$_SESSION['customer_id']) { | ||
+ | $_SESSION['navigation']->set_snapshot(); | ||
+ | zen_redirect(zen_href_link(FILENAME_LOGIN, '', 'SSL')); | ||
+ | } | ||
+ | } | ||
+ | </code> | ||
== See also == | == See also == |
Revision as of 04:40, 12 October 2015
Zen Cart extensibility is the extensibility principle as it applies to Zen Cart.
See also Learning Zen Cart (1).
Plugins
...
Observer class
The Observer Class allows a plugin to listen for for (observe) an event (a notification) and provide additional processing.
This notifier/observer interface also works in the Zen Cart admin panel.
Adding a notifier at specific processing points in the popular (e.g. orders.php
, customer.php
) admin pages, and providing observer code to insert their customization, may help installation and upgrade processes go much more smoothly.
Require login for EZ page
/includes/modules/pages/page/header_php.php
around line 23:
if ($ezpage_id == 0) zen_redirect(zen_href_link(FILENAME_DEFAULT));
Right below that, insert the following code, substituting '55' with the number of the page to 'protect':
Code:
if ($ezpage_id == 55) {
if (!$_SESSION['customer_id']) { $_SESSION['navigation']->set_snapshot(); zen_redirect(zen_href_link(FILENAME_LOGIN, , 'SSL')); }
}