php - new session opencart checkout -


i want add new session['abc'] during checkout step 5: payment method (1.5.5.1).

what i've done far:

/template/checkout/payment_method.tpl add

<input type="hidden" name="abc" value="1111"  id="abc"> 

/template/checkout/checkout.tpl

data: $('#payment-method input[type=\'radio\']:checked, #payment-method input[type=\'checkbox\']:checked, #payment-method textarea'), 

changed to

data: $('#payment-method input[type=\'radio\']:checked, #payment-method input[type=\'checkbox\']:checked, #payment-method textarea, #payment-method input[type=\'hidden\']'), 

/controller/checkou/payment_method.php after

$this->session->data['payment_method'] = $this->session->data['payment_methods'][$this->request->post['payment_method']]; 

added

$this->session->data['abc'] = strip_tags($this->request->post['abc']); 

and error message is

syntaxerror: json.parse: unexpected character  ok  <b>notice</b>: undefined index:  salutation in <b>d:\phpnow\phpnow-1.5.6\htdocs\1\catalog\controller\checkout\payment_method.php</b> on line <b>190</b>[] 

welcome stackoverflow.

in controller's code (/controller/checkou/payment_method.php) have somewhere kind of code:

echo 'ok'; 

or

print('ok'); 

or

die('ok'); 

that comes prior json output. in addition, index salutation in array not defined (does not exist) should first test it's presence e.g. way:

if(isset($some_array['salutation'])) { /* code */ } 

or

if(!empty($some_array['salutation'])) { /* code */ } 

removing echo 'ok'; , testing array index should fix problem.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -