質問

How can I add a new product tag like 'New', 'Promo'.

And need to display it with the product edit page as a toggle.

In category pages, it should be near to the product list.

役に立ちましたか?

解決

What you're after is attributes.

There are a few way this can be done, but mainly you create attributes and attach them in attribute sets accordingly. From here you can add values to those attributes for each product and create your logic on how you'd like to use and display them.

For example if you create attribute called "New Tag" (code: new_tag), then you'd fetch it in your phtml template like so: $newAttributeTag = $product->getNewTag();

Magento will automatically fetch your attribute and you can now use your newly created variable to create your logic.

ライセンス: CC-BY-SA帰属
所属していません magento.stackexchange
scroll top