Add price beside the ATC button and update it when the variant is changed

akilh
Visitor
2 0 0

i need to add price beside the ATC button in product page in Be Yours theme, in this theme there is a field name price-money that display price whenever the variant is changed. i need the same field to display beside the ATC button

 

 

To Display the price beside ATC:
i added in the buy-buttons.liquid this code
<span class="price-item price-item--regular" id="price-money">{{ product.price | money }}</span>

akilh_0-1713163841614.png

 


also in global.js file this is the code for the price-money

// Change price
const price__regular = this.querySelector('.price__regular');
price__regular.querySelector('.price-item--regular').innerHTML = `<price-money><bdi>${theme.Currency.formatMoney(price, window.shopSettings.moneyFormat)}</bdi></price-money>`;

const price__sale = this.querySelector('.price__sale');
price__sale.querySelector('.price-item--regular').innerHTML = `<price-money><bdi>${theme.Currency.formatMoney(compare_at_price, window.shopSettings.moneyFormat)}</bdi></price-money>`;
price__sale.querySelector('.price-item--sale').innerHTML = `<price-money><bdi>${theme.Currency.formatMoney(price, window.shopSettings.moneyFormat)}</bdi></price-money>`;



what should i do so that the price money field will be displaying the value beside ATC also change when the variant is changed?



 

Replies 0 (0)