creditkey / magento2-b2bgateway

Credit Key Magento 2 Module
MIT License
0 stars 4 forks source link

PDP Marketing Content Display Feature #15

Closed rain2o closed 5 years ago

rain2o commented 5 years ago

Adds the ability to display marketing content on product detail pages.

New config fields added to enable this feature, select the products to display the content on, and select the button style. I'm not entirely in love with the Multiselect for the product select, but I wasn't able to figure out a better solution within the confines of the Store->Configuration section. The label of each option in the multiselect is formatted as "Product Name [SKU]". This can be extended by using dependency injection to change the format if so desired. Screen Shot 2019-04-28 at 1 49 19 PM

Currently this feature is injected into the catalog_product_view layout just below the Price display. This can be moved per theme as needed.

I noticed that the content which is rendered is rendered as a clickable button/link, but does not do anything or lead anywhere when clicked. This is a little misleading to the user I believe.

As an additional note, please notice that I moved the file view/frontend/web/js/creditkey-js.js to view/base/web/js/creditkey-js.js so that it can be loaded in both adminhtml and frontend contexts without having duplicate files. As long as you be sure to clear all caches (including browser cache) this shouldn't cause an issue with the previously loaded JS from frontend.