Skip to content

Instantly share code, notes, and snippets.

@sumanththikka
sumanththikka / sans_contemporary.sql
Created August 31, 2016 22:50
SKUs without Contemporary style
View sans_contemporary.sql
CREATE TABLE discover_bi_development.sku_style_from_collections_dup_1 AS
WITH sku_collection_positions AS (
SELECT
collection_variants.collection_id,
spree.variants.id AS variant_id,
spree.variants.sku,
collection_variants.position,
((collection_variants.position / 3)+1) as row,
((collection_variants.position % 3)+1) as column
FROM spree.collection_variants
View target_sku_2
[{:tcin=>50271838,
:title=>"Square Arm Bonded Leather Sofa - Threshold™",
:description=>
"Add style and comfort to your living room with the Threshold Square Arm Sofa. Its modern lines and track arm silhouette gives this sofa the clean look you’ve been looking for. Enrobed in bonded leather, the loose backs and cushions make cleaning a piece of cake! Its spring core, foam-filled seat cushion will provide you with ultimate comfort while its solid wood feet will ensure extra stability. Combine this Threshold Sofa with other pieces from the Threshold Square Arm Collection for a complete, coordinated look.",
:onlineInfo=>
{:priceType=>"SINGLE",
:price=>{:originalPrice=>599.99, :originalPriceText=>"$599.99", :currentPrice=>599.99, :currentPriceText=>"$599.99", :currencyCode=>"USD", :priceQualifier=>" "},
:minAdvertisedPriceExists=>false,
:availabilityCode=>"IN_STOCK",
:categoryName=>"sofas & sectionals"},
View sample_thd_response.rb
{:products=>
{:product=>
{:superSku=>false,
:skus=>
{:sku=>
{:ratingsReviews=>{:averageRating=>5, :totalReviews=>1},
:webUrl=>
"http://www.homedepot.com/p/Hamilton-Beach-Premiere-Cookware-Electric-Griddle-with-Backsplash-and-Warming-Tray-DISCONTINUED-38541/203660054",
:itemAvailability=>
{:inventoryStatus=>false,