Difference between revisions of "VbzCart/pieces/catalog/building"

from HTYP, the free directory anyone can edit if they can prove to me that they're not a spambot
< VbzCart‎ | pieces‎ | catalog
Jump to navigation Jump to search
(2 queries; more to go)
m (updated template name)
 
(70 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Navigation==
 
[[VbzCart]]: [[VbzCart catalog building|catalog building]]
 
 
==Version==
 
==Version==
This is being revised yet again for the 2007 VbzCart-MySQL migration project; the previous version is here: [[vbzwiki:VbzCart catalog building 2006|VbzCart catalog building 2006]].
+
This is a tricky process which has been revised multiple times.
==Process==
+
 
This is only a draft, as the process is still being worked out.
+
* {{l/sub|2017}} version - 2016 code apparently never really got finished, and the Items table needs some flag changes
# Update the list of all catalog-based items ([calc Items Updates saved])
+
* {{l/sub|2016}} version - webified version of 2010, with rules finally documented
#* Generate a list of all the items currently available from suppliers (query)
+
* '''2010''' version: see {{l/vbzcart/code|maint/build-cat.php}}
#* Add any new items to [calc Items Updates saved]
+
* {{l/sub|2009}} version - SQL statements executed directly from PHP code
# For all items in [calc Items Updates saved] where ID_Item IS NULL, create new records in cat_items and update the corresponding records in [calc Items Updates saved]
+
* {{l/sub|2008}} version - started in 2007 - a set of stored queries called from a stored procedure
# Update all data in cat_items from data stored in [calc Items Updates saved]
+
* {{l/sub|2006}} version
# In cat_items, clear all isForSale flags ''except'' for items either in stock or found in [calc Items Updates saved]
+
 
==SQL==
+
It's interesting to note that I originally thought of SCM Groups as groups ''of Titles'' -- an explanation from the [[VbzCart/tables]] page on 2008-02-17 (and only removed on 2016-02-01) says:
===qryVb_Items_updates_new===
+
<blockquote>The key concept here is "catalog title groups" (CTGs). A CTG is a set of titles which are all available with the same set of options (e.g. sizes) at the same prices (e.g. $10 S, $11 M-XL, $12 2XL). The final vbz catalog (cat_items) is the result of a sort of vector multiplication of Titles (cat_titles) and CTGs plus any items in stock.
<sql>SELECT c.*
+
</blockquote>
  FROM qryVb_Items_Updates AS c
+
This conceptualization no longer works, as a SCM Title may have one or more SCM Groups -- e.g. if it has a set of standard sizes (like S-3X) but is also available in super-large sizes (4X+).
  LEFT JOIN [calc Item Updates saved] AS s
 
    ON c.IDS_Update=s.IDS_Update
 
    WHERE s.IDS_Update IS NULL;</sql>
 
===qryVb_Items_updates_append===
 
<sql>INSERT INTO [calc Item Updates saved] (
 
  ID_Item,
 
  IDS_Update,
 
  ID_Title,
 
  ID_TGroup,
 
  ID_TGTitle,
 
  ID_TGItem,
 
  ID_ItTyp,
 
  ID_ItOpt )
 
SELECT
 
  NULL,
 
  IDS_Update,
 
  ID_Title,
 
  ID_TGroup,
 
  ID_TGTitle,
 
  ID_TGItem,
 
  ID_ItTyp,
 
  ID_ItOpt
 
FROM qryVb_Items_Updates_new;</sql>
 

Latest revision as of 11:07, 12 June 2017

Version

This is a tricky process which has been revised multiple times.

  • 2017 version - 2016 code apparently never really got finished, and the Items table needs some flag changes
  • 2016 version - webified version of 2010, with rules finally documented
  • 2010 version: see maint/build-cat.php
  • 2009 version - SQL statements executed directly from PHP code
  • 2008 version - started in 2007 - a set of stored queries called from a stored procedure
  • 2006 version

It's interesting to note that I originally thought of SCM Groups as groups of Titles -- an explanation from the VbzCart/tables page on 2008-02-17 (and only removed on 2016-02-01) says:

The key concept here is "catalog title groups" (CTGs). A CTG is a set of titles which are all available with the same set of options (e.g. sizes) at the same prices (e.g. $10 S, $11 M-XL, $12 2XL). The final vbz catalog (cat_items) is the result of a sort of vector multiplication of Titles (cat_titles) and CTGs plus any items in stock.

This conceptualization no longer works, as a SCM Title may have one or more SCM Groups -- e.g. if it has a set of standard sizes (like S-3X) but is also available in super-large sizes (4X+).