Post by tonijulia » Thu Apr 02, 2020 9:10 am

I have a problem, guest users who place an order, after a few days when they make an order again, rewrite the first order, with the same order_id, but new products, with the problems that this entails.
Opencart version is v3.0.3.2 and Journal3.
Please I need help.

Newbie

Posts

Joined
Thu Apr 02, 2020 9:08 am

Post by paulfeakins » Thu Apr 02, 2020 7:02 pm

That doesn't sound like default behaviour, please provide a list of the extensions you have installed.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by tonijulia » Wed Apr 08, 2020 9:01 pm

paulfeakins wrote:
Thu Apr 02, 2020 7:02 pm
That doesn't sound like default behaviour, please provide a list of the extensions you have installed.
Hi paulfeakins
Thanks for your reply.

We have installed:
X-form
X-Shipping
X-Payment
ZhenIT Software for TPV
Complete SEO Package

And, like I said before, Journal 3 last version.

We have one or two of this cases every couple of days.

Sometimes it happens with TPV payment gateway but sometimes with Paypal.
We think that the customer, when comeback, and begin a new order, I don't know if is the cookie, get the last order_id (doesn't matter if this order is complete).
Now, the guest customers are not alowed, but we think when they come back get the order_id cookie of the last session.

¿can we delete or force to delete cookies (of the order_id) for 24 hours ago?

Thanks in advance!

PS: sorry for my english.

Newbie

Posts

Joined
Thu Apr 02, 2020 9:08 am

Post by tonijulia » Thu Apr 16, 2020 3:04 am

tonijulia wrote:
Wed Apr 08, 2020 9:01 pm
paulfeakins wrote:
Thu Apr 02, 2020 7:02 pm
That doesn't sound like default behaviour, please provide a list of the extensions you have installed.
Hi paulfeakins
Thanks for your reply.

We have installed:
X-form
X-Shipping
X-Payment
ZhenIT Software for TPV
Complete SEO Package

And, like I said before, Journal 3 last version.

We have one or two of this cases every couple of days.

Sometimes it happens with TPV payment gateway but sometimes with Paypal.
We think that the customer, when comeback, and begin a new order, I don't know if is the cookie, get the last order_id (doesn't matter if this order is complete).
Now, the guest customers are not alowed, but we think when they come back get the order_id cookie of the last session.

¿can we delete or force to delete cookies (of the order_id) for 24 hours ago?

Thanks in advance!

PS: sorry for my english.
Hi!
Do you know what is happening?
Or how we can solve it?

Please I need some help!

Newbie

Posts

Joined
Thu Apr 02, 2020 9:08 am

Post by JNeuhoff » Thu Apr 16, 2020 5:48 am

Try to narrow it down in a simple process of elimination, by disabling one extension at a time. You could also temporarily use the default web theme, or a standard-compliant web theme, to see whether it makes a difference.

Also check your Opencart error log.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by letxobnav » Thu Apr 16, 2020 9:44 am

1) there are no order ids in cookies
2) the order id is set (with status 0) in the session after order creation which is after payment method confirmation
3) that order id is removed, with everything else, upon order success
4) there is no possibility of duplicate order ids, that is a db constraint
5) an order changes status by payment methods but they cannot change the content

As long as the session id is set on the host and the client and the order id is set in the session, that is the active order for that user.
When the customer closes the browser, the session id is lost for that user and therefore the session data.
When the host removes the session (after inactivity), the session data is lost, not the session id (OC strangely does not check if the session id in the cookie is actually still present on the host so simply reuses the id if set in the cookie).

There are known issues with the host not removing inactive sessions when using the database (always use files) but that only means that a user can keep the session (including data) alive forever (regardless of activity) as long as his browser remains open because that keeps the session cookie alive and that will wake up that session.

So it is possible for a user to keep working with the same order id but only if he does not close his browser and he did not go thru checkout success as that means that the session remains the same and the order id remains in that session.

So check if all your checkout paths actually end up on checkout success.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by Calis1978 » Mon Apr 20, 2020 2:45 am

4) there is no possibility of duplicate order ids, that is a db constraint

That seems very reasonable, but I've also had one case where this happened. "In my case, it was 2 orders from the same customer about 4 months (and about a hundred orders) apart.

I also asked here and got no clear answer yet
viewtopic.php?f=202&t=216973&p=783227#p783227

New member

