
The script should do the following:



1) Get all competitors

    a) Get all their products

    b) Get all the product configuration options and values

    c) Get all the pricing for each of the products configurations

    (eprintfast uses storecode ca_en or something like that)



2) Get all suppliers
    (Sina will use the same product set as eprintfast)
    (Cimpress will use the same products as vistaprint - although we can use the vista print rates less 5% as a comparison since Cimpress wholesale pricing is very weird)

    For Sina:

        a) Get the products from /product

        b) Get all the product options and values

        c) Get all the pricing for each of the products configurations

    For Cimpress:

        a) Use vistaprint prices with lowest discount price or if no discount then 6% discount on total price because Cimpress wholesale pricing is very weird. Needs to be 6% because we will by default be matching these 2 competitor prices by 5% so wee need to assume a 1% margin in pricing since our script will need to tell us if it's profitable or not.



3) Need to standardize the data results.

    a) Standardize options so we can compare them.. For example, epf may use qty but vistaprint may use productQuantity.
       - This should almost be done in javascript but what happens if there is an unknown option in one of the products. We can't ignore it..
         Maybe we need to make a log and avoid processing that product until this is addressed?
         This can be caught in (b) and we can prevent going into (c) until it's fixed. We will need to log this in database...
         Should we then have php generate a javascript or data that we can use to convert options and values into standard?
         A new option will result in a new database column that needs to be added.


3) Compile our price list using the data from our competitors and supplies.







* what if products do not have the same values.. for example... epf has stock, quantity, rounded corners but vistaprint only has quantity... we will need to somehow normalize this data but how... almost need to review all products in (a) before proceeding to (b)

Database tables:
- table to keep track of products and convert them to standard id numbers that can be shared between competitors and suppliers
- table to keep track of option names and their relevant column names
- table to keep track of option values. <-- do we need to standardize this?? (Probably - because one competitor may have stock as '14pt card' and another as '14pt cardstock'). This way we can assign id numbers in the db instead of varchar which would also speed up processing...

- table to keep track of internal product upc codes that will be shared between competitors and suppliers (upc, product_id, _aa, _ab, _ac, _ad,....)
  Example upc formats:
    1-2.2-1.3-43.55-123 - could be ok but the position of - an d. are a little weird
    aa1-ab2-ac3-ad4     - could be ok.. a little more processing because we will need to split by - and then regex letters and numbers
    1.1-2.1-3.43-55.123 - could be ok.. numbers will get confusing to read later but it's all numbers at least
    aa1ab2ac3ad4        - might cause issues and require more processing without delimiter
  Management of upc base combinations could get a little tricky...

- table to keep track of competitor/supplier pricing (ts_created, ts_updated, ts_deleted(?), competitor_id, supplier_id, product_id, discount_price, regular_price, internal_upc)

- table to keep track of the results (product_id,



































    // Variant Groups
	id				name
	---------------------
	1                Size
	2                Stock
	3                Quantity
	4                Rounded Corners


	// Variant Options
	id               name                   value?
	-----------------------------------------------
	1                2" x 3.5"              2x3.5
	2                2" x 6"                2x6
	3                2" x 8"                2x8
	4                2" x 11"               2x11
	5                2" x 14"               2x14
	6                3.5" x 2"              3.5x2



	// Product Variants
	id             variant_group_id       variant_option_id
	--------------------------------------------------------
	1              1                      1
	2              1                      2
	3              1                      3
	4              1                      4
	5              1                      5
	6              1                      6






