
Originally Posted by
BillJ
Note that I have modified the code slightly so it always shows the "Sold Out" button even when BIS is enabled. The problem shows up whether or not my modification is in place. I suspect you are correct - the template is based on the "Responsive All Business" template, which is quite old now.
You appear to be correct. Below is the JavaScript that is called when the link is clicked.
Code:
$('a.back-in-stock-listing-popup-link').click(function (event) {
event.preventDefault();
var productDiv = $(this).parent();
$('#contact_messages').empty();
$('#back-in-stock-product-image img').attr('src', $(productDiv).find('.listingProductImage').attr('src'));
if ($(productDiv).find('h3.itemTitle')) {
$('#productName').html($(productDiv).find('h3.itemTitle').text());
} else {
$('#productName').html($(productDiv).find('span.itemTitle').text());
}
$('input[name="product_id"]').attr('value', $(productDiv).find('input[name="bis-product-id"]').attr('value'));
$.fancybox({
href: '#back-in-stock-popup-wrapper',
afterShow: function () {
$(document).on('submit', '#back-in-stock-popup-wrapper form[name="back_in_stock"]', function () {
$.post('ajax/back_in_stock_subscribe_pop_up.php', $('#back-in-stock-popup-wrapper form[name="back_in_stock"]').serialize(), function (data) {
$('#contact_messages').html(data);
if ($('.messageStackSuccess').length) {
$('.back-in-stock-popup-wrapper-button-row').hide();
$('.back-in-stock-popup-content-wrapper').hide();
}
});
return false;
});
}
});
});
So personally I would first try is in: catalog/includes/templates/YOUR_TEMPLATE/jscript/jquery/jquery_back_in_stock.js
Change:
Code:
var productDiv = $(this).parent();
To:
Code:
var productDiv = $(this).parent().parent().parent();