0

How can admin achieve it? I have attached the image in which 2 things admin wants to achieve.

  1. Category level - for clothing category admin want to show below add to cart " 7 Days Exchange Available " Suppose for mobile category admin want to show " 5 Days Replacement Available " Admin wants to set category wise different days. In the mobile category, admin wants to show only ___ Days Replacement Available. In Clothing Category admin want to show ____ Days Exchange, ____ Days Return In Medical Products admin want to show " This item is not returnable " how can admin achieve it at the category level? Means for separate category admin want to write separate days and in some category, replacement is available, in some category exchange and returns are available and in some category " this item is not returnable "

  2. Brand - Adiddas Admin has created Product Attribute As Brand and at the time of product adding brand value is written.

Can anybody tell how can admin achieve it?

enter image description here

0

You have to create two category attribute as below. One is drop down(Is returnable/exchangeable) and another is No of days to return/exchange. drop down value will be [Returnable, Exchangeable, Non Returnable].

  1. Is returnable/exchangeable
  2. No of days to return/exchange

After that you need to overwrite the catalog_catgory_view.xml to add new block under the addtocart block. and this new block you have to show the message and Brand value.

Need to check first condition with drop down value and check show the message withe text field value.

One Creategory attribute create by installer script:. You can create more category attribute by this script with change below values.

$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(\Magento\Catalog\Model\Category::ENTITY, 'is_returnable', [
            'type'     => 'int',
            'label'    => 'Is Returnable/Exchangeable',
            'input'    => 'boolean',
            'source'   => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
            'visible'  => true,
            'default'  => '0',
            'required' => false,
            'global'   => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_STORE,
            'group'    => 'Display Settings',
        ]); 
2
  • can you tell me how can we create new category attribute ?
    – vrushank
    Sep 3 '20 at 5:34
  • Added the category attribute script to create category attribute. Sep 5 '20 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.