AjaxFw (CJAX) For CodeIgnater 5.0 Stable |
[eluser]Ajaxboy[/eluser]
This is very simple, and there are different ways it could be accomplished. #1. You could add on "change" event to the textbox where the promo code is entered: Code: $ajax->Exec('text_id', $ajax->call('ajax.php?PromoCode/checkPromoCode/|text_id|'),'change'); Code: class PromoCode extends CI_Controller { You could have a button (or an image) some where to apply the code. Code: $ajax->Exec('button_id', $ajax->call('ajax.php?PromoCode/checkPromoCode/|text_id|')); (apply same controller sample as above) Let me know if these examples are not clear enough or if you need further explanation :) Once the promo code is applied, you can manipulate elements on the front to reflect the changes, see this: http://cjax.sourceforge.net/docs/manipul...tainer.php You could update the total price by grabbing shopping cart total minus promo code value, and update the total: Code: $ajax->total = "New Total"; documentation: http://cjax.sourceforge.net/docs/ ajaxboy |
Welcome Guest, Not a member yet? Register Sign In |