Estoy usando el tema del amanecer. Mi aplicación de terceros anulará el botón Agregar al carrito original del tema Amanecer. Sin embargo, la aplicación no actualizará el ícono de incremento del letrero del carrito, la ventana emergente de la notificación del carrito tampoco se mostrará. En el código del archivo product-form.js, el icono y la notificación se representan después de pasar una respuesta. ¿Alguien puede darme algunos consejos para modificar mi código y mantener disponible la función original?
por favor mira en el código
if (!customElements.get('product-form')) { customElements.define('product-form', class ProductForm extends HTMLElement { constructor() { super(); this.form.addEventListener('submit', this.onSubmitHandler.bind(this)); this.cart = document.querySelector('cart-notification'); } onSubmitHandler(evt) { evt.preventDefault(); const config = fetchConfig('javascript'); config.headers['X-Requested-With'] = 'XMLHttpRequest'; delete config.headers['Content-Type']; const formData = new FormData(this.form); fetch(`${routes.cart_add_url}`, config) .then((response) => response.json()) .then((response) => { this.cart.renderContents(response); //when item add //to cart, the //renderContents() will be called to //show cart notification } } } }