jQuery(document).ready(function($) {
// Use event delegation for dynamically loaded elements
$(document).on('click', '[data-product][data-shop]', function() {
var product = $(this).data('product');
var shop = $(this).data('shop');
// Wait briefly to ensure popup is fully loaded
setTimeout(function() {
$('#product_name').val(product);
$('#shop_id').val(shop);
}, 100);
});
});