Post by gortega » Sat Nov 04, 2017 5:25 am

Hi,
I'm sorry if this question is weird, but I want to add to the stock the order quantity instead of subtracting it when order is complete.

Please don't trolling (I get angry easily) and read the following context for my question:
  • First of all, I'm an environmental science professional curious about open source software and its potential to tackle environmental problems.
  • I understand that Opencart is an online store management system, so logically the users need the products purchased by their customers to be subtracted from their stock. However, Opencart is also very rich in their interaction with "customers" and can offer a lot of information (education) about each product in stock, thus I decided to experiment with the possibility to use Opencart as a management system for tickets to collect hazardous materials within dependencies of my institution. This is a demo site: http://dservicios.uach.cl/uga/.
  • I do not know any service ticket software that offers a rich experience in information for the client comparable to Opencart, so they are not useful to educate him about the environmental problems related to his activities and toxic waste.
  • Most of the modifications required were easy to reach with VQMod modules and little tweaks of the code or the language files, but considering that I want the hazardous materials of the university to be collected, I need the items "purchased" to be added to the stock instead of subtracted. And I'm completely lost looking how to modify the process (and I feel very stupid right now).
  • Unfortunately I cannot ask for help in the IT department because all the OPEN SOURCE software and online platforms are rejected without evaluation.

Looking for suggestions.
Have a nice day
Last edited by gortega on Fri Nov 10, 2017 10:18 pm, edited 1 time in total.

Newbie

Posts

Joined
Sat May 27, 2017 12:07 am

Post by yodapt » Sat Nov 04, 2017 6:39 am

catalog/model/checkout/order.php, line 204

Code: Select all

$this->db->query("UPDATE " . DB_PREFIX . "product SET quantity = (quantity + " . (int)$order_product['quantity'] . ") WHERE product_id = '" . (int)$order_product['product_id'] . "' AND subtract = '1'");

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member
Online

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by gortega » Fri Nov 10, 2017 10:17 pm

Thank you for your support Yodapt!!

For those who could read this or have a related problem, the solution provided by Yodapt worked very well for my site.

Best regards!

Newbie

Posts

Joined
Sat May 27, 2017 12:07 am
Who is online

Users browsing this forum: No registered users and 51 guests