Jump to content
ihatedeskjets

Barclays Pingit

Recommended Posts

Can anyone help me get this module working please http://addons.oscommerce.com/info/8345

 

I've edited some of it but the phone number entered by the customer at checkout is not added to the order comments and I really need this, here's the chunk of code:

 

function confirmation() {
 $confirmation = array('fields' => array(array('title' => MODULE_PAYMENT_PINGIT_CUSTOMER_MOBILE,
											 'field' => tep_draw_input_field('mobile_owner')),
										 array('title' => MODULE_PAYMENT_PINGIT_TEXT_DESCRIPTION)));
 return $confirmation;
}
function process_button() {
 return false;
}
function before_process() {
 return false;
}
function after_process() {
 global $HTTP_POST_VARS, $order, $insert_id;
 $sql_data_array = array('orders_id' => (int)$insert_id,
						 'orders_status_id' => (int)$order->info['order_status'],
						 'date_added' => 'now()',
						 'customer_notified' => '0',
						 'comments' => MODULE_PAYMENT_PINGIT_CUSTOMER_MOBILE . ' ' . $HTTP_POST_VARS['mobile_owner']);
 tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
}
function get_error() {
 return false;
}

 

The MODULE_PAYMENT_PINGIT_CUSTOMER_MOBILE info is added correctly to the comments but mobile_owner is not, so I am ussuming it is because PHP 5 does not allow $HTTP_POST_VARS,

 

I tried $_POST['mobile_owner']);

 

It didnt work it would appear that mobile_owner is empty

 

All ideas greatly appreciated.

Edited by ihatedeskjets

Share this post


Link to post
Share on other sites

Thanks for that Burt,

But I dont need anything else doing except this little puzzle as I've already updated other files to show the QR code for pingit and invoicing and stuff and it's not what you'd call a conventional backend anymore as it runs several stores at once.

I'm just baffled why $_post isn't working.

Share this post


Link to post
Share on other sites

Hi

 

No idea why $_POST would not work for you but how about something like

 

in before_process()

 

Look for a $_SESSION['my_name'], if set then kill it

 

Now look for $_POST['mobile_owner']

if not found then maybe bounce back to checkout_confirmation as the assumption is not filled in (even better jQuery in a field validation in checkout_confirmation?) If this keeps happening then maybe the form in checkout_confirmation is not encompassing the field?

 

if found then just pass the value into a $_SESSION['my_name']

 

Then in after_process use the $_SESSION['my_name'] my name instead of the $_POST value in the comments

Then destroy the $_SESSION

 

Be easier if $_POST worked though ;-)

Share this post


Link to post
Share on other sites

Solved!

 

Hi thanks for the input, I've re-structured it to use the existing comments form so if pingit, re draw the comments form and invite the customer to enter their mobile number. Not perfect as it can be ignored but good enough for now.

 

Cheers

Ken

Share this post


Link to post
Share on other sites

Hi - I've just installed this on 2.3.3.2 and it works straight 'out of the can' using XAMP with PHP 5.4.x so like Burt says there's something hooky elsewhere - php config?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×