I want to pass ajax request from themes folder/loyalty.tpl
to /public_html/test/modules/loyalty/LoyaltyModule.php
in prestashop 1.6.1.5
<input id="Gcash_id" name="Gcash_id" type="text" class="form-control grey" placeholder="Enter your G cash code you will get Gcash amount" /><br>
<div id="errorBoxgcash" style="color:#FF0000; font-size:16px;"> </div><br>
<button type="submit" name="Submit" value="OK" onclick="return gcashValue();" class="btn btn-default button button-small"><span>{l s='Ok'}</span></button>
<script type="text/javascript">
{literal}
function gcashValue() {
if ($.trim($("#Gcash_id").val()) == ''){
$("#Gcash_id").focus();
$("#errorBoxgcash").removeClass('hide');
$("#errorBoxgcash").html("Please enter GCash ID");
return false;
}
var gcashidVal=$('#Gcash_id').val();
//alert(gcashidVal);
$.ajax({
url:'{$base_dir}modules/loyalty/LoyaltyModule/gcashId',
type: 'POST',
data: 'ajax=true&gcashidVal='+gcashidVal,
success: function(response) {
alert(response);
console.log('success');
document.getElementById("Gcash_id").innerHTML=response;
}
});
return false;
}
{/literal}
</script>
I am not able to pass the ajax request using the url format of the ajax call of the prestashop loyalty module mentioned above So please give me the correct url format as the concerned to the error mentioned in the screenshot of post request error in the console of firebug I am getting error in the console when making ajax call from
/public_html/test/themes/pf_newfashionstore/modules/loyalty/views/templates/front/loyalty.tpl to /public_html/test/modules/loyalty/LoyaltyModule.php
http://imgur.com/a/kspSi