Ejemplo n.º 1
0
 /**
  * Prepare category attribute html output
  *
  * @param ModelCategory $category
  * @param string $attributeHtml
  * @param string $attributeName
  * @return string
  */
 public function categoryAttribute($category, $attributeHtml, $attributeName)
 {
     $attribute = $this->_eavConfig->getAttribute(ModelCategory::ENTITY, $attributeName);
     if ($attribute && $attribute->getFrontendInput() != 'image' && (!$attribute->getIsHtmlAllowedOnFront() && !$attribute->getIsWysiwygEnabled())) {
         $attributeHtml = $this->_escaper->escapeHtml($attributeHtml);
     }
     if ($attribute->getIsHtmlAllowedOnFront() && $attribute->getIsWysiwygEnabled()) {
         if ($this->_catalogData->isUrlDirectivesParsingAllowed()) {
             $attributeHtml = $this->_getTemplateProcessor()->filter($attributeHtml);
         }
     }
     $attributeHtml = $this->process('categoryAttribute', $attributeHtml, ['category' => $category, 'attribute' => $attributeName]);
     return $attributeHtml;
 }
Ejemplo n.º 2
0
 /**
  * isUrlDirectivesParsingAllowed()
  * setStoreId()
  * @magentoConfigFixture current_store catalog/frontend/parse_url_directives 0
  */
 public function testIsUrlDirectivesParsingAllowed()
 {
     $this->assertFalse($this->helper->isUrlDirectivesParsingAllowed());
     $this->helper->setStoreId(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore()->getId());
     $this->assertFalse($this->helper->isUrlDirectivesParsingAllowed());
 }