0

Using Magento 2.3.2.

We currently sell through our website, and Amazon and Ebay via the M2E Pro extension. Our current product description is used for the website and Ebay, and the short description is used for Amazon.

The product description is not really suitable for the website, as it contains a lot of ebay related content, so I was wondering if it was possible to create a new attribute, say, 'web_description' and use that as the description on the website.

Any help in solving this problem would be greatly appreciated.

Thank you.

asked Oct 2, 2020 at 18:36

2 Answers 2

1

Add a new web_description attribute using admin.

Then in your custom theme, in Magento_Catalog/layout/catalog_product_view.xml, add the code below. <referenceBlock name="product.info.description"><arguments><argument name="at_call" xsi:type="string">getWebDescription</argument> <argument name="at_code" xsi:type="string">web_description</argument> <argument name="css_class" xsi:type="string">web-description</argument></arguments></referenceBlock>

answered Oct 4, 2020 at 5:42
1
  • That actually seems a bit more straightforward than my solution. Commented Oct 4, 2020 at 7:25
0

I found the answer on another post

/vendor/theme/magento_catalog/templates/product/view/attribute.phtml

$_call = $block->getAtCall();
if($_code == "description") {
$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); 
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
$storeCode = $storeManager->getStore()->getCode();
if($_code == "description") {
 $_call = 'getWebsiteDescription' ;
 $_code == "website_description";
}
 }
$_className = $block->getCssClass();
$_attributeLabel = $block->getAtLabel();
$_attributeType = $block->getAtType();
$_attributeAddAttribute = $block->getAddAttribute();
answered Oct 4, 2020 at 7:18

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.