db/samples/variants.rb in solidus_sample-4.2.4 vs db/samples/variants.rb in solidus_sample-4.3.0

- old
+ new

@@ -1,304 +1,325 @@ # frozen_string_literal: true Spree::Sample.load_sample("option_values") Spree::Sample.load_sample("products") -solidus_tshirt = Spree::Product.find_by!(name: "Solidus T-Shirt") -solidus_long = Spree::Product.find_by!(name: "Solidus Long Sleeve") -solidus_snapback_cap = Spree::Product.find_by!(name: "Solidus Snapback Cap") -solidus_hoodie = Spree::Product.find_by!(name: "Solidus Hoodie Zip") -ruby_hoodie = Spree::Product.find_by!(name: "Ruby Hoodie") -ruby_hoodie_zip = Spree::Product.find_by!(name: "Ruby Hoodie Zip") -ruby_polo = Spree::Product.find_by!(name: "Ruby Polo") -solidus_mug = Spree::Product.find_by!(name: "Solidus Mug") -ruby_mug = Spree::Product.find_by!(name: "Ruby Mug") -solidus_tote = Spree::Product.find_by!(name: "Solidus Tote") -ruby_tote = Spree::Product.find_by!(name: "Ruby Tote") -solidus_womens_tshirt = Spree::Product.find_by!(name: "Solidus Women's T-Shirt") +solidus_bottles = Spree::Product.find_by!(name: "Solidus Water Bottle") +solidus_tote = Spree::Product.find_by!(name: "Solidus tote") +solidus_hoodie = Spree::Product.find_by!(name: "Solidus hoodie") +solidus_mug_set = Spree::Product.find_by!(name: "Solidus mug set") +solidus_hat = Spree::Product.find_by!(name: "Solidus winter hat") +solidus_sticker = Spree::Product.find_by!(name: "Solidus circle sticker") +solidus_notebook = Spree::Product.find_by!(name: "Solidus notebook") +solidus_tshirt = Spree::Product.find_by!(name: "Solidus t-shirt") +solidus_long_sleeve_tee = Spree::Product.find_by!(name: "Solidus long sleeve tee") +solidus_dark_tee = Spree::Product.find_by!(name: "Solidus dark tee") +solidus_canvas_tote = Spree::Product.find_by!(name: "Solidus canvas tote bag") +solidus_cap = Spree::Product.find_by!(name: "Solidus cap") small = Spree::OptionValue.find_by!(name: "Small") medium = Spree::OptionValue.find_by!(name: "Medium") large = Spree::OptionValue.find_by!(name: "Large") extra_large = Spree::OptionValue.find_by!(name: "Extra Large") blue = Spree::OptionValue.find_by!(name: "Blue") black = Spree::OptionValue.find_by!(name: "Black") -white = Spree::OptionValue.find_by!(name: "White") +gray = Spree::OptionValue.find_by!(name: "Gray") +red = Spree::OptionValue.find_by!(name: "Red") variants = [ { - product: solidus_tshirt, - option_values: [small, blue], - sku: "SOL-00003", + product: solidus_hoodie, + option_values: [small, black], + sku: "SOL-HOODIE-04", cost_price: 17 }, { - product: solidus_tshirt, - option_values: [small, black], - sku: "SOL-00002", + product: solidus_hoodie, + option_values: [medium, black], + sku: "SOL-HOODIE-05", cost_price: 17 }, { - product: solidus_tshirt, - option_values: [small, white], - sku: "SOL-00004", + product: solidus_hoodie, + option_values: [large, black], + sku: "SOL-HOODIE-07", cost_price: 17 }, { - product: solidus_tshirt, - option_values: [medium, blue], - sku: "SOL-00005", + product: solidus_hoodie, + option_values: [extra_large, black], + sku: "SOL-HOODIE-06", cost_price: 17 }, { - product: solidus_tshirt, - option_values: [large, white], - sku: "SOL-00006", + product: solidus_hoodie, + option_values: [small, red], + sku: "SOL-HOODIE-01", cost_price: 17 }, { - product: solidus_tshirt, - option_values: [large, black], - sku: "SOL-00007", + product: solidus_hoodie, + option_values: [medium, red], + sku: "SOL-HOODIE-02", cost_price: 17 }, { - product: solidus_tshirt, - option_values: [extra_large, blue], - sku: "SOL-0008", + product: solidus_hoodie, + option_values: [large, red], + sku: "SOL-HOODIE-08", cost_price: 17 }, { - product: solidus_long, - option_values: [small, black], - sku: "SOL-LS02", + product: solidus_hoodie, + option_values: [extra_large, red], + sku: "SOL-HOODIE-03", cost_price: 17 }, { - product: solidus_long, - option_values: [small, white], - sku: "SOL-LS01", - cost_price: 17 + product: solidus_tshirt, + option_values: [medium, black], + sku: "SOL-TEE-01", + cost_price: 8.9 }, { - product: solidus_long, - option_values: [small, blue], - sku: "SOL-LS03", + product: solidus_tshirt, + option_values: [large, black], + sku: "SOL-TEE-02", + cost_price: 9.9 + }, + { + product: solidus_tshirt, + option_values: [extra_large, black], + sku: "SOL-TEE-03", + cost_price: 11.9 + }, + { + product: solidus_tote, + option_values: [small, red], + sku: "SOL-0000", cost_price: 17 }, { - product: solidus_long, - option_values: [medium, white], - sku: "SOL-LS04", + product: solidus_tote, + option_values: [large, red], + sku: "SOL-0001", cost_price: 17 }, { - product: solidus_long, - option_values: [medium, black], - sku: "SOL-LS05", + product: solidus_tote, + option_values: [extra_large, red], + sku: "SOL-0002", cost_price: 17 }, { - product: solidus_long, - option_values: [medium, blue], - sku: "SOL-LS06", + product: solidus_bottles, + option_values: [small, gray], + sku: "SOL-0011", cost_price: 17 }, { - product: solidus_long, - option_values: [large, white], - sku: "SOL-LS07", + product: solidus_bottles, + option_values: [medium, gray], + sku: "SOL-0012", cost_price: 17 }, { - product: solidus_long, - option_values: [large, black], - sku: "SOL-LS08", + product: solidus_bottles, + option_values: [large, gray], + sku: "SOL-0013", cost_price: 17 }, { - product: solidus_long, - option_values: [large, blue], - sku: "SOL-LS09", + product: solidus_bottles, + option_values: [extra_large, gray], + sku: "SOL-0014", cost_price: 17 }, { - product: solidus_womens_tshirt, + product: solidus_cap, option_values: [small, black], - sku: "SOL-WM001", - cost_price: 17 + sku: "SOL-HD001", + cost_price: 27 }, { - product: solidus_womens_tshirt, - option_values: [small, blue], - sku: "SOL-WM002", - cost_price: 17 + product: solidus_cap, + option_values: [small, gray], + sku: "SOL-HD002", + cost_price: 27 }, { - product: solidus_womens_tshirt, - option_values: [small, white], - sku: "SOL-WM003", - cost_price: 17 + product: solidus_cap, + option_values: [medium, black], + sku: "SOL-HD003", + cost_price: 27 }, { - product: solidus_womens_tshirt, - option_values: [medium, blue], - sku: "SOL-WM004", - cost_price: 17 + product: solidus_cap, + option_values: [medium, gray], + sku: "SOL-HD004", + cost_price: 27 }, { - product: solidus_womens_tshirt, - option_values: [medium, white], - sku: "SOL-WM005", - cost_price: 17 + product: solidus_cap, + option_values: [large, black], + sku: "SOL-HD005", + cost_price: 27 }, { - product: solidus_womens_tshirt, - option_values: [medium, black], - sku: "SOL-WM006", - cost_price: 17 + product: solidus_cap, + option_values: [extra_large, black], + sku: "SOL-HD045", + cost_price: 27 }, { - product: solidus_snapback_cap, - option_values: [small], - sku: "SOL-SNC02", - cost_price: 17 + product: solidus_cap, + option_values: [large, gray], + sku: "SOL-HD006", + cost_price: 27 }, { - product: solidus_snapback_cap, - option_values: [medium], - sku: "SOL-SNC03", - cost_price: 17 + product: solidus_cap, + option_values: [small, red], + sku: "SOL-HD007", + cost_price: 27 }, { - product: solidus_snapback_cap, - option_values: [large], - sku: "SOL-SNC04", - cost_price: 17 + product: solidus_cap, + option_values: [medium, red], + sku: "SOL-HD008", + cost_price: 27 }, { - product: solidus_hoodie, - option_values: [small], - sku: "SOL-HD02", + product: solidus_cap, + option_values: [large, red], + sku: "SOL-HD009", cost_price: 27 }, { - product: solidus_hoodie, - option_values: [medium], - sku: "SOL-HD03", + product: solidus_cap, + option_values: [extra_large, red], + sku: "SOL-HD010", cost_price: 27 }, { - product: solidus_hoodie, - option_values: [large], - sku: "SOL-HD04", + product: solidus_mug_set, + option_values: [small, gray], + sku: "SOL-HD011", cost_price: 27 }, { - product: ruby_hoodie, - option_values: [small], - sku: "RUB-HD02", + product: solidus_mug_set, + option_values: [medium, gray], + sku: "SOL-HD012", cost_price: 27 }, { - product: ruby_hoodie, - option_values: [medium], - sku: "RUB-HD03", + product: solidus_mug_set, + option_values: [extra_large, gray], + sku: "SOL-HD013", cost_price: 27 }, { - product: ruby_hoodie, - option_values: [large], - sku: "RUB-HD04", + product: solidus_mug_set, + option_values: [small, black], + sku: "SOL-HD014", cost_price: 27 }, { - product: ruby_hoodie_zip, - option_values: [small], - sku: "RUB-HD05", + product: solidus_mug_set, + option_values: [medium, black], + sku: "SOL-HD015", cost_price: 27 }, { - product: ruby_hoodie_zip, - option_values: [medium], - sku: "RUB-HD06", + product: solidus_mug_set, + option_values: [large, black], + sku: "SOL-HD016", cost_price: 27 }, { - product: ruby_hoodie_zip, - option_values: [large], - sku: "RUB-HD07", + product: solidus_mug_set, + option_values: [extra_large, black], + sku: "SOL-HD017", cost_price: 27 }, { - product: ruby_polo, - option_values: [small], - sku: "RUB-PL02", - cost_price: 23 + product: solidus_mug_set, + option_values: [large, blue], + sku: "SOL-HD018", + cost_price: 27 }, { - product: ruby_polo, - option_values: [medium], - sku: "RUB-PL03", - cost_price: 23 + product: solidus_mug_set, + option_values: [medium, blue], + sku: "SOL-HD019", + cost_price: 27 }, { - product: ruby_polo, - option_values: [large], - sku: "RUB-PL04", - cost_price: 23 + product: solidus_mug_set, + option_values: [extra_large, blue], + sku: "SOL-HD020", + cost_price: 27 } ] masters = { - solidus_tote => { - sku: "SOL-TOT01", + solidus_hoodie => { + sku: "SOL-HOODIE-00", cost_price: 17 }, - ruby_tote => { - sku: "RUB-TOT01", - cost_price: 17 - }, - solidus_snapback_cap => { - sku: "SOL-SNC01", - cost_price: 17 - }, - solidus_tshirt => { + solidus_bottles => { sku: "SOL-00001", cost_price: 17 }, - solidus_long => { - sku: "SOL-LS00", + solidus_tote => { + sku: "SOL-LG001", cost_price: 17 }, - solidus_hoodie => { - sku: "SOL-HD00", + solidus_mug_set => { + sku: "SOL-LGH01", cost_price: 27 }, - ruby_hoodie => { - sku: "RUB-HD01", + solidus_hat => { + sku: "SOL-MNH01", cost_price: 27 }, - ruby_hoodie_zip => { - sku: "RUB-HD00", + solidus_sticker => { + sku: "RUB-HDH01", cost_price: 27 }, - ruby_polo => { - sku: "RUB-PL01", - cost_price: 23 + solidus_tote => { + sku: "SOL-TOT01", + cost_price: 17 }, - solidus_mug => { + solidus_tote => { + sku: "RUB-TOT01", + cost_price: 17 + }, + solidus_notebook => { + sku: "SOL-SNC01", + cost_price: 17 + }, + solidus_tshirt => { + sku: "RUB-SNC02", + cost_price: 17 + }, + solidus_long_sleeve_tee => { sku: "SOL-MG01", cost_price: 7 }, - ruby_mug => { + solidus_dark_tee => { sku: "RUB-MG01", cost_price: 7 }, - solidus_womens_tshirt => { - sku: "SOL-WM00", - cost_price: 17 + solidus_canvas_tote => { + sku: "SOL-TTE99", + cost_price: 19 + }, + solidus_cap => { + sku: "SOL-CAP99", + cost_price: 24, } } Spree::Variant.create!(variants)