/** * @return void */ protected function _construct() { $this->_loadData(); $this->setStores([]); $this->setLanguages([]); return parent::_construct(); }
/** * @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); }
/** * 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); }
protected function _construct() { parent::_construct(); /** @var \Sample\News\Model\Resource\Author\Collection $authors */ $collection = $this->_testimonialFactory->create()->getCollection()->addFieldToFilter('status', 1); $this->setTestimonial($collection); }
public function _construct() { if (!$this->getConfig('general_settings/enable')) { return; } parent::_construct(); }
public function _construct() { if (!$this->hasData('template')) { $this->setData('template', self::DEFAULT_REVIEW_TEMPLATE); } return parent::_construct(); }
/** * @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')); }
/** * 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); }
/** * Init orders * * @return void */ protected function _construct() { parent::_construct(); if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) { $this->initOrders(); } }
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'); }
/** * 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); } }
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); } }
/** * 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); }
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); } }
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); } }
/** * Set template in constructor method */ protected function _construct() { parent::_construct(); $this->setTemplate('standard/failure.phtml'); }
/** * Set pager data * * @return void */ protected function _construct() { parent::_construct(); $this->setData('show_amounts', true); $this->setData('use_container', true); }
/** * 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'); }
/** * @return $this */ public function _construct() { parent::_construct(); $this->setTemplate('catalog/product/edit/serializer.phtml'); return $this; }
/** * Init Toolbar * * @return null */ protected function _construct() { parent::_construct(); $this->_orderField = $this->_productListHelper->getDefaultSortField(); $this->_availableOrder = $this->_catalogConfig->getAttributeUsedForSortByArray(); $this->_availableMode = $this->_productListHelper->getAvailableViewMode(); }
/** * @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); }
/** * 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); }
/** * Define block template * * @return void */ protected function _construct() { $this->setTemplate('Magento_Ui::control/button/default.phtml'); parent::_construct(); }
/** * @inheritdoc */ protected function _construct() { $this->setId('grid.rss.link'); parent::_construct(); }
/** * 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(); }
/** * @return void */ protected function _construct() { parent::_construct(); $this->pageConfig->getTitle()->set(__('My Orders')); }
/** * Constructor for our block with options * * @return void */ public function _construct() { parent::_construct(); $this->setIsLastFieldset(true); }
protected function _construct() { parent::_construct(); $this->setTemplate('product/view/vendor.phtml'); }
/** * Init orders * * @return void */ protected function _construct() { parent::_construct(); if ($this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH)) { $this->initOrders(); } }