12 replies [Last post]
Lorin's picture
Offline
Joined: 07/15/2008
Juice: 21

Not the end of the world if you know your way around the DB and can delete them manually, but this could become a pain in the ass for others.

- Create a new product
- Give it a stock of above 0, save.
- Delete new product
- Look at stock report

Congratulations, you've created your first zombie SKU. Clicking on the edit button for a zombie SKU results in an error. Attempting to create a new product with the same SKU works, but when you go into the reporting section it is still orphaned. This is also a nightmare if you have multiple SKUs for a product with attributes/adjustments. Only way around this is modifying/deleting the offending rows/stock counts directly from the DB.

The mass stock editor module that doesn't come with Ubercart by default works great though.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Re: Zombie stock SKUs

Hmm... yeah, I'm not entirely sure how this should be resolved. It would be simple to delete a row from the stock table when the product gets deleted, but the stock table is bound to a SKU instead of a node ID, and more than one node ID could refer to the same SKU. It seems like there needs to be a limitation somewhere... maybe it should be on the stock report itself. Puzzled

Thoughts?

Lorin's picture
Offline
Joined: 07/15/2008
Juice: 21
Re: Re: Zombie stock SKUs

Actually the uc_product_stock table does use the node ID...
One solution would be to add a check if the SKU is orphaned (no associated node ID) when a new product is added, then to simply replace the empty value with the right one. This is a short term solution though... I'm not really happy with the way inventory is controlled (one to one instead of many to many).

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Lorin wrote:I'm not really
Lorin wrote:

I'm not really happy with the way inventory is controlled (one to one instead of many to many).

Could I get you to elaborate on this a little bit? I sense deficiencies in the way it's handled right now, too, and have a little difficulty w/ the API.

Lorin's picture
Offline
Joined: 07/15/2008
Juice: 21
Re: Lorin wrote:I'm not really

Well, if you really want my rant from a business perspective...

I deal with bulk products where they come from barrels and spindles (chemicals and textiles).
Internal Product: Spindle of Textile, contains 5000 units (which could be pounds, kilos, ml, etc)

Then I want to create a few products which utilize the same SKU, but different units in size.

Products: 5 units of Textile, 15 units of Textile, 30 units of Textile, 5 Unit Storage Box, etc...
Product Kit: 5 Units of Textile + 5 unit storage box.

The problem is when you create a product kit, it can only affect the inventory of a SINGLE SKU. I'd love it if a single product could affect the inventory of multiple SKUs for specific unit sizes.

The second problem isn't even with tracking, but creating more product kits becomes a hassle. Eg. I'd use the same storage boxes for a variety of different textiles. This is off topic though. Mass editing would be cool Smiling

Lorin's picture
Offline
Joined: 07/15/2008
Juice: 21
Re: Re: Lorin wrote:I'm not really

Oh also, forgot to mention having something like this would be a HUGE boon to the Ubercart project, none of the other OS projects (or relatively free) projects I've seen have this kind of control system. Not Magento or Shopify.

Al
Al's picture
Offline
Bug FinderGetting busy with the Ubercode.Internationalizationizer
Joined: 02/14/2008
Juice: 249
Re: Re: Lorin wrote:I'm not really

@Lorin: Nice to hear that you like my mass stock editor Smiling

Quote:

One solution would be to add a check if the SKU is orphaned (no associated node ID) when a new product is added,...

Please correct me if I miss something, but IMO the only place where orphaned SKUs harm is stock report, so I would see the place for such a sanitize function in stock report before calling the data to display.
Additional it could go to the Status messages at /admin/store

Quote:

Then I want to create a few products which utilize the same SKU, but different units in size.

I don't like the idea of messing around multiple times with the same sku, as i18n sites will break on connecting skus with nids (or you need a Workflow_ng workaround) and also both stock trackers are dependent on unique skus (which I like b/c of the first reason)... Do you use Attributes for these different sizes?

I'd like to mention that mass editing is much easier to achieve than I thought before I started, I can tell you from my dev box that a lot of things are possible to make bulk editable including published, sticky, all prices, created (e.g. set 'created' to time() to make it "new" again) and IMO also product kits should be at least partly possible. The mass stock editor was just the test run for me and I hope to get some feedback where to go with it. So if you want more of it, talk with me Eye-wink

