This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rails.application.config.middleware.use OmniAuth::Builder do | |
| provider :bootic, ENV['BOOTIC_CLIENT_ID'], ENV['BOOTIC_CLIENT_SECRET'], scope: 'admin' | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shop = root.shops.first | |
| price_list = shop.price_list(id: 49) | |
| price_list.price_list_products.full_set.each do |product| | |
| puts "#{product.slug}, #{product.price}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shop = root.shops.first | |
| price_lists = shop.price_lists | |
| price_lists.each do |price_list| | |
| puts "#{price_list.id}, #{price_list.name}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shop = root.shops.first | |
| contacts = shop.contacts.full_set | |
| contacts.each do |contact| | |
| puts "#{contact.email}, #{contact.name}, #{contact.phone_number}, #{contact.opt_in}" | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shop = root.shops.first | |
| orders = shop.orders(status: "successful", sort: "updated_on.desc") | |
| orders.each do |order| | |
| puts "#{order.code}, #{order.closed_on}" | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shop = root.shops.first | |
| products = shop.products(collections: "deals", class: "product").full_set | |
| file = 'backup_variants_deals.csv' | |
| columns = ["sku", "regular_price", "sale_price"] | |
| data = CSV.generate do |csv| | |
| csv << columns | |
| products.each do |product| | |
| variants = product.variants |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shop = root.shops.first | |
| file = "new_variants_deals.csv" | |
| options = {:col_sep => ",", :headers => true} | |
| CSV.foreach(file,options) do |row| | |
| begin | |
| variant = shop.variant(id: row['sku']) | |
| puts "#{row['sku']} <-- procesando SKU" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| file = "product_info.csv" | |
| columns = ["slug", "title", "price", "variant_count"] | |
| data = CSV.generate do |csv| | |
| csv << columns | |
| shop.products(status: "all", class: "product").full_set.each do |item| | |
| csv << [item.slug, item.title, item.regular_price, item.variants.count] | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shop = root.shops.first | |
| products = shop.products | |
| products.each do |product| | |
| unless product.is_bundle | |
| puts "#{product.slug},#{product.title},#{product.regular_price},#{product.variants.size}" | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| shop = root.shops.first | |
| products = shop.products | |
| products.each do |product| | |
| puts product.slug | |
| end |