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.
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.
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.
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
toview/base/web/js/creditkey-js.js
so that it can be loaded in bothadminhtml
andfrontend
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.