WT Add products info to Joomla script options
This plugin is intended for developers. This solution is not in "1 click".
What is it and why?
What is it?
To create feedback forms in the online store on Joomla JoomShopping, such as:
- quick order of goods
- ask a question about the product
- request for a discount on an ite
- wholesale price request
And so on - for all Joomla feedback forms, where you need to specify information about the product.
In order to make a beautiful and informative lead magnet, a feedback form that specifies the specific product in question.
Webmasters often get data for forms directly from the HTML layout of the site. In the case of a design change, it is easy to damage the structure on which the JS script relies and the feedback form will stop receiving data about the product.
Getting data about JoomShopping products for the feedback form
This way, you can get data from a JSON object. The
product_id variable is read in advance from the button that the site visitor clicks on.
let jshop_products_details = Joomla.getOptions('jshop_products_details');> let product_name = jshop_products_details[product_id]['product_name']; let product_price = jshop_products_details[product_id]['price']; let product_image_url = jshop_products_details[product_id]['product_image_url']; let product_ean = jshop_products_details[product_id]['ean'];
The plugin works in the product category, the list of products of the manufacturer, the single product view. The structure of the json array is the same everywhere - you don't have to write different code for different pages.
- Extension type:
- Joomla version:
- 3.10, 4.1