/** * @return string */ protected function _toHtml() { $cssClasses = $this->hasData('css_classes') ? explode(' ', $this->getData('css_classes')) : []; $cssClasses[] = 'price-' . $this->getPrice()->getPriceCode(); $this->setData('css_classes', implode(' ', $cssClasses)); return parent::_toHtml(); }
/** * {@inheritdoc} */ protected function _toHtml() { if (!$this->getProductTypes()) { return ''; } return parent::_toHtml(); }
/** * @return string */ protected function _toHtml() { if ($this->getOrders()->getSize() > 0) { return parent::_toHtml(); } return ''; }
/** * @inheritdoc */ protected function _toHtml() { if (!$this->isInContext()) { return ''; } return parent::_toHtml(); }
/** * Render tag manager script * * @return string */ protected function _toHtml() { if ($this->_cookieHelper->isUserNotAllowSaveCookie() || !$this->_gtmHelper->isEnabled()) { return ''; } return parent::_toHtml(); }
/** * @inheritdoc */ protected function _toHtml() { if ($this->isActive()) { return parent::_toHtml(); } return ''; }
/** * Render block HTML * * @return string */ protected function _toHtml() { if (false != $this->getTemplate()) { return parent::_toHtml(); } $highlight = ''; if ($this->getIsHighlighted()) { $highlight = ' current'; } if ($this->isCurrent()) { $html = '<li class="nav item current">'; $html .= '<strong>' . $this->escapeHtml((string) new \Magento\Framework\Phrase($this->getLabel())) . '</strong>'; $html .= '</li>'; } else { $html = '<li class="nav item' . $highlight . '"><a href="' . $this->escapeHtml($this->getHref()) . '"'; $html .= $this->getTitle() ? ' title="' . $this->escapeHtml((string) new \Magento\Framework\Phrase($this->getTitle())) . '"' : ''; $html .= $this->getAttributesHtml() . '>'; if ($this->getIsHighlighted()) { $html .= '<strong>'; } $html .= $this->escapeHtml((string) new \Magento\Framework\Phrase($this->getLabel())); if ($this->getIsHighlighted()) { $html .= '</strong>'; } $html .= '</a></li>'; } return $html; }
/** * Render block HTML * * @return string */ protected function _toHtml() { if (false != $this->getTemplate()) { return parent::_toHtml(); } return '<li><a ' . $this->getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '</a></li>'; }
/** * Render block HTML * * @return string */ protected function _toHtml() { $localeData = (new DataBundle())->get($this->_localeResolver->getLocale()); // get days names $daysData = $localeData['calendar']['gregorian']['dayNames']; $this->assign('days', ['wide' => $this->encoder->encode(array_values(iterator_to_array($daysData['format']['wide']))), 'abbreviated' => $this->encoder->encode(array_values(iterator_to_array($daysData['format']['abbreviated'])))]); // get months names $monthsData = $localeData['calendar']['gregorian']['monthNames']; $this->assign('months', ['wide' => $this->encoder->encode(array_values(iterator_to_array($monthsData['format']['wide']))), 'abbreviated' => $this->encoder->encode(array_values(iterator_to_array($monthsData['format']['abbreviated'])))]); // get "today" and "week" words $this->assign('today', $this->encoder->encode($localeData['fields']['day']['relative']['0'])); $this->assign('week', $this->encoder->encode($localeData['fields']['week']['dn'])); // get "am" & "pm" words $this->assign('am', $this->encoder->encode($localeData['calendar']['gregorian']['AmPmMarkers']['0'])); $this->assign('pm', $this->encoder->encode($localeData['calendar']['gregorian']['AmPmMarkers']['1'])); // get first day of week and weekend days $this->assign('firstDay', (int) $this->_scopeConfig->getValue('general/locale/firstday', \Magento\Store\Model\ScopeInterface::SCOPE_STORE)); $this->assign('weekendDays', $this->encoder->encode((string) $this->_scopeConfig->getValue('general/locale/weekend', \Magento\Store\Model\ScopeInterface::SCOPE_STORE))); // define default format and tooltip format $this->assign('defaultFormat', $this->encoder->encode($this->_localeDate->getDateFormat(\IntlDateFormatter::MEDIUM))); $this->assign('toolTipFormat', $this->encoder->encode($this->_localeDate->getDateFormat(\IntlDateFormatter::LONG))); // get days and months for en_US locale - calendar will parse exactly in this locale $englishMonths = (new DataBundle())->get('en_US')['calendar']['gregorian']['monthNames']; $enUS = new \stdClass(); $enUS->m = new \stdClass(); $enUS->m->wide = array_values(iterator_to_array($englishMonths['format']['wide'])); $enUS->m->abbr = array_values(iterator_to_array($englishMonths['format']['abbreviated'])); $this->assign('enUS', $this->encoder->encode($enUS)); return parent::_toHtml(); }
/** * @return string */ public function _toHtml() { if (!$this->helper->isMultishippingCheckoutAvailable()) { return ''; } return parent::_toHtml(); }
/** * Render tag manager JS * * @return string */ protected function _toHtml() { if (!$this->_gtmHelper->isEnabled()) { return ''; } return parent::_toHtml(); }
/** * Renders captcha HTML (if required) * * @return string */ protected function _toHtml() { if ($this->getCaptchaModel()->isRequired()) { $this->getCaptchaModel()->generate(); return parent::_toHtml(); } return ''; }
/** * Return Boleto PDF url * * @return string */ protected function _toHtml() { if ($this->isBoletoPayment()) { $this->addData(['boleto_pdf_url' => $this->getBoletoPdfUrl()]); return parent::_toHtml(); } return ''; }
/** * Prepare form parameters and render * * @return string */ protected function _toHtml() { $validator = $this->_coreRegistry->registry('current_centinel_validator'); if ($validator && $validator->shouldAuthenticate()) { $this->addData($validator->getAuthenticateStartData()); return parent::_toHtml(); } return ''; }
/** * Prepare authentication result params and render * * @return string */ protected function _toHtml() { $validator = $this->_coreRegistry->registry('current_centinel_validator'); if ($validator) { $this->setIsProcessed(true); $this->setIsSuccess($validator->isAuthenticateSuccessful()); } return parent::_toHtml(); }
/** * Disable block output if logo turned off *M * @return string */ protected function _toHtml() { $type = $this->getLogoType(); // assigned in layout etc. $logoUrl = $this->_getConfig()->getAdditionalOptionsLogoUrl($this->_localeResolver->getLocaleCode(), $type); if (!$logoUrl) { return ''; } $this->setLogoImageUrl($logoUrl); return parent::_toHtml(); }
/** * @return string */ protected function _toHtml() { // Empty if disabled if (!$this->isEnabled()) { return ''; } // Define template $this->setTemplate($this->defineTemplate()); // Return default behavior return parent::_toHtml(); }
/** * Render block HTML * * @return string */ protected function _toHtml() { if (is_array($this->_crumbs)) { reset($this->_crumbs); $this->_crumbs[key($this->_crumbs)]['first'] = true; end($this->_crumbs); $this->_crumbs[key($this->_crumbs)]['last'] = true; } $this->assign('crumbs', $this->_crumbs); return parent::_toHtml(); }
/** * Disable block output if banner turned off or PublisherId is miss * * @return string */ protected function _toHtml() { $publisherId = $this->_paypalConfig->getBmlPublisherId(); $display = $this->_paypalConfig->getBmlDisplay($this->_section); $position = $this->_paypalConfig->getBmlPosition($this->_section); if (!$publisherId || $display == 0 || $this->_position != $position) { return ''; } $this->setData('publisher_id', $publisherId); $this->setData('size', $this->_paypalConfig->getBmlSize($this->_section)); return parent::_toHtml(); }
/** * Check whether authentication is required and prepare some template data * * @return string */ protected function _toHtml() { $method = $this->_checkoutSession->getQuote()->getPayment()->getMethodInstance(); if ($method->getIsCentinelValidationEnabled()) { $centinel = $method->getCentinelValidator(); if ($centinel && $centinel->shouldAuthenticate()) { $this->setAuthenticationStart(true); $this->setFrameUrl($centinel->getAuthenticationStartUrl()); return parent::_toHtml(); } } return parent::_toHtml(); }
/** * Produce and return block's html output * * @return string */ protected function _toHtml() { /** @var PricingRender $priceRender */ $priceRender = $this->getLayout()->getBlock($this->getPriceRender()); if ($priceRender instanceof PricingRender) { $product = $this->getProduct(); if ($product instanceof SaleableInterface) { $arguments = $this->getData(); $arguments['render_block'] = $this; return $priceRender->render($this->getPriceTypeCode(), $product, $arguments); } } return parent::_toHtml(); }
/** * Return billing agreement information * * @return string */ protected function _toHtml() { $agreementReferenceId = $this->_checkoutSession->getLastBillingAgreementReferenceId(); $customerId = $this->_customerSession->getCustomerId(); if (!$agreementReferenceId || !$customerId) { return ''; } $agreement = $this->_agreementFactory->create()->load($agreementReferenceId, 'reference_id'); if ($agreement->getId() && $customerId == $agreement->getCustomerId()) { $this->addData(['agreement_ref_id' => $agreement->getReferenceId(), 'agreement_url' => $this->getUrl('paypal/billing_agreement/view', ['agreement' => $agreement->getId()])]); return parent::_toHtml(); } return ''; }
/** * Disable block output if banner turned off or PublisherId is miss * * @return string */ protected function _toHtml() { if (!$this->_paypalConfig->isMethodAvailable(Config::METHOD_WPP_BML) && !$this->_paypalConfig->isMethodAvailable(Config::METHOD_WPP_PE_BML)) { return ''; } $publisherId = $this->_paypalConfig->getBmlPublisherId(); $display = $this->_paypalConfig->getBmlDisplay($this->_section); $position = $this->_paypalConfig->getBmlPosition($this->_section); if (!$publisherId || $display == 0 || $this->_position != $position) { return ''; } $this->setData('publisher_id', $publisherId); $this->setData('size', $this->_paypalConfig->getBmlSize($this->_section)); return parent::_toHtml(); }
/** * Render block HTML * * @return string */ protected function _toHtml() { if (false != $this->getTemplate()) { return parent::_toHtml(); } $html = ''; if ($this->getLinks()) { $html = '<ul' . ($this->hasCssClass() ? ' class="' . $this->escapeHtml($this->getCssClass()) . '"' : '') . '>'; foreach ($this->getLinks() as $link) { $html .= $this->renderLink($link); } $html .= '</ul>'; } return $html; }
/** * @return string */ protected function _toHtml() { /** @var \Magento\Checkout\Block\Cart\AbstractCart $originalBlock */ $originalBlock = $this->getLayout()->getBlock($this->getOriginalBlockName()); $quote = $originalBlock->getQuote(); if (!$quote->hasCanApplyMsrp() && $this->config->isEnabled()) { $quote->collectTotals(); } if ($quote->getCanApplyMsrp()) { $originalBlock->setTemplate(''); return parent::_toHtml(); } else { return ''; } }
/** * @return string */ protected function _toHtml() { $entityId = $this->_request->getParam('id'); if (intval($entityId) <= 0) { return ''; } $reviewsCount = $this->_ratingFactory->create()->getTotalReviews($entityId, true); if ($reviewsCount == 0) { #return __('Be the first to review this product'); $this->setTemplate('empty.phtml'); return parent::_toHtml(); } $ratingCollection = $this->_ratingFactory->create()->getResourceCollection()->addEntityFilter('product')->setPositionOrder()->setStoreFilter($this->_storeManager->getStore()->getId())->addRatingPerStoreName($this->_storeManager->getStore()->getId())->load(); if ($entityId) { $ratingCollection->addEntitySummaryToItem($entityId, $this->_storeManager->getStore()->getId()); } $this->assign('collection', $ratingCollection); return parent::_toHtml(); }
/** * Render the block if needed * * @return string */ protected function _toHtml() { if (!$this->shouldRender()) { return ''; } return parent::_toHtml(); }
/** * Prevent rendering if Persistent disabled * * @return string */ protected function _toHtml() { return $this->_persistentData->isEnabled() && $this->_persistentData->isRememberMeEnabled() ? parent::_toHtml() : ''; }
/** * @return */ protected function _toHtml() { $store = $this->_storeManager->getStore()->getId(); if ($this->_scopeConfig->getValue(SliderModel::XML_CONFIG_BANNERSLIDER, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $store)) { return parent::_toHtml(); } return ''; }
/** * @return string */ protected function _toHtml() { $adjustmentRenders = $this->getApplicableAdjustmentRenders(); if ($adjustmentRenders) { $this->adjustmentsHtml = $this->getAdjustments($adjustmentRenders); } $html = parent::_toHtml(); return $html; }