Skip to content

Commit

Permalink
seed updated
Browse files Browse the repository at this point in the history
  • Loading branch information
himanshumishra31 committed Apr 18, 2018
1 parent f1c6227 commit d397b50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SpreeGiftCard is an extension and one stop solution to integrate gift card funct

Demo
-----------------------------------
Try Spree Gift Card with direct deployment on Heroku:
Try Spree Gift Card for Spree 3-4 with direct deployment on Heroku:

[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/vinsol-spree-contrib/spree-demo-heroku/tree/spree-gift-card)

Expand Down
5 changes: 5 additions & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
if Spree::Product.gift_cards.count == 0
puts "\tCreating default gift card..."
shipping_category = Spree::ShippingCategory.create(name: 'Gift Card')
shipping_method = Spree::ShippingMethod.new(name: 'UPS Gift card', display_on: 'both')
shipping_method.shipping_categories << shipping_category
shipping_method.calculator = Spree::Calculator.create(type: 'Spree::Calculator::Shipping::FlatRate', preferences: { currency: "USD", amount: 0})
shipping_method.save
shipping_method.zones << Spree::Zone.all
product = Spree::Product.new(available_on: Time.now, name: "Gift Card", is_gift_card: true, slug: 'gift-card', price: 0, shipping_category_id: shipping_category.id)
option_type = Spree::OptionType.new(name: "is-gift-card", presentation: "Value")
product.option_types << option_type
Expand Down

0 comments on commit d397b50

Please sign in to comment.