-
Notifications
You must be signed in to change notification settings - Fork 104
Spree Import Export Tips
logicielsjpb edited this page May 9, 2017
·
9 revisions
Variant Prices/SKUs
To assign different SKUs or Prices to each variant, datashift supports two special columns
variant_price
variant_sku
These should contain pipe '|' delimited lists of the prices, or SKUs, to assign, to each Variant available, and should therefor contain exactly the same number of entries as Variants available.
N.B These columns should come AFTER the Variant creation columns, as the Variants must exists at the time these columns are processed.
Example
variant_price variant_sku
171.56|260.44|171.56|260.44 TARR.SFOP424EW0|TARR.SFOP424EW3|TARR.SFOP414EW0|TARR.SFOP414EW3
119.33|208.23 MOLE.SFOP140EA0|MOLE.SFOP140EA3
110.00|198.00 TALL.SFOP140EW0|TALL.SFOP140EW3
54.89|109.78|69.24 CHET.SFOP128EW3|CHET.SFOP140EW0|CHET.SFOP140EW3
42.22 LOST.REDL218EW0
https://github.com/spree/spree-product-assembly
- Assign Parts to a Product
Spree::Variant.active.where("spree_variants.sku like 'spanner_%'").each {|v| Spree::Product.active.find_by_name("Bag of spanners").parts << v }