Jump to content

Add a prefix to the ORDER ID


Recommended Posts

Hi All,

 

I currently have 2 stores, 1 is main domain www.mystore.com and the other is subdomain www.sub.mystore.com.

 

I use BarclayCard ePDQ for my card processing and I wish to use my ePDQ with both stores but they only allow 1 safe url for requests and responses. I have 2 separate urls posting requests and receiving responses.

 

www.mystore.com/epdq

and

www.sub.mystore.com/epdq

 

I can make a workaround by creating scripts to differentiate between to the 2 stores and then direct the calls to the relevant stores ePDQ module & Database.

 

For this I need to have a prefix on the order ids of both stores.

 

For example:

 

www.mystore.com order id 001,002,003... needs to change to S1-001,S2-002,S3-003...

 

and

 

www.sub.mystore.com order id 001,002,003... needs to change to S2-001,S3-002,S4-003...

 

Any help on this would be greatly appreciated!!

 

Thanks in advance.

Link to comment
Share on other sites

order id is the order identifier and governed by the $identifier attribute in Order class. It is also the primary key in orders table. There is a host of other code that assumes that this is an integer and does arithmetic with it and lots of classes/templates that use it too. So it is a major task trying to change it to anything else and might require touching dozens of classes and templates.

 

One thing you could do is prefix it for the return trip between the shop and the payment processor. So you would pick up the order submission just before it leaves your server, prefix it with the identifier and strip the prefix on return before handing over again to Prestashop.

 

I cannot see another easier way I am afraid, maybe someone with better knowledge of the codebase will chime in.

Link to comment
Share on other sites

Hi Tomerg3,

 

I am following this tutorial:

 

http://www.imranulhoque.com/payment-gateway/single-barclaycard-epdq-account-for-multiple-domains/

 

I am not expert coder, I know a few things but not enough.

 

How would I go about passing an identifier?

 

Regards

 

Why mess with the order ID?

 

You should be able to pass another indicator to determine where the order is coming from.

Link to comment
Share on other sites

That is one long tutorial, sorry but I really don't have time to read it.

 

My idea was to pass a variable to the payment gateway (many let you send in additional variables which will be passed back into your site), and then check to see what value you get back (send a different value from each store).

Link to comment
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
×
×
  • Create New...