-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.4.16
-- Error-message(debug-mod must be tuned on) -- : jQuery error : Uncaught RangeError: Maximum call stack size exceeded
Hello,
For a client I've developed a custom pricing plugin which is working great, the pricing is based on 2 custom fields (made in HikaShop). Now the client wants that once the those fields have a certain value, the text value of the price is set. So I've written a small component which returns that price as JSON and now I'm trying to use AJAX to fetch that price but jQuery is returning this error
Uncaught RangeError: Maximum call stack size exceeded
The code that does the AJAX call:
jQuery(document).ready(function() {
// if(typeof(hkjQuery) == "undefined") window.hkjQuery = window.jQuery;
// window.hikashop.ready(function() {
jQuery('#breedte').on('keyup', function(event) {
if(parseInt(jQuery(this).val()) > 30 && parseInt(jQuery("#hoogte").val()) > 30) {
getPrices();
}
});
jQuery('#hoogte').on('keyup', function(event) {
if(parseInt(jQuery(this).val()) > 30 && parseInt(jQuery("#breedte").val()) > 30) {
getPrices();
}
});
});
function getPrices() {
jQuery.ajax({
url: '<?php echo JRoute::_("index.php?option=com_name&task=prices.getprices"); ?>',
data : { 'width': jQuery('#hoogte').val(), 'height' : jQuery('#hoogte'), 'product_id' : jQuery('#product_id').val() },
dataType : 'json',
type : 'POST'
}).done(function(returnData) {
console.log(returnData);
// jQuery('.hikashop_product_price').text( "€ " + returnData.price +"");
}).fail(function(returnData) {
console.log(returnData);
});
}
</script>
Any suggestions?