Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Barclays Pingit


ihatedeskjets

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
Link to comment
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.

Link to comment
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 ;-)

Link to comment
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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...