Re: Re: Inventory API not decreasing uc_stocklevels

Posts: 7
Joined: 05/10/2008

Yeah...it's really irritating, especially to a new user of Ubercart. In this thread I see a lot of hand-waving and lofty ideas about what could be done in some imaginary dreamland, instead of actual action to fix something technically minor that everyone NEEDS to work. uc_stock doesn't prevent users from ordering more than the inventory holds, making it USELESS. uc_inventory_api and Simple Stock doesn't decrement stock via PayPal IPN like uc_stock does. You can't use both, you can't use either...how is anyone without PHP knowledge ever going to use Ubercart?

My point is that yes, there IS a quick hack to make this work, and I'm stunned that none of these intellectuals in this thread have pointed it out yet.

Simple. You want to add an action to your Workflow-ng "Update order status on full payment" configuration, which is executed when PayPal IPN reports success. Add an action, choose "Execute custom PHP code", and insert (in plaintext or source mode, beware TinyMCE users):

foreach($order->products as $product)
_uc_inventory_api_purchace_confirmed($product->model, $product->qty);

No, "purchace" is the right function to use, that's not my spelling error.

I could have overlooked some huge negative effect caused by this hack, please jump on it, I'm by no means an expert in Ubercart or PHP.

Forgive my crankiness but I just see huge glaring holes in this whole setup. Just be glad I'm sticking around to use Ubercart and contribute to the community, instead of jump ship to another commerce solution.

Inventory API not decreasing uc_stocklevels By: lafflam@drupal.org (56 replies) Wed, 08/22/2007 - 21:46