Posts

Joined
Tue Jul 30, 2013 8:35 pm

Post by ADD Creative » Mon Apr 20, 2020 3:19 am

I see that you both use the Journal 3 theme. Does this make any modifications to the checkout pages, such as one page checkout? If so check your modification cache (storage/modification/catalog/model/checkout/order.php) to see if this line is modified. https://github.com/opencart/opencart/bl ... der.php#L4

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by letxobnav » Mon Apr 20, 2020 7:13 am

I also asked here and got no clear answer yet
viewtopic.php?f=202&t=216973&p=783227#p783227
Default, a new order is only created (with status 0, i.e."not finalized", wrongly named "missing") when a user selects&saves the payment method on checkout (just before you are shown the "confirm order" tab), not when a product is added to the cart.
It is created at that time because the payment gateways need an order id for callbacks.
Upon confirmation, the payment method adjusts the status 0 to whatever you have set for that payment method, either directly via their confirm() function or via callback.

But, as stated, this:

Code: Select all

$this->session->data['order_id'] = $this->model_checkout_order->addOrder($order_data);
is only called after:

Code: Select all

Validation if shipping address has been set for products with shipping
Validation if shipping method has been set for products with shipping
Validation if payment address has been set.
Validation if payment method has been set.
Validation if cart has products and has stock.
Validation of minimum quantity requirements.
not after adding products to the cart
and that always results in a new unique order_id.

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by john121park121 » Thu Oct 01, 2020 9:42 pm

Hi there,

I just had the same issue yesterday but only just found out about it after the customer called. I too am using Jorunal 3, on OC version 3.0.3.2

Order came through on email yesterday, 2 items, total just over £20. This was shipped, money in PayPal account.

Today the customer got in touch asking if the 'other order' was successful becasue they had no confirmation email.

I log into the admin, click on the order number #4900 and the order is from the customer, but for £134.29. This order had 6 items, non of which were the on the previous order, which, on email, was also #4900.

They logged into their account this morning 'the website showed both orders had the same invoice/order number, but my basket was still showing I had to check out'.

The payment was not in the paypal account so they tried to pay for their basket again, but the site said 'This invoice has already been paid. For more information, please contact the merchant.', which she did.

I have no idea whats happened. The email which admin recived yesterday had order #4900 with 2 items. On the admin site, order #4900 shows the £134, there is no reference to the £20 order which paypal processes?

Any ideas?


Posts

Joined
Tue Aug 30, 2011 11:24 pm

Post by JNeuhoff » Thu Oct 01, 2020 10:27 pm

Any ideas?
Yes, don't use Journal3. The latter is not compliant with OpenCart standards and uses it's own one-page checkout, so for this you'd have to get in touch with the Journal support.

You can also check your database, via e.g. PHPMyAdmin, to see what's in the 'oc_order' and 'oc_order_history' tables, to get a clearer idea of what actually happened.

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by letxobnav » Fri Oct 02, 2020 1:09 am

I always log any post done during the checkout process so I can always trace what has happend when something odd has happend and it only happens sometimes.
It will not tell you everything that is done during checkout but at least you can see what the user has done so you might be able to replicate the scenario.
Certainly with one-page-checkout constructs where it is very hard to figure out what the scenario could possibly have been.

I simply add a specific log for that (in startup.php controller):

Code: Select all

$this->registry->set('checkoutlog', new Log('checkoutlog.log'));
and log any post done during checkout in there:

Code: Select all

if ($_SERVER['REQUEST_METHOD'] == 'POST') 
	if (!empty($this->request->post)) 
		if (strstr($_SERVER['REQUEST_URI'],'checkout/')) $this->checkoutlog->write($_SERVER['REMOTE_ADDR'].' '.$_SERVER['REQUEST_URI'].' '.print_r($this->request->post,true));

Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces

“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.


User avatar
Expert Member

Posts

Joined
Fri Aug 18, 2017 4:35 pm
Location - Taiwan

Post by gjmotorsports » Wed Jun 02, 2021 11:28 pm

Did anyone find a solution to this, we are experiencing this with OC 3.0.2.0 and Journal 3.1.8.

Newbie

Posts

Joined
Wed Jul 19, 2017 3:23 am

Post by ADD Creative » Thu Jun 03, 2021 12:17 am

You will need to contact Journal support about this issue.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by FallingUp » Wed Jul 28, 2021 3:43 pm

