Exemplo n.º 1
0
 /**
  * @return void
  */
 protected function _construct()
 {
     $this->_loadData();
     $this->setStores([]);
     $this->setLanguages([]);
     return parent::_construct();
 }
Exemplo n.º 2
0
 /**
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     //TODO: add full name logic
     $orders = $this->_orderCollectionFactory->create()->addAttributeToSelect('*')->joinAttribute('shipping_firstname', 'order_address/firstname', 'shipping_address_id', null, 'left')->joinAttribute('shipping_lastname', 'order_address/lastname', 'shipping_address_id', null, 'left')->addAttributeToFilter('customer_id', $this->_customerSession->getCustomerId())->addAttributeToFilter('status', array('in' => $this->_orderConfig->getVisibleOnFrontStatuses()))->addAttributeToSort('created_at', 'desc')->setPageSize('5')->load();
     $this->setOrders($orders);
 }
 protected function _construct()
 {
     parent::_construct();
     // CSRF protection
     $this->_customerSession->setFacebookCsrf($csrf = md5(uniqid(rand(), true)));
     $this->_clientFacebook->setState($csrf);
 }
Exemplo n.º 4
0
 /**
  * load the articles
  */
 protected function _construct()
 {
     parent::_construct();
     /** @var \Gemtoo\Blog\Model\ResourceModel\Article\Collection $articles */
     $articles = $this->articleCollectionFactory->create()->addFieldToSelect('*')->addFieldToFilter('is_active', 1)->addStoreFilter($this->_storeManager->getStore()->getId())->setOrder('name', 'ASC');
     $this->setArticles($articles);
 }
Exemplo n.º 5
0
 protected function _construct()
 {
     parent::_construct();
     /** @var \Sample\News\Model\Resource\Author\Collection $authors */
     $collection = $this->_testimonialFactory->create()->getCollection()->addFieldToFilter('status', 1);
     $this->setTestimonial($collection);
 }
Exemplo n.º 6
0
 public function _construct()
 {
     if (!$this->getConfig('general_settings/enable')) {
         return;
     }
     parent::_construct();
 }
Exemplo n.º 7
0
 public function _construct()
 {
     if (!$this->hasData('template')) {
         $this->setData('template', self::DEFAULT_REVIEW_TEMPLATE);
     }
     return parent::_construct();
 }
Exemplo n.º 8
0
 /**
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $orders = $this->_orderCollectionFactory->create()->addFieldToSelect('*')->addFieldToFilter('customer_id', $this->_customerSession->getCustomerId())->addFieldToFilter('status', array('in' => $this->_orderConfig->getVisibleOnFrontStatuses()))->setOrder('created_at', 'desc');
     $this->setOrders($orders);
     $this->pageConfig->setTitle(__('My Orders'));
 }
Exemplo n.º 9
0
 /**
  * load the authors
  */
 protected function _construct()
 {
     parent::_construct();
     /** @var \Sample\News\Model\ResourceModel\Author\Collection $authors */
     $authors = $this->authorCollectionFactory->create()->addFieldToSelect('*')->addFieldToFilter('is_active', 1)->addStoreFilter($this->_storeManager->getStore()->getId())->setOrder('name', 'ASC');
     $this->setAuthors($authors);
 }
Exemplo n.º 10
0
 /**
  * Init orders
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
         $this->initOrders();
     }
 }
Exemplo n.º 11
0
 protected function _construct()
 {
     parent::_construct();
     $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
     $postCollectionFactory = $objectManager->create('\\Test\\Testimonials\\Model\\ResourceModel\\Post\\CollectionFactory');
     $this->_postCollectionFactory = $postCollectionFactory;
     $this->setTemplate('widget/Testimonials.phtml');
 }
Exemplo n.º 12
0
 /**
  * Add block data
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->_urls = array('base' => $this->_storeManager->getStore()->getBaseUrl('web'), 'baseSecure' => $this->_storeManager->getStore()->getBaseUrl('web', true), 'current' => $this->_request->getRequestUri());
     $this->addBodyClass($this->_request->getFullActionName('-'));
     if ($this->_cacheState->isEnabled(self::CACHE_GROUP)) {
         $this->_sidResolver->setUseSessionVar(true);
     }
 }
Exemplo n.º 13
0
 public function _construct()
 {
     parent::_construct();
     $brand = $this->_brand;
     $group = $this->getCurrentGroup();
     $brandCollection = $brand->getCollection()->addFieldToFilter('group_id', $group->getId())->addFieldToFilter('status', 1)->setOrder('position', 'ASC');
     $this->setCollection($brandCollection);
     $template = 'group\\view.phtml';
     if (!$this->hasData('template')) {
         $this->setTemplate($template);
     }
 }
Exemplo n.º 14
0
 /**
  * Class constructor
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $purchased = $this->_linksFactory->create()->addFieldToFilter('customer_id', $this->currentCustomer->getCustomerId())->addOrder('created_at', 'desc');
     $this->setPurchased($purchased);
     $purchasedIds = [];
     foreach ($purchased as $_item) {
         $purchasedIds[] = $_item->getId();
     }
     if (empty($purchasedIds)) {
         $purchasedIds = [null];
     }
     $purchasedItems = $this->_itemsFactory->create()->addFieldToFilter('purchased_id', ['in' => $purchasedIds])->addFieldToFilter('status', ['nin' => [Item::LINK_STATUS_PENDING_PAYMENT, Item::LINK_STATUS_PAYMENT_REVIEW]])->setOrder('item_id', 'desc');
     $this->setItems($purchasedItems);
 }
Exemplo n.º 15
0
 public function _construct()
 {
     if (!$this->getConfig('general_settings/enable') || !$this->getConfig('brand_block/enable')) {
         return;
     }
     parent::_construct();
     $carousel_layout = $this->getConfig('brand_block/carousel_layout');
     $template = '';
     if ($carousel_layout == 'owl_carousel') {
         $template = 'block/brand_list_owl.phtml';
     } else {
         $template = 'block/brand_list_bootstrap.phtml';
     }
     if (!$this->getTemplate() && $template != '') {
         $this->setTemplate($template);
     }
 }
Exemplo n.º 16
0
 public function _construct()
 {
     if (!$this->getConfig('general_settings/enable')) {
         return;
     }
     parent::_construct();
     $itemsperpage = (int) $this->getConfig('brand_list_page/item_per_page', 12);
     $brand = $this->_brand;
     $brandCollection = $brand->getCollection()->addFieldToFilter('status', 1)->setOrder('position', 'ASC');
     $this->setCollection($brandCollection);
     $template = '';
     $layout = $this->getConfig('brand_list_page/layout');
     if ($layout == 'grid') {
         $template = 'brandlistpage_grid.phtml';
     } else {
         $template = 'brandlistpage_list.phtml';
     }
     if (!$this->hasData('template')) {
         $this->setTemplate($template);
     }
 }
Exemplo n.º 17
0
 /**
  * Set template in constructor method
  */
 protected function _construct()
 {
     parent::_construct();
     $this->setTemplate('standard/failure.phtml');
 }
Exemplo n.º 18
0
 /**
  * Set pager data
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->setData('show_amounts', true);
     $this->setData('use_container', true);
 }
Exemplo n.º 19
0
 /**
  * Initialize review form
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->setAllowWriteReviewFlag($this->httpContext->getValue(Context::CONTEXT_AUTH) || $this->_reviewData->getIsGuestAllowToWrite());
     if (!$this->getAllowWriteReviewFlag()) {
         $queryParam = $this->urlEncoder->encode($this->getUrl('*/*/*', ['_current' => true]) . '#review-form');
         $this->setLoginLink($this->getUrl('customer/account/login/', [Url::REFERER_QUERY_PARAM_NAME => $queryParam]));
     }
     $this->setTemplate('form.phtml');
 }
Exemplo n.º 20
0
 /**
  * @return $this
  */
 public function _construct()
 {
     parent::_construct();
     $this->setTemplate('catalog/product/edit/serializer.phtml');
     return $this;
 }
Exemplo n.º 21
0
 /**
  * Init Toolbar
  *
  * @return null
  */
 protected function _construct()
 {
     parent::_construct();
     $this->_orderField = $this->_productListHelper->getDefaultSortField();
     $this->_availableOrder = $this->_catalogConfig->getAttributeUsedForSortByArray();
     $this->_availableMode = $this->_productListHelper->getAvailableViewMode();
 }
Exemplo n.º 22
0
 /**
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $orders = $this->_orderCollectionFactory->create()->addAttributeToSelect('*')->addAttributeToFilter('customer_id', $this->_customerSession->getCustomerId())->addAttributeToFilter('status', ['in' => $this->_orderConfig->getVisibleOnFrontStatuses()])->addAttributeToSort('created_at', 'desc')->setPageSize('5')->load();
     $this->setOrders($orders);
 }
Exemplo n.º 23
0
 /**
  * Initialize review form
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $data = $this->_reviewSession->getFormData(true);
     $data = new \Magento\Framework\Object((array) $data);
     // add logged in customer name as nickname
     if (!$data->getNickname()) {
         $customer = $this->_customerSession->getCustomerDataObject();
         if ($customer && $customer->getId()) {
             $data->setNickname($customer->getFirstname());
         }
     }
     $this->setAllowWriteReviewFlag($this->httpContext->getValue(Context::CONTEXT_AUTH) || $this->_reviewData->getIsGuestAllowToWrite());
     if (!$this->getAllowWriteReviewFlag()) {
         $queryParam = $this->urlEncoder->encode($this->getUrl('*/*/*', ['_current' => true]) . '#review-form');
         $this->setLoginLink($this->getUrl('customer/account/login/', [Url::REFERER_QUERY_PARAM_NAME => $queryParam]));
     }
     $this->setTemplate('form.phtml')->assign('data', $data);
 }
Exemplo n.º 24
0
 /**
  * Define block template
  *
  * @return void
  */
 protected function _construct()
 {
     $this->setTemplate('Magento_Ui::control/button/default.phtml');
     parent::_construct();
 }
Exemplo n.º 25
0
 /**
  * @inheritdoc
  */
 protected function _construct()
 {
     $this->setId('grid.rss.link');
     parent::_construct();
 }
Exemplo n.º 26
0
 /**
  * Initialize billing address step
  *
  * @return void
  */
 protected function _construct()
 {
     $this->getCheckout()->setStepData('billing', ['label' => __('Billing Information'), 'is_show' => true]);
     if ($this->isCustomerLoggedIn()) {
         $this->getCheckout()->setStepData('billing', 'allow', true);
     }
     parent::_construct();
 }
Exemplo n.º 27
0
 /**
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     $this->pageConfig->getTitle()->set(__('My Orders'));
 }
Exemplo n.º 28
0
 /**
  * Constructor for our block with options
  *
  * @return void
  */
 public function _construct()
 {
     parent::_construct();
     $this->setIsLastFieldset(true);
 }
Exemplo n.º 29
0
 protected function _construct()
 {
     parent::_construct();
     $this->setTemplate('product/view/vendor.phtml');
 }
Exemplo n.º 30
0
 /**
  * Init orders
  *
  * @return void
  */
 protected function _construct()
 {
     parent::_construct();
     if ($this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH)) {
         $this->initOrders();
     }
 }