Post by jonagoldapple » Thu Mar 05, 2020 11:00 pm

I just figured out that stocks do not subtract after an order has been placed. Already checked the system settings and made sure "order status" and "processing order status" match as suggested by other topics on the forum. Each products "subtract stock" option is set to yes.

Any suggestions on how to subtract stock when a customer confirms an order, so right before going to payment?

OC 3.0.3.2
PHP 7.2.10
Default theme
Last edited by jonagoldapple on Sat Mar 07, 2020 7:10 pm, edited 3 times in total.

Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm

Post by thekrotek » Thu Mar 05, 2020 11:28 pm

Stock is subtracted, when order is processing or completed. If you did everything right, it should work, and if it doesn't, then you did something wrong.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member
Online

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by jonagoldapple » Fri Mar 06, 2020 5:31 am

I only changed the stock statusses in the stock status menu (admin panel). No code has been changed, at least not manually. What did I do wrong?

Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm

Post by sw!tch » Fri Mar 06, 2020 5:38 am

What payment gateway are you using?

To clarify - You are wanting to subtract stock before payment is confirmed?

Backup and [ learn how to recover ] before you make any changes.


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by straightlight » Fri Mar 06, 2020 8:48 am

jonagoldapple wrote:
Fri Mar 06, 2020 5:31 am
I only changed the stock statusses in the stock status menu (admin panel). No code has been changed, at least not manually. What did I do wrong?
I have just updated the FAQ for these issues. The following was tested during a custom job with a client: viewtopic.php?f=134&t=215776&p=775757#p775757 . See if that solution rectifies the issue.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer / Opencart Tester


Legendary Member

Posts

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

Post by Quino » Fri Mar 06, 2020 2:41 pm

the code is pretty straighforward:
when adding order history either automatic or manual

1) If the CURRENT ORDER STATUS IS NOT IN the "processing" stati AND NOT IN the "complete" stati (as set in admin) but the NEW ORDER STATUS IS IN EITHER then do the stock subtraction

2) If the CURRENT ORDER STATUS IS IN the "processing" stati OR IN the "complete" stati (as set in admin) but the NEW ORDER STATUS IS IN NEITHER then do the re-stocking

New member

Posts

Joined
Fri Feb 28, 2020 1:19 am

Post by paulfeakins » Fri Mar 06, 2020 6:36 pm

jonagoldapple wrote:
Thu Mar 05, 2020 11:00 pm
Any suggestions on how to subtract stock when a customer confirms an order, so right before going to payment?
But a malicious competitor could reduce all your stock levels to zero without paying for anything?

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by Quino » Fri Mar 06, 2020 6:50 pm

Does not have to be a competitor nor malicious, any time a customer confirms a payment method but does not checkout, your stock will be gone in no time.
All your "missing orders" will reduce stock.

Good if you are on commission for stock-turnover.

New member

Posts

Joined
Fri Feb 28, 2020 1:19 am

Post by paulfeakins » Fri Mar 06, 2020 6:52 pm

Quino wrote:
Fri Mar 06, 2020 6:50 pm
Does not have to be a competitor nor malicious, any time a customer confirms a payment method but does not checkout, your stock will be gone in no time.
All your "missing orders" will reduce stock.

Good if you are on commission for stock-turnover.
Good point!

For quick, professional OpenCart support please email info@antropy.co.uk


User avatar
Guru Member

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - Reigate, Surrey, United Kingdom

Post by jonagoldapple » Sat Mar 07, 2020 4:06 pm

Good point about subtracting stock before payment. I do not want to subtract before the payment has been completed. What I really need is when an order has been paid succesfully, it subtracts stock.

In my payment module settings under Admin > Extensions > Extensions > Payments > Mollie I can choose those status options:
- Processing payment
- Payment created
- Payment failed
- Payment cancelled
- Payment expired
- Payment received
- Order shipped

If I understand correctly I have to match the above Payment received status with the System > Settings > Edit store > Order status setting, and if I do this stock will subtract when the payment has been received?

Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm

Post by sw!tch » Sat Mar 07, 2020 5:23 pm

System -> Settings -> Store -> Option -> Processing Order Status & Complete Order Status

So if your gateway returns Payment received and you want that status to subtract stock, then check that order status under the appropriate section as @Quino explained.

Does your Payment gateway have a test mode? Just run a test you can see how it works.

Backup and [ learn how to recover ] before you make any changes.


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by jonagoldapple » Sat Mar 07, 2020 6:59 pm

Thanks a lot everybody, problem solved! ;D

Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm

Post by straightlight » Sat Mar 07, 2020 7:13 pm

jonagoldapple wrote:
Sat Mar 07, 2020 6:59 pm
Thanks a lot everybody, problem solved! ;D
What was the resolution?

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer / Opencart Tester


Legendary Member

Posts

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

Post by jonagoldapple » Sat Mar 07, 2020 9:02 pm

Under Admin > System > Settings > [edit-store] > Options > Processing order status I had checked the wrong status checkboxes. I had to check the "payment received" status and it has to match the received status selected in Mollie Payments. Ran a few payment tests and now it is working!
Last edited by jonagoldapple on Sat Mar 07, 2020 9:04 pm, edited 1 time in total.

Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm

Post by straightlight » Sat Mar 07, 2020 9:03 pm

jonagoldapple wrote:
Sat Mar 07, 2020 9:02 pm
Under Admin > System > Settings > [edit-store] > Options > Processing order status I had checked the wrong status checkboxes. I had to check the "payment received" status and it has to match the received status selected in Mollie Payments. Ran a few payment tests and now it is working!
Thanks for letting us know. I will add this one to the FAQ. :)

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Opencart.com Administrator / Quality Assurance Analyst / Programmer / Opencart Tester


Legendary Member

Posts

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

Post by jonagoldapple » Sat Mar 07, 2020 9:04 pm

Edited my post for more accurate information ;)

Also make sure there are no statuses selected that come BEFORE the "payment received".
For example, checking the "payment failed" status checkbox will subtract stock even when because payment fails.
The same for "processing" statuses.
Last edited by jonagoldapple on Sun Mar 08, 2020 8:57 pm, edited 1 time in total.

Active Member

Posts

Joined
Sun Jan 26, 2020 9:46 pm

Post by Quino » Sat Mar 07, 2020 11:19 pm

checking the "payment failed" status checkbox will subtract stock even when payment fails
not "even when" but "because".

New member

Posts

Joined
Fri Feb 28, 2020 1:19 am
Who is online

Users browsing this forum: No registered users and 18 guests