Lorin's picture
Offline
Joined: 07/15/2008
Juice: 21
Al wrote:I don't like the
Al wrote:

I don't like the idea of messing around multiple times with the same sku, as i18n sites will break on connecting skus with nids

It seems like were on the right track with differing solutions, cool. I don't know much about the internal interactions for UC because I'm not much of a coder (though I could probably understand the gist of things if I looked at the source) ...

Another possible solution would be to add the ability to change the quantity ordered via Attribute adjustments, in addition to allowing product kits to be linked to more than one SKU...

Lorin's picture
Offline
Joined: 07/15/2008
Juice: 21
Re: Zombie stock SKUs

Found a few more unrelated bugs, I don't really want to make a new thread for each

  • Product editor: The "Default quantity to add to cart" variable does NOTHING if the Quantity field is disabled. Eg. In the Product settings area, "Display an optional quantity field in the Add to Cart form" is unchecked.
  • ORDERS + Payment Method Pack: "Receive Check" option in view tab shows up even if balance is paid in full via payments tab. If you use the "receive check" option and then delete the associated payment from the Payments area, the check clearing date is still shown. Also why is the "receive check" option even accessible from the view page? Shouldn't it be integrated into the Payments tab? Same with the credit card "Process" option
  • TAXES: "Workflow-ng configurations" link is a 404, currently (trimmed) /admin/build/workflow-ng, should be /admin/workflow-ng
  • INVOICE: Has dark gray lettering on dark blue background for headers, in printable version it's black on dark blue. Should be #fff for fonts. That whole section could be optimized, I could help.
  • CART: Unpublished items (that are part of a Product Kit for example) shouldn't be linked unless logged in as someone with rights to edit that node. Why unpublished? There are a few products that I want to add to kits but customers shouldn't be able to add separately, if you know a better way please tell me Sticking out tongue
Lyle's picture
Offline
AdministratoreLiTe!
Joined: 08/07/2007
Juice: 6841
Re: Re: Zombie stock SKUs

Workflow-ng changed the path to its admin page between versions 1 and 2, and I haven't put in an update yet.

Since the product price display isn't affected by the default quantity, I think it's misleading at best to make the default quantity something other than 1 when the customer can't change it.

Good catch about the links to unpublished products from product kits, though.

Lorin's picture
Offline
Joined: 07/15/2008
Juice: 21
Re: Re: Re: Zombie stock SKUs

So, what's the verdict on allowing product kits and attribute adjustments to be linked to multiple SKUs? Would be killer Smiling

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15422
Lorin wrote: TAXES:
Lorin wrote:
  • TAXES: "Workflow-ng configurations" link is a 404, currently (trimmed) /admin/build/workflow-ng, should be /admin/workflow-ng
  • CART: Unpublished items (that are part of a Product Kit for example) shouldn't be linked unless logged in as someone with rights to edit that node. Why unpublished? There are a few products that I want to add to kits but customers shouldn't be able to add separately, if you know a better way please tell me Sticking out tongue

Hey Lorin, just a quick post to say that the above issues have been taken care of. I'm also updating the stock report so that it bypasses stock levels that reference a non-existent nid. The change should be reflected in the 1.4 release. I realize this is a small patch and not a complete solution... the whole way it works should be revised, but that will have to wait for D6 development. Sad

(At first I was just marking those rows as N/A for the product and removing the edit link, but I realized there's no good reason to display it if they can't be edited or deleted.)

There was some other funkiness going on w/ the check payment method I need to take care of. Also, if you have any time to lend toward designing a cleaner default invoice template I'd love it! Eye-wink

royerd's picture
Offline
Joined: 01/22/2008
Juice: 293
Re: Lorin wrote: TAXES:

Old thread but . . .

Actually one only needs to change the stock number of an existing item in order to create the zombie stock item. If you change the stock number, it does not delete the table entry for the old stock item. Of course deleting the table item in uc_product_stock fixes the problem. Delete all table items and and you would have to go back in and reset all your stock counts and thresholds.

It's not a big problem, but it could confuse people to see extra items showing up in the stock report view.

Dan