/** * Constructor. * * @param array $config An optional associative array of configuration settings. * Recognized key values include 'name', 'default_task', 'model_path', and * 'view_path' (this list is not meant to be comprehensive). * * @since 12.2 */ public function __construct($config = array()) { parent::__construct($config); // TODO: Need to create MerchantType VIRTUEMART $client = new \Expressly\Client(MerchantType::WOOCOMMERCE); $app = $client->getApp(); $app['merchant.provider'] = $app->share(function () { return new ExpresslyMerchantProvider(); }); $this->app = $app; }
/** * Construct the plugin. */ public function __construct() { // ===== Set app, dispatcher & merchant ===== // $client = new Expressly\Client(); $app = $client->getApp(); $app['merchant.provider'] = $app->share(function ($app) { return new VM_Expressly_MerchantProvider(); }); $this->app = $app; $this->dispatcher = $this->app['dispatcher']; // ===== // }
public function __construct() { register_activation_hook(__FILE__, array($this, 'register_activation_hook')); register_deactivation_hook(__FILE__, array($this, 'register_deactivation_hook')); register_uninstall_hook(__FILE__, array($this, 'register_uninstall_hook')); add_action('plugins_loaded', array($this, 'plugins_loaded')); add_action('init', array($this, 'init')); add_action('template_redirect', array($this, 'template_redirect')); add_filter('query_vars', array($this, 'query_vars')); $client = new Expressly\Client(MerchantType::WOOCOMMERCE); $app = $client->getApp(); $app['merchant.provider'] = $app->share(function () { return new WC_Expressly_MerchantProvider(); }); $this->app = $app; $this->dispatcher = $this->app['dispatcher']; $this->merchantProvider = $this->app['merchant.provider']; }