Strategy for product inventories?

Author Message

Harry Fuecks

Sunday 27 April 2003 11:51:05 am

Wondering what the best / intended approach would be for handling a product inventory with content classes?

The choice seems to be either;

- create a Product class then publish multiple objects from that class

- create an integer "Quantity" field in the Product class then use it to keep track of the current inventory of any given Product object

The inventory needs to be manageable in that you can get a summary of how many of each product is available at any given time which would seem to suggest the later choice. If so, am I correct in thinking this would be a place to apply a trigger, so that on purchase the trigger checks / updates the current inventory?

Gabriel Ambuehl

Sunday 27 April 2003 12:38:22 pm

I suppose you could change one of the shop pages to decrement the item count for you. kernel/shop/orderview.php would probably be the correct place to do this as at the point it gets invoked, the order will be done.

I'm not sure about using triggers. I've had my share trouble with them, so personally, I don't really like them too much.

Visit http://triligon.org

Scot Wilcoxon

Sunday 27 April 2003 9:45:16 pm

Define "content classes" so we know what you're trying to define for your inventory. Is it like "Cups", with many products which are different types of cups? Or "Hello Kitty Cups" and a few variations of the same cup (colors)? Or "Dixie Chicks Cup", with a single style and one "object" for each single cup in inventory? Or "DVD" and "VHS" classes, with product "Star Wars" having different quantities in both classes?

You'll have to clarify why "The choice seems to be either", and why your problem does not allow every Product to have a Quantity, and why you might have any products which are not in a single Product class.

(That's odd -- the New Reply button emits an invalid URL)

I see your replies -- a Pet Store could use either Cats/Siamese/Quantity (or Insects/Mealworms/Pounds) or Cats/Siamese/Number18. A supplier who merely has to send six cats of a type to a pet store could use just a Quantity. A pet store might get better results by showing information about each individual cat, such as pictures and descriptions. Whether to call a cat "Number18" or "Mittens" depends on the pet store's policies...and whether there is a registered pedigree with a name involved.

(As for shipping: You shop based on your criteria, other people have other situations. Maybe the pet store doesn't ship but people can see what is available and come to the store to check the emotional appeal. The emotions which our mammalian brains share are an important part of the relationship with pet mammals. Or maybe a customer can't find a hairless Manx nearby and must get one from a distant source. Good thing somebody shipped horses, cows, and corn between continents sometime so they are available. Shall we discuss whether cows rule the world and have trained us well to take care of them and increase their numbers?)

Harry Fuecks

Monday 28 April 2003 2:00:31 am

To be completely exact, what I'm attempting is an eZ publish Petstore that has the functionality of the J2EE / .NET petstores: http://www.theserverside.com/resources/article.jsp?l=PetStore.

They've defined pet categories (fish, dogs, cats etc.) and products (pets) which belong to each category. Each product (seems) to have a one to one relationship with a table inventory, where the quantity of that product is defined - that suggests to me under the "Cats" category there might be a "Siamese Cat" for which the inventory table keeps track of the number of Siamese cats in the store at a given time. The inventory becomes important when dealing with the Petstores suppliers.

So what I'm wondering if it's better to publish multiple Siamese Cat objects for each Siamese Cat currently available or use a single object which has a "Quantity" property.

Anyway - makes an interesting learning experience with eZ publish 3 - if I get anywhere will post the code/data.

Gabriel Ambuehl

Monday 28 April 2003 2:37:33 am

I suppose in your very case, it would be better to have an object for each pet cause they aren't like commodity items ; they all look different, so you can actually have customers looking at the pictures of an individual pet...

Visit http://triligon.org

Harry Fuecks

Monday 28 April 2003 3:03:17 am

Very true. It's one of the wierder things about the Petstore design that doesn't quite make sense to me - each animal is unique. Except Dolly the Sheep...

Gabriel Ambuehl

Monday 28 April 2003 8:16:30 am

I know this is off topic, but personally, I have my problems about selling pets over the net anyway. I mean I can understand pet supplies, but life animals I don't think should be sold over the net. Or shipped at all, for that matter.

Visit http://triligon.org

Harry Fuecks

Monday 28 April 2003 6:15:16 pm

Going further off topic, I completely agree. There's a whole surreal element to the .NET / J2EE Petstore "war" which borders on ridiculous. It's when they integrate the Petstore with EBay that it's got to stop.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 05:02:22
Script start
Timing: Jan 18 2025 05:02:22
Module start 'layout'
Timing: Jan 18 2025 05:02:22
Module start 'content'
Timing: Jan 18 2025 05:02:23
Module end 'content'
Timing: Jan 18 2025 05:02:23
Script end

Main resources:

Total runtime1.0648 sec
Peak memory usage4,096.0000 KB
Database Queries74

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 587.9375152.6250
Module start 'layout' 0.00680.0038 740.562539.4453
Module start 'content' 0.01071.0529 780.0078588.1875
Module end 'content' 1.06360.0012 1,368.195316.1563
Script end 1.0648  1,384.3516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3245160.0002
Check MTime0.00150.1388160.0001
Mysql Total
Database connection0.00090.085810.0009
Mysqli_queries1.001194.0143740.0135
Looping result0.00070.0680720.0000
Template Total1.025396.320.5126
Template load0.00230.220420.0012
Template processing1.022996.066020.5115
Template load and register function0.00010.014110.0001
states
state_id_array0.00130.124110.0013
state_identifier_array0.00250.231920.0012
Override
Cache load0.00180.1731300.0001
Sytem overhead
Fetch class attribute can translate value0.00080.078530.0003
Fetch class attribute name0.00160.150080.0002
XML
Image XML parsing0.00030.032830.0001
class_abstraction
Instantiating content class attribute0.00000.002480.0000
General
dbfile0.00070.0683100.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 18
 Number of unique templates used: 4

Time used to render debug report: 0.0001 secs