Jump to content
peterp

Incremental order numbers

Recommended Posts

Hi All,

         I'm trying to setup incremental order numbers in my store however even though I have specified that the number should have a prefix of 'BTW' this does not appear. The order number is correct when I look in the orders selection from the admin dashboard but when it prints the order using print order form gateway I get the order format of date time etc. not the incremental order number. I have looked through the forum but cannot find anything similar so I guess must have some setup wrong. I somebody could help straighten me out I would appreciate it.

Best Regards,

Peterp

Share this post


Link to post
Share on other sites

Initial examination of the POF gateway code suggests that it is not compliant with the new-ish capability of CubeCart to use alternate order numbering formats.

An issue will be posted in the Github.

 

Share this post


Link to post
Share on other sites

Hi, I'm having a similar issue I think, I've set a custom order number eg ABC00001 yet when payment confirmation is received the order number is of this format eg 200115-120925-1799. This is making it rather difficult to match orders with transactions. Is this something I can resolve or is this a wider issue?

I'm using the WorldPay Payment Gateway extension.

Many thanks in advance.

Edited by Phrkd
Extra Info

Share this post


Link to post
Share on other sites

"When payment confirmation is received"

Is this from an email sent by CubeCart? An email sent by WorldPay? Where do you see this order number (which is CubeCart's standard, legacy format)?

Share this post


Link to post
Share on other sites

Hello bsmither,

This is a confirmation of payment sent by WorldPay, below is an extract:

Thank you

Your transaction has been processed by WorldPay, on behalf of xxxxxxxxx.

Transaction details:

Transaction for the value of: GBP 0.01
Description: Payment for Order 200115-120925-1799
From: xxxxxx
Merchant's cart ID: 200115-120925-1799
Authorisation Date/Time: 15/Jan/2020 12:10:35
WorldPay's transaction ID: xxxxxxxxxxx
 

It's using the default cubecart format for the Payment for Order and Merchant cart ID, even though the incremental format has been set within CC and all orders within CC are showing as ABC000001 etc.

Thanks for your assistance.

Share this post


Link to post
Share on other sites

I understand.

We need to learn how to send additional arbitrary info to WorldPay so that they can send it back in their acknowledgement.

But, unless I missed something, CubeCart should list, in admin, Orders, the orders by the standard cart order ID format. Do you see something different in admin?

I see it now. The admin skin will show the custom order ID format if the store is set to that mode.

More later.

Share this post


Link to post
Share on other sites

The orders within Admin are in a custom incremental format as shown on the attached image. Obviously I can change this to the cubecart default format in Store Settings but that doesn't work for our needs. Hope I've understood your question..

admin_orders.jpg

Share this post


Link to post
Share on other sites

Yes, I found the code that shows the custom order number format.

I will see if we can do something with the WorldPay module.

Share this post


Link to post
Share on other sites

That would be great! Thank you for your help, bsmither. Very much appreciated.

Share this post


Link to post
Share on other sites

Please make this edit and test. (I have not confirmed this will work.)

In the gateway module WorldPay gateway.class.php file, near line 52, find:

'MC_OID' 	=> $this->_basket['cart_order_id'],

Change to:

'MC_OID' 	=> ($GLOBALS['config']->get('config', 'oid_mode')=='i' ? $this->basket[$GLOBALS['config']->get('config', 'oid_col')] : $this->_basket['cart_order_id']),

I am assuming the MC_OID is a value that WorldPay assumes is Merchant Cart Order ID. As such, I also assume that we can make this value whatever we want with impunity. This is not the same as the cartId, which is what WorldPay and CubeCart agree is the primary key to identifying which order is being referenced.

The edit above says that: if the store config is set to use Incremental order numbers (oid_mode == 'i'), then use the value found in the named column used for the custom format (oid_col should hold the name of the database column 'custom_oid'). Otherwise, use the standard format found in the 'cart_order_id' column.

 

Share this post


Link to post
Share on other sites

I've made the change and actioned a transaction but it appears to still be picking up the default format:

 

Screenshot.jpg

Edited by Phrkd

Share this post


Link to post
Share on other sites

Ok, but the excerpt (Thank You email?) you posted above also includes a reference to the Merchant's Cart ID.

Where did the data you posted just now come from?

Share this post


Link to post
Share on other sites

That is from the WorldPay payment page. I can carry out a full transaction to get the Thank You email I originally posted, but I assumed that because it is still showing that default ID format there'd be no point.

Edited by Phrkd

Share this post


Link to post
Share on other sites

Ok. I may not be able to review the WorldPay documentation as it pertains to what gets displayed at WorldPay, but did the Custom OID appear on the email sent out by WorldPay to you?

Edited by bsmither

Share this post


Link to post
Share on other sites

I'll run another test and report back.

Still the same unfortunately bsmither.

Thank you

Your transaction has been processed by WorldPay, on behalf of xxxxxxx.

Transaction details:

Transaction for the value of: GBP 0.01
Description: Payment for Order 200115-184348-4112
From: xxxxxx
Merchant's cart ID: 200115-184348-4112
Authorisation Date/Time: 15/Jan/2020 18:44:38
WorldPay's transaction ID: xxxxxxxxxx

I've also just noticed this on the cubecart checkout page (/index.php?_a=complete):

Your Order: #200115-184348-4112 - Processing

Customer Information

Billing Address

So it seems this is where WorldPay is getting its info from?

Share this post


Link to post
Share on other sites

To clarify it appears that the admin/back end of cubecart is using the specified incremental order number id, but the cubecart shop/front end is still using the default cubecart format order number.

 

Share this post


Link to post
Share on other sites

If possible, ask your WorldPay customer representative to examine the submission data payload for a transaction. Ask then to verify that the key 'MC_OID' is being used to populate the emailed response.

 

Share this post


Link to post
Share on other sites

Will do, it's late here now so will endeavour to speak to them tomorrow AM. Thanks for your help again.

Share this post


Link to post
Share on other sites

Also, please verify that the CubeCart user that accesses the database has CREATE TRIGGER permissions. You may need to use an external utility (such as phpMyAdmin - found in your hosting account's control panel) to examine the permissions of this user.

Share this post


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