Beispiel #1
0
 public function getPage(Container $container)
 {
     if (!Pages::isJigoshop() && !Pages::isAjax()) {
         return $container->get('jigoshop.page.dummy');
     }
     $this->wp->doAction('jigoshop\\page_resolver\\before');
     if (Pages::isCheckoutThankYou()) {
         return $container->get('jigoshop.page.checkout.thank_you');
     }
     if (Pages::isCheckoutPay()) {
         return $container->get('jigoshop.page.checkout.pay');
     }
     if (Pages::isCheckout()) {
         return $container->get('jigoshop.page.checkout');
     }
     if (Pages::isCart()) {
         return $container->get('jigoshop.page.cart');
     }
     if (Pages::isProductCategory()) {
         return $container->get('jigoshop.page.product_category_list');
     }
     if (Pages::isProductTag()) {
         return $container->get('jigoshop.page.product_tag_list');
     }
     if (Pages::isProductList()) {
         return $container->get('jigoshop.page.product_list');
     }
     if (Pages::isProduct()) {
         return $container->get('jigoshop.page.product');
     }
     if (Pages::isAccountOrders()) {
         return $container->get('jigoshop.page.account.orders');
     }
     if (Pages::isAccountEditAddress()) {
         return $container->get('jigoshop.page.account.edit_address');
     }
     if (Pages::isAccountChangePassword()) {
         return $container->get('jigoshop.page.account.change_password');
     }
     if (Pages::isAccount()) {
         return $container->get('jigoshop.page.account');
     }
 }
Beispiel #2
0
 /**
  * Loads proper template based on current page.
  *
  * @param $template string Template chain.
  *
  * @return string Template to load.
  */
 public function process($template)
 {
     if (!Pages::isJigoshop()) {
         return $template;
     }
     if ($this->page === null) {
         if (WP_DEBUG) {
             throw new Exception('Page object should already be set for Jigoshop pages, but none found.');
         }
         Registry::getInstance(JIGOSHOP_LOGGER)->addCritical('Page object should already be set for Jigoshop pages, but none found.');
         return false;
     }
     $content = $this->page->render();
     $template = $this->wp->getOption('template');
     $theme = $this->wp->wpGetTheme();
     if ($theme->get('Author') === 'WooThemes') {
         $template = 'woothemes';
     }
     if (!file_exists(\JigoshopInit::getDir() . '/templates/layout/' . $template . '.php')) {
         $template = 'default';
     }
     Render::output('layout/' . $template, array('content' => $content));
     return false;
 }
Beispiel #3
0
 /**
  * Adds a custom store banner to the site.
  */
 public function displayCustomMessage()
 {
     if ($this->options->get('general.show_message') && Frontend\Pages::isJigoshop()) {
         Render::output('shop/custom_message', array('message' => $this->options->get('general.message')));
     }
     if ($this->options->get('general.demo_store') && Frontend\Pages::isJigoshop()) {
         Render::output('shop/custom_message', array('message' => __('This is a demo store for testing purposes — no orders shall be fulfilled.', 'jigoshop')));
     }
 }