Case history: how to create a plugin that adds the classical label on product image in the different layouts concerning products (product page, category page, related products, upsell, cross-sell).
1. To create two labels with different shape and position,
2. To have a divided graphic management of these labels,
3. To avoid linking labels to single products, but working on categories
They focused on some issues that highlight the new mechanisms in Magento 2, compared to the usual procedures in Magento 1:
– Structure of folds and plugin files, different from Magento 1,
– Plugin registration, different from Magento 1,
– Use of dependency injection in M2,
– Core rewriting through ‘plugin’ in M2,
– Adding an ACL, different from Magento 1,
– Adding setting parameters and source models, similar to M1.
They shared technical choices, the problems we faced, the status of the documentation available online and the interaction with Magento community.