?? GreyFile — Mystic File Browser

Current path: home/webdevt/www/demo2/wp-content/themes/blocksy/static/js/frontend/woocommerce/



?? Go up: /home/webdevt/www/demo2/wp-content/themes/blocksy/static/js/frontend

?? Viewing: variation-stock.js

import $ from 'jquery'

let mounted = false

export const mount = (el, { event }) => {
	if (mounted || !$) {
		return
	}

	;['found_variation', 'reset_data'].forEach((eventName) => {
		$(el).on(eventName, (e, eventData) => {
			const stockContainer = el
				.closest('.product')
				.querySelector('.ct-woo-card-stock')

			if (!stockContainer) {
				return
			}

			if (eventData?.availability_html) {
				stockContainer.innerHTML = eventData.availability_html
			} else {
				stockContainer.innerHTML = ''
			}
		})
	})
}


??

??