i just wanted some more information on how they work!
Example Code - the cart
Code: Select all
$.ajax({
type: 'post',
url: 'index.php?route=module/cart/callback',
dataType: 'html',
data: 'remove=' + this.id,
success: function (html) {
$('#module_cart .middle').html(html);
if (getUrlParam('route').indexOf('checkout') != -1) {
window.location.reload();
}
}
});
does this mean the function callback() in the controller/module/cart?
i notice if i just browse to it i get a blank screen instead of a 404. how come?
is this due to this bit of code in controller/module/cart?
Code: Select all
if ($this->request->server['REQUEST_METHOD'] == 'POST') {
if (isset($this->request->post['remove'])) {
$result = explode('_', $this->request->post['remove']);
$this->cart->remove(trim($result[1]));
} else {
if (isset($this->request->post['option'])) {
$option = $this->request->post['option'];
} else {
$option = array();
}
$this->cart->add($this->request->post['product_id'], $this->request->post['quantity'], $option);
}
}
could i create a function called callback() in controller/product/catagory.php and point the ajax post function to
url: 'index.php?route=product/catagory/callback'
what code would i need to make it accept that request?
any help would be kindly appreciated
regards twun