gjmotorsports wrote:
Wed Jun 02, 2021 11:28 pm
Did anyone find a solution to this, we are experiencing this with OC 3.0.2.0 and Journal 3.1.8.
Same problem here. It should not be a Journal problem (I'm using a different checkout module)

Newbie

Posts

Joined
Mon Jan 01, 2018 5:12 am

Post by ADD Creative » Wed Jul 28, 2021 5:41 pm

Could be an issue with your checkout extension. It could also be an issue with you payment module, but less likely.

The way OpenCart adds orders relies on the database to allocate the order numbers. The only way it can reuse an order ID is if the code has been modified by an extension or there is a problem with your database.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by straightlight » Wed Jul 28, 2021 8:08 pm

FallingUp wrote:
Wed Jul 28, 2021 3:43 pm
gjmotorsports wrote:
Wed Jun 02, 2021 11:28 pm
Did anyone find a solution to this, we are experiencing this with OC 3.0.2.0 and Journal 3.1.8.
Same problem here. It should not be a Journal problem (I'm using a different checkout module)
Which checkout module?

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by FallingUp » Thu Jul 29, 2021 3:00 am

straightlight wrote:
Wed Jul 28, 2021 8:08 pm
FallingUp wrote:
Wed Jul 28, 2021 3:43 pm
gjmotorsports wrote:
Wed Jun 02, 2021 11:28 pm
Did anyone find a solution to this, we are experiencing this with OC 3.0.2.0 and Journal 3.1.8.
Same problem here. It should not be a Journal problem (I'm using a different checkout module)
Which checkout module?
Ajax Best Checkout - Easy Quick n Boosted on opencart
https://www.opencart.com/index.php?rout ... n_id=20736

It's possbile that this annoying bug can be a problem of Opencart 3.0.2.0 itself or the checkout module.

Newbie

Posts

Joined
Mon Jan 01, 2018 5:12 am

Post by straightlight » Thu Jul 29, 2021 4:11 am

FallingUp wrote:
Thu Jul 29, 2021 3:00 am
straightlight wrote:
Wed Jul 28, 2021 8:08 pm
FallingUp wrote:
Wed Jul 28, 2021 3:43 pm


Same problem here. It should not be a Journal problem (I'm using a different checkout module)
Which checkout module?
Ajax Best Checkout - Easy Quick n Boosted on opencart
https://www.opencart.com/index.php?rout ... n_id=20736

It's possbile that this annoying bug can be a problem of Opencart 3.0.2.0 itself or the checkout module.
Either:

- Contact the extension developer to resolve this issue
- Install a fresh Opencart store on a test server, not sub-domain, with the checkout module you are using
- Uninstall the checkout module and see if the problem you describe persists
- Create a new service request in the Commercial Support section of the forum to have this issue investigated as a custom job

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by FallingUp » Thu Jul 29, 2021 4:15 am

ADD Creative wrote:
Wed Jul 28, 2021 5:41 pm
Could be an issue with your checkout extension. It could also be an issue with you payment module, but less likely.

The way OpenCart adds orders relies on the database to allocate the order numbers. The only way it can reuse an order ID is if the code has been modified by an extension or there is a problem with your database.
Many have seen this problem and they use Journal. It seems the latest Journal has not fixed it, and I guess it would be a long shot for all 3rd party checkout extension developers to look into this. Not sure if there could be a simpler fix that we can use on modifying Opencart core files?

An alipay payment extension developer made some changes on the controller file and the issue went away. (Haven't seen it since)

I used 'compare' on Notepad ++ and it showed he added codes like these

$db = DB_PREFIX;
$_result =$this->db->query(
"select *
from `{$db}order`
where order_id = '{$order_id}'
and order_status_id='{$success_status}'
limit 1;");

if($_result->num_rows){
$this->cart->clear();
unset($this->session->data['order_id']);
$this->session->data['cart']=array();
$this->_redirect($this->url->link('checkout/success', '', 'SSL'));
return;
}

####and down below these:

unset($this->session->data['order_id']);
$this->session->data['cart']=array();

I've attached both the older file (A) and fixed file (B) of his alipay extension.

That means it can be fixed if certain codes are added to a specific payment method, right?

Newbie

Posts

Joined
Mon Jan 01, 2018 5:12 am
Who is online

Users browsing this forum: No registered users and 16 guests