17 replies [Last post]
mykz-'s picture
Offline
Joined: 02/13/2008
Juice: 165

Hey All

I'm having some trouble my clients asked me to change the stock level of an item when an order goes into pending status and not complete what code and file do I need to edit to make this possible I’ve scan through the whole inventory and stock contrib files but can't find where it changes the stock levels when the item status changes to complete status.

thanks inadvance to anyone that can help.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Inventory API & Simple Stock Levels (Help Needed)

I believe this is actually being done through a workflow configuration. You should be able to change it there in a few seconds and be done with it. Smiling

mykz-'s picture
Offline
Joined: 02/13/2008
Juice: 165
Re: Re: Inventory API & Simple Stock Levels (Help Needed)

Ryan what would i need to edit i haven't added anything to workflow-g also if i could add a condition to workflow to get it to knock stock off when checkout is completed or even edit the ubercart function on order to grab the sku and then kcnock the stock off.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: Inventory API & Simple Stock Levels (Help Needed)

Maybe you're on an older version, but there's a configuration simply labeled "Decrement stock upon order submission" that you can edit or disable (for replacement) to your heart's content.

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3369
Re: Re: Re: Re: Inventory API & Simple Stock Levels (Help Needed

Inventory API and Simple Stock Levels doesn't use Workflow configurations for changing stock levels, so I think you must be using the core uc_stock module instead. With the Inventory API, stock levels are adjusted at order submission, not at order status change.

Check admin/build/modules and make sure you only have the core uc_stock enabled. Then you can use the uc_stock Workflow condition like Ryan said to specify when the stock gets decremented.

<tr>.
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Re: Re: Re: Re: Inventory API & Simple Stock Levels (Help Ne

Thanks for the save, TR. From the thread body, I just assumed it was the core stock module... reviewing the title before answering could've saved us some time. Sticking out tongue

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1433
Inventory

And as nice to know, just added 'Inventory and Simple Stock Levels' (Drupal 5.7 and Uber 1022 RC2 +) to a live site and it works fine. The site does not have any attributes so it works well.

TR indicted that Simple Stock will break if attributes are on a site. Yes, that I can confirm on a localhost test site.

Jim

mykz-'s picture
Offline
Joined: 02/13/2008
Juice: 165
Hey all Alaska is there no

Hey all

Alaska is there no fix for uc_stock with attributes as I really need the stock control to work with attributes Sad

I get this problem when trying to use the workflow-ng rule for stock

http://www.ubercart.org/forum/support/4259/workflow_missing_actions

Could this be because I have attributes turned on?

Thanks for any help.

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1433
TR Quote

Here is what TR has to say:

"Yes, Inventory & Simple Stock Levels DOES work with RC1 (I've tested it), with the known bug that products with text attributes break the code that prevents ordering more than you have in stock. (Text attributes were a feature added to Ubercart after the Inventory module was written, and Inventory has not been revised to take account of them.)

I do plan to release a replacement, but frankly the appearance of uc_stock cut the legs out from under the whole project. It's now going to be much harder to rework the Inventory API because uc_stock destroyed the whole architecture of API. Properly implementing an inventory solution will require uc_stock to be pulled apart, and will require the new uc_inventory to be in core along with uc_stock. Since I don't have permissions to mess with core, and I'm not party to the discussions as to what goes into core and what doesn't, I fear this is going to be a long and tedious process. Certainly it's not something that can happen before 1.0 is released.

I have mostly finished writing up a detailed plan for what I want to do. When I'm done writing I'll post it here in the forums to get feedback. If I get buy-in from the community I'll go ahead and implement it. If not, the current Inventory API works for my needs so I will stick to making some small bug fixes."

Jim

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3369
Alaska wrote:Here is what TR
Alaska wrote:

Here is what TR has to say:
"Yes, Inventory & Simple Stock Levels DOES work with RC1 (I've tested it), with the known bug that products with text attributes break the code that prevents ordering more than you have in stock. (Text attributes were a feature added to Ubercart after the Inventory module was written, and Inventory has not been revised to take account of them.)"

Note the key point: only text attributes are a problem. If you have attributes with options, they should work just fine. It's only attributes without options where the user has to enter custom text that cause a problem.

<tr>.
toonny's picture
Offline
Joined: 03/25/2008
Juice: 9
manage stock

i'm a beginner on drupal and try this module. it solve part of my problem with success (block add to cart if there are not enough stuff) but create me a new one : i can t manage the stock anymore with the core value but with a new value hard to manage (can t use stock report anymore) and can t use anymore threshold system.

did i do a wrong install or did i miss something ?

thank you

TR
TR's picture
Offline
Bug FinderFAQ ModeratorGetting busy with the Ubercode.
Joined: 11/05/2007
Juice: 3369
Re: manage stock

You're correct. I'm going to rewrite inventory to fix all these issues, but that won't happen right away.

<tr>.
mykz-'s picture
Offline
Joined: 02/13/2008
Juice: 165
Sounds good TR Inventory is

Sounds good TR

Inventory is such a good module shame it doesn’t work completely i’ve manage to write some custom code in workflow so now when a customer orders a product the stock get’s knocked off if anyone wants a copy of the code i’ll be happy to post it up.

montana's picture
Offline
Joined: 03/27/2008
Juice: 47
Re: Sounds good TR Inventory is

hi mykz- i would love to get my hands on that code Laughing out loud

mykz-'s picture
Offline
Joined: 02/13/2008
Juice: 165
Hey montanna I’ll post the

Hey montanna

I’ll post the code snippet latter as I’m currently at work.

The code isn't too great so you might want to mess with it a little more to get it to fit your needs.

montana's picture
Offline
Joined: 03/27/2008
Juice: 47
Re: Hey montanna I’ll post the

cool. ill be on irc later

Jmmb's picture
Offline
Joined: 08/23/2007
Juice: 296
Code?

Hi Mykz,

We would be interested in seeing your code too. Can you post it somewhere publicly?

Thanks,

Jim

(Drupal^Ubercart) * (Design^Development^Hosting) = Sundays Energy

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1433
Module

TR:

That is good news. Will look forward to the rewrite in a few months or so.

Jim