How to get prices on category and product page via ajax
-
15-04-2021 - |
해결책
use Ui Components
in this case, to get or modify the price in the category or product pages.
no need to use AJAX calls use Ui Components
instead
Its well described here in this guide
- locate the javascript ui components used in the product and category pages
- Override them in your requirejs
- use a mix-in and get or modify the prices
added a few links below for your reference
Format price with javascript in Magento 2
Magento2 - How to use Magento_Catalog/js/price-box to format price in template?
Magento 2: How to include JS on the product page?
Magento2: How can I override core js module price-box.js
Magento 2: Add to Cart JS Override works on product page but not on category page
제휴하지 않습니다 magento.stackexchange