Massimo333 Posted May 8, 2024 Share Posted May 8, 2024 Hello, on a prestashop prduct page, how can I get product price with jquery? Link to comment Share on other sites More sharing options...
Mediacom87 Posted May 8, 2024 Share Posted May 8, 2024 Link to comment Share on other sites More sharing options...
Nickz Posted May 8, 2024 Share Posted May 8, 2024 1 hour ago, Massimo333 said: Hello, on a prestashop prduct page, how can I get product price with jquery? ???? don't you see your price? Or do you wish to extract the price of the DB? Link to comment Share on other sites More sharing options...
Massimo333 Posted May 21, 2024 Author Share Posted May 21, 2024 On 5/8/2024 at 2:01 PM, Nickz said: ???? don't you see your price? Or do you wish to extract the price of the DB? I need to extract the price from the product page by jQuery. Link to comment Share on other sites More sharing options...
WebDesk Solution Posted June 6, 2024 Share Posted June 6, 2024 Hello @Massimo333, To get product price with jQuery please use the below code you need to add the below script in your theme custom.js filePath URL: themes\{{your_theme}}\assets\js\custom.jsCode: $(document).ready(function() { var stringfyproductDetails = $('#product-details.js-product-details').attr('data-product'); var productDetails = JSON.parse(stringfyproductDetails); $('.product-price-jquery').text(productDetails.price) }) and need to show on the product page need to add a div like below screenshotScreenshot: https://prnt.sc/vevD3B2yS_-NPath URL: themes\{{your_theme}}\templates\catalog\product.templatesCode: {* Custom Price Show using JQuery *} Product Price using Jquery: <div class="product-price-jquery"></div> {* Custom Price Show using JQuery *} After making these changes to your template files, please clear the cache to see the updates on the front end.Preview: https://prnt.sc/7b4GxSp7uEjF Link to comment Share on other sites More sharing options...
Nickz Posted June 6, 2024 Share Posted June 6, 2024 On 5/21/2024 at 2:36 PM, Massimo333 said: I need to extract the price from the product page by jQuery. when editing a .php or .tlp download the file, rename it with adding a 2 or any letter you wish to use. Upload it to the same location. That way you create a back up for the file you wish to edit. Be mindful as some ftp have downloaded empty files. It can happen. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now