Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

how do i change the order no.


Guest

Recommended Posts

Posted

I need some php lessons please... i need a order no. and pass it to Plugnpay (my payment gateway). I need it to be thesame as with my OSC order number. Right now it generates using the current date.

 

i found this line in includes/modules/payment/plugnpay.php

 

      $pnp_date = date("YmdHis");
     $pnp_orderID = $pnp_date . substr(getmypid(),0,3);

 

please help me hard code this to generate same number as my OSC generates Order number. I think we can pull sumthing in the MySql database and add +1 to it then thats it.. but i dnt know php and sql... :( please help

 

thanks in advanced

  • 4 months later...
Posted

does inserting the codes below help in any way?

 

//generate the last ordernum

$random_addition = rand(7,15);

 

$last_order_id = tep_db_query("select orders_id from " . TABLE_ORDERS . " o order by o.orders_id desc limit 1");

 

$old_order_id = tep_db_fetch_array($last_order_id);

 

$ordernum = ($old_order_id['orders_id'] + $random_addition);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...