当前位置: 首页>>代码示例>>PHP>>正文


PHP Context::getValue方法代码示例

本文整理汇总了PHP中Magento\Framework\App\Http\Context::getValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getValue方法的具体用法?PHP Context::getValue怎么用?PHP Context::getValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\App\Http\Context的用法示例。


在下文中一共展示了Context::getValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getBackTitle

 /**
  * Return back title for logged in and guest users
  *
  * @return \Magento\Framework\Phrase
  */
 public function getBackTitle()
 {
     if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
         return __('Back to My Orders');
     }
     return __('View Another Order');
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:12,代码来源:Invoice.php

示例2: _toHtml

 /**
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH)) {
         return '';
     }
     return parent::_toHtml();
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:Link.php

示例3: _toHtml

 /**
  * @return string
  */
 protected function _toHtml()
 {
     if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
         return '';
     }
     return parent::_toHtml();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Link.php

示例4: getReorderUrl

 /**
  * Get url for reorder action
  *
  * @param \Magento\Sales\Model\Order $order
  * @return string
  */
 public function getReorderUrl($order)
 {
     if (!$this->httpContext->getValue(Context::CONTEXT_AUTH)) {
         return $this->getUrl('sales/guest/reorder', ['order_id' => $order->getId()]);
     }
     return $this->getUrl('sales/order/reorder', ['order_id' => $order->getId()]);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:Buttons.php

示例5: _toHtml

 /**
  * {@inheritdoc}
  */
 protected function _toHtml()
 {
     if (!$this->_customerHelper->isRegistrationAllowed() || $this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH)) {
         return '';
     }
     return parent::_toHtml();
 }
开发者ID:aiesh,项目名称:magento2,代码行数:10,代码来源:RegisterLink.php

示例6: _toHtml

 /**
  * {@inheritdoc}
  */
 protected function _toHtml()
 {
     if (!$this->_registration->isAllowed() || $this->httpContext->getValue(Context::CONTEXT_AUTH)) {
         return '';
     }
     return parent::_toHtml();
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:RegisterLink.php

示例7: getCustomerGroupId

 /**
  * Get customer group id
  *
  * @return int
  */
 protected function getCustomerGroupId()
 {
     $customerGroupId = (int) $this->getRequest()->getParam('cid');
     if ($customerGroupId == null) {
         $customerGroupId = $this->httpContext->getValue(Context::CONTEXT_GROUP);
     }
     return $customerGroupId;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:13,代码来源:Discounts.php

示例8: getWelcome

 /**
  * Retrieve welcome text
  *
  * @return string
  */
 public function getWelcome()
 {
     if (empty($this->_data['welcome'])) {
         if ($this->httpContext->getValue(Context::CONTEXT_AUTH)) {
             $customerName = $this->_customerViewHelper->getCustomerName($this->_customerSession->getCustomerDataObject());
             $this->_data['welcome'] = __('Welcome, %1!', $this->escapeHtml($customerName));
         } else {
             $this->_data['welcome'] = $this->_scopeConfig->getValue('design/header/welcome', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
         }
     }
     return $this->_data['welcome'];
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:Header.php

示例9: getReorderUrl

 /**
  * Get url for reorder action
  *
  * @param \Magento\Sales\Model\Order $order
  * @return string
  */
 public function getReorderUrl($order)
 {
     if (!$this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH)) {
         return $this->getUrl('sales/guest/reorder', array('order_id' => $order->getId()));
     }
     return $this->getUrl('sales/order/reorder', array('order_id' => $order->getId()));
 }
开发者ID:aiesh,项目名称:magento2,代码行数:13,代码来源:Buttons.php

示例10: getBackTitle

 /**
  * Return back title for logged in and guest users
  *
  * @return string
  */
 public function getBackTitle()
 {
     if ($this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH)) {
         return __('Back to My Orders');
     }
     return __('View Another Order');
 }
开发者ID:aiesh,项目名称:magento2,代码行数:12,代码来源:Invoice.php

示例11: getDefaultFrom

 /**
  * Get default value for From field
  *
  * @return string
  */
 public function getDefaultFrom()
 {
     if ($this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH)) {
         return $this->_customerSession->getCustomer()->getName();
     } else {
         return $this->getEntity()->getBillingAddress()->getName();
     }
 }
开发者ID:aiesh,项目名称:magento2,代码行数:13,代码来源:Inline.php

示例12: isWishlistActive

 /**
  * @return bool
  */
 public function isWishlistActive()
 {
     $isActive = $this->_getData('is_wishlist_active');
     if ($isActive === null) {
         $isActive = $this->_scopeConfig->getValue('wishlist/general/active', \Magento\Store\Model\ScopeInterface::SCOPE_STORE) && $this->httpContext->getValue(\Magento\Customer\Helper\Data::CONTEXT_AUTH);
         $this->setIsWishlistActive($isActive);
     }
     return $isActive;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:12,代码来源:Cart.php

示例13: _construct

 /**
  * 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');
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:15,代码来源:Form.php

示例14: getCacheKeyInfo

 /**
  * Get Key pieces for caching block content
  *
  * @return array
  */
 public function getCacheKeyInfo()
 {
     $shortCacheId = ['CATALOG_NAVIGATION', $this->_storeManager->getStore()->getId(), $this->_design->getDesignTheme()->getId(), $this->httpContext->getValue(Context::CONTEXT_GROUP), 'template' => $this->getTemplate(), 'name' => $this->getNameInLayout(), $this->getCurrentCategoryKey()];
     $cacheId = $shortCacheId;
     $shortCacheId = array_values($shortCacheId);
     $shortCacheId = implode('|', $shortCacheId);
     $shortCacheId = md5($shortCacheId);
     $cacheId['category_path'] = $this->getCurrentCategoryKey();
     $cacheId['short_cache_id'] = $shortCacheId;
     return $cacheId;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:16,代码来源:Navigation.php

示例15: _prepareLastOrder

 /**
  * Get last order ID from session, fetch it and check whether it can be viewed, printed etc
  *
  * @return void
  */
 protected function _prepareLastOrder()
 {
     $orderId = $this->_checkoutSession->getLastOrderId();
     if ($orderId) {
         $order = $this->_orderFactory->create()->load($orderId);
         if ($order->getId()) {
             $isVisible = !in_array($order->getStatus(), $this->_orderConfig->getInvisibleOnFrontStatuses());
             $canView = $this->httpContext->getValue(Context::CONTEXT_AUTH) && $isVisible;
             $this->addData(['is_order_visible' => $isVisible, 'view_order_url' => $this->getUrl('sales/order/view/', ['order_id' => $orderId]), 'print_url' => $this->getUrl('sales/order/print', ['order_id' => $orderId]), 'can_print_order' => $isVisible, 'can_view_order' => $canView, 'order_id' => $order->getIncrementId()]);
         }
     }
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:17,代码来源:Success.php


注:本文中的Magento\Framework\App\Http\Context::getValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。