Пример #1
0
 /**
  * Constructor.
  *
  * @since 1.1
  *
  * @return void
  **/
 public function __construct()
 {
     Shopping::restore('confirmed', $this->confirmed);
     if (is_admin()) {
         return;
     }
     if (!$this->posted()) {
         return;
     }
     $action = $this->form('checkout');
     add_action('shopp_confirm_order', array($this, 'confirmed'));
     if (empty($action)) {
         return;
     }
     $this->Register = new ShoppRegistration();
     add_action('shopp_process_shipmethod', array($this, 'shipmethod'));
     add_action('shopp_process_checkout', array($this, 'data'));
     add_action('shopp_process_checkout', array($this, 'customer'));
     add_action('shopp_process_checkout', array($this, 'shipaddress'));
     add_action('shopp_process_checkout', array($this, 'shipmethod'));
     add_action('shopp_process_checkout', array($this, 'billaddress'));
     add_action('shopp_process_checkout', array($this, 'payment'));
     add_action('shopp_process_checkout', array($this, 'process'));
     add_filter('shopp_validate_checkout', array('ShoppFormValidation', 'names'));
     add_filter('shopp_validate_checkout', array('ShoppFormValidation', 'email'));
     add_filter('shopp_validate_checkout', array('ShoppFormValidation', 'data'));
     add_filter('shopp_validate_checkout', array('ShoppFormValidation', 'login'));
     add_filter('shopp_validate_checkout', array('ShoppFormValidation', 'passwords'));
     add_filter('shopp_validate_checkout', array('ShoppFormValidation', 'billaddress'));
 }
Пример #2
0
 public function __construct()
 {
     parent::__construct();
     ShoppCatalog();
     Shopping::restore('search', $this->search);
     Shopping::restore('browsing', $this->browsing);
     Shopping::restore('referrer', $this->referrer);
     Shopping::restore('viewed', $this->viewed);
     // Setup WP_Query overrides
     add_action('parse_query', array($this, 'query'));
     add_filter('posts_request', array($this, 'noquery'), 10, 2);
     add_filter('posts_request', array($this, 'onfront'), 10, 2);
     add_filter('posts_results', array($this, 'found'), 10, 2);
     add_filter('the_posts', array($this, 'posts'), 10, 2);
     add_action('wp', array($this, 'loaded'));
     add_action('wp', array($this, 'security'));
     add_action('wp', array($this, 'trackurl'));
     add_action('wp', array($this, 'viewed'));
     add_action('wp', array($this, 'cart'));
     add_action('wp', array($this, 'dashboard'));
     add_action('wp', array($this, 'shortcodes'));
     add_action('wp', array($this, 'behaviors'));
     add_filter('wp_get_nav_menu_items', array($this, 'menulinks'), 10, 2);
     add_filter('wp_list_pages', array($this, 'securelinks'));
     // Wrap Shopp content in #shopp div  to enable CSS and Javascript
     add_filter('shopp_order_lookup', array('Storefront', 'wrapper'));
     add_filter('shopp_order_confirmation', array('Storefront', 'wrapper'));
     add_filter('shopp_errors_page', array('Storefront', 'wrapper'));
     add_filter('shopp_catalog_template', array('Storefront', 'wrapper'));
     add_filter('shopp_cart_template', array('Storefront', 'wrapper'));
     add_filter('shopp_checkout_page', array('Storefront', 'wrapper'));
     add_filter('shopp_account_template', array('Storefront', 'wrapper'));
     add_filter('shopp_category_template', array('Storefront', 'wrapper'));
     add_filter('shopp_order_receipt', array('Storefront', 'wrapper'));
     add_filter('shopp_account_manager', array('Storefront', 'wrapper'));
     add_filter('shopp_account_vieworder', array('Storefront', 'wrapper'));
     add_filter('the_content', array($this, 'autowrap'), 99);
     add_action('wp_enqueue_scripts', 'shopp_dependencies');
     add_action('shopp_storefront_init', array($this, 'account'));
     add_filter('wp_nav_menu_objects', array($this, 'menus'));
     // Maintenance mode overrides
     add_filter('search_template', array($this, 'maintenance'));
     add_filter('taxonomy_template', array($this, 'maintenance'));
     add_filter('page_template', array($this, 'maintenance'));
     add_filter('single_template', array($this, 'maintenance'));
     // Template rendering
     add_action('do_feed_rss2', array($this, 'feed'), 1);
     add_filter('search_template', array($this, 'pages'));
     add_filter('page_template', array($this, 'pages'));
     add_filter('archive_template', array($this, 'pages'));
     add_filter('taxonomy_template', array($this, 'collections'));
     add_filter('single_template', array($this, 'single'));
 }
Пример #3
0
 /**
  * Store constructor
  *
  * @author Jonathan Davis
  * @since 1.1
  * @version 1.2
  *
  * @return void
  **/
 public function __construct()
 {
     parent::__construct();
     Shopping::restore('worklist', $this->worklist);
     if ('off' == shopp_setting('inventory')) {
         array_splice($this->views, 4, 1);
     }
     if (isset($_GET['view']) && in_array($_GET['view'], $this->views)) {
         $this->view = $_GET['view'];
     }
     if (get_current_screen()) {
         get_current_screen()->post_type = ShoppProduct::$posttype;
     }
     if (!empty($_GET['id'])) {
         wp_enqueue_script('jquery-ui-draggable');
         wp_enqueue_script('postbox');
         wp_enqueue_script('wp-lists');
         if (user_can_richedit()) {
             wp_enqueue_script('editor');
             wp_enqueue_script('quicktags');
             add_action('admin_print_footer_scripts', 'wp_tiny_mce', 20);
         }
         shopp_enqueue_script('colorbox');
         shopp_enqueue_script('editors');
         shopp_enqueue_script('scalecrop');
         shopp_enqueue_script('calendar');
         shopp_enqueue_script('product-editor');
         shopp_enqueue_script('priceline');
         shopp_enqueue_script('ocupload');
         shopp_enqueue_script('swfupload');
         shopp_enqueue_script('jquery-tmpl');
         shopp_enqueue_script('suggest');
         shopp_enqueue_script('search-select');
         do_action('shopp_product_editor_scripts');
         add_action('admin_head', array(&$this, 'layout'));
     } else {
         add_action('load-' . $this->screen, array($this, 'loader'));
         add_action('admin_print_scripts', array($this, 'columns'));
     }
     if ('inventory' == $this->view && shopp_setting_enabled('inventory')) {
         do_action('shopp_inventory_manager_scripts');
     }
     add_action('load-' . $this->screen, array($this, 'workflow'));
     do_action('shopp_product_admin_scripts');
     new ContentParser();
     add_action('shopp_product_saved', array($this, 'index'), 99, 1);
 }
Пример #4
0
 public function __construct(ShoppScreenController $Screen, $context, $priority, array $args = array())
 {
     Shopping::restore('admin_notices', $this->notices);
     $this->Screen = $Screen;
     $this->references = $args;
     add_meta_box($this->id, $this->title() . self::help($this->id), array($this, 'box'), $Screen->id, $context, $priority, $args);
     // Parse query request
     if ($this->query()) {
         $this->actions();
         $this->handlers('actions', (array) $this->actions());
         do_action('shopp_metabox_' . $this->id . '_actions');
     }
     // Parse posted form
     if ($this->posted()) {
         $this->handlers('ops', (array) $this->ops());
         do_action('shopp_metabox_' . $this->id . '_ops');
     }
     $this->references();
     $this->init();
 }
Пример #5
0
 /**
  * ShoppAdminController constructor
  *
  * @since 1.1
  *
  * @param string $ui The directory path to the UI templates
  * @param array $request The screen request parameters
  * @return void
  **/
 public function __construct($ui)
 {
     global $plugin_page;
     // Setup helper properties
     $this->ui = $ui;
     $this->id = ShoppAdmin::screen();
     $this->pagename = $plugin_page;
     // Setup notices before actions and process ops
     Shopping::restore('admin_notices', $this->notices);
     add_action('shopp_admin_notices', array($this, 'notices'));
     // Parse query request
     if ($this->query()) {
         // Flag new model requests
         if ('new' == $this->request('id')) {
             $this->request['new'] = true;
         }
         $this->handlers('actions', (array) $this->actions());
         do_action('shopp_admin_' . $this->slug() . '_actions');
     }
     // Setup the working object model
     $this->Model = $this->process($this->load());
 }
Пример #6
0
 /**
  * Categorize constructor
  *
  * @return void
  * @author Jonathan Davis
  **/
 public function __construct()
 {
     parent::__construct();
     Shopping::restore('worklist', $this->worklist);
     if ('shopp-tags' == $_GET['page']) {
         wp_redirect(add_query_arg(array('taxonomy' => ProductTag::$taxon), admin_url('edit-tags.php')));
         return;
     }
     if (!empty($_GET['id']) && !isset($_GET['a'])) {
         wp_enqueue_script('postbox');
         wp_enqueue_script('swfupload-all');
         if (user_can_richedit()) {
             wp_enqueue_script('editor');
             wp_enqueue_script('quicktags');
             add_action('admin_print_footer_scripts', 'wp_tiny_mce', 20);
         }
         shopp_enqueue_script('colorbox');
         shopp_enqueue_script('editors');
         shopp_enqueue_script('category-editor');
         shopp_enqueue_script('priceline');
         shopp_enqueue_script('ocupload');
         shopp_enqueue_script('swfupload');
         shopp_enqueue_script('shopp-swfupload-queue');
         do_action('shopp_category_editor_scripts');
         add_action('admin_head', array($this, 'layout'));
     } elseif (!empty($_GET['a']) && $_GET['a'] == 'arrange') {
         shopp_enqueue_script('category-arrange');
         do_action('shopp_category_arrange_scripts');
         add_action('admin_print_scripts', array($this, 'arrange_cols'));
     } elseif (!empty($_GET['a']) && $_GET['a'] == 'products') {
         shopp_enqueue_script('products-arrange');
         do_action('shopp_category_products_arrange_scripts');
         add_action('admin_print_scripts', array($this, 'products_cols'));
     } else {
         add_action('admin_print_scripts', array($this, 'columns'));
     }
     do_action('shopp_category_admin_scripts');
     add_action('load-' . $this->screen, array($this, 'workflow'));
 }
Пример #7
0
 function init()
 {
     $this->Cart = Shopping::restart('ShoppCart', $this->Cart);
     $this->Customer = Shopping::restart('ShoppCustomer', $this->Customer);
     $this->Billing = Shopping::restart('BillingAddress', $this->Billing);
     $this->Shipping = Shopping::restart('ShippingAddress', $this->Shipping);
     $this->Tax = Shopping::restart('ShoppTax', $this->Tax);
     $this->Shiprates = Shopping::restart('ShoppShiprates', $this->Shiprates);
     $this->Discounts = Shopping::restart('ShoppDiscounts', $this->Discounts);
     // Store order custom data and post processing data
     Shopping::restore('data', $this->data);
     Shopping::restore('sameaddress', $this->sameaddress);
     Shopping::restore('inprogress', $this->inprogress);
     Shopping::restore('purchase', $this->purchase);
     Shopping::restore('txnid', $this->txnid);
     Shopping::restore('orderstate', $this->state);
     $this->Payments = new ShoppPayments();
     $this->Promotions = new ShoppPromotions();
     $this->Checkout = new ShoppCheckout();
 }
Пример #8
0
 /**
  * Detect if promotions exist and pre-load if so.
  */
 public function __construct()
 {
     Shopping::restore('promos', $this->promos);
 }
Пример #9
0
 public function init()
 {
     Shopping::restore('notices', $this->notices);
 }
Пример #10
0
 public function init()
 {
     Shopping::restore('notices', $this->notices);
     $this->notices = array_reverse($this->notices);
 }
Пример #11
0
 public function __construct()
 {
     Shopping::restore('paymethod', $this->selected);
     Shopping::restore('payselected', $this->userset);
 }
Пример #12
0
 /**
  * Do not use. Deprecated.
  *
  * @deprecated ShoppingObject::store
  * @see Shopping::restore
  *
  * @param string $property Property name to use
  * @param object $data The data to store
  * @return void
  **/
 public static function store($property, &$data)
 {
     return Shopping::restore($property, $data);
 }
Пример #13
0
 /**
  * ShoppAdminController constructor
  *
  * @since 1.1
  *
  * @return void
  **/
 public function __construct()
 {
     $request = isset($_GET['page']) ? $_GET['page'] : null;
     $Admin = ShoppAdmin();
     if (!empty($Admin)) {
         $this->Admin = $Admin;
     }
     if (is_null($request)) {
         return;
     }
     global $plugin_page;
     $this->page = $plugin_page;
     $this->url = add_query_arg('page', $request, admin_url('admin.php'));
     if (function_exists('get_current_screen') && ($screen = get_current_screen())) {
         $this->screen = $screen->id;
     }
     if (false !== strpos($request, '-')) {
         $pages = explode('-', $_GET['page']);
         $this->pagename = end($pages);
     }
     Shopping::restore('admin_notices', $this->notices);
     add_action('shopp_admin_notices', array($this, 'notices'));
     $this->maintenance();
 }