-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from shiftdsm/upgrade-spree
Upgrade to Spree 4.0
- Loading branch information
Showing
9 changed files
with
43 additions
and
19 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
source 'https://rubygems.org' | ||
|
||
gemspec | ||
|
||
group :development, :test do | ||
gem 'spree_auth_devise' | ||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,20 @@ | ||
Spree::Payment.class_eval do | ||
scope :from_purchase_order, -> { where(source_type: 'Spree::PurchaseOrder') } | ||
# frozen_string_literal: true | ||
|
||
def po? | ||
source_type == 'Spree::PurchaseOrder' | ||
module Spree | ||
module PaymentDecorator | ||
def self.prepended(base) | ||
base.scope( | ||
:from_purchase_order, | ||
-> { where(source_type: 'Spree::PurchaseOrder') } | ||
) | ||
end | ||
|
||
def po? | ||
source_type == 'Spree::PurchaseOrder' | ||
end | ||
end | ||
end | ||
|
||
if ::Spree::Payment.included_modules.exclude?(::Spree::PaymentDecorator) | ||
::Spree::Payment.prepend ::Spree::PaymentDecorator | ||
end |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
<div class='well clearfix'> | ||
<div class="payment-gateway"> | ||
<% param_prefix = "payment_source[#{payment_method.id}]" %> | ||
<p class='field'> | ||
<%= label_tag :po_number do %> | ||
<%= Spree.t(:po_number) %><abbr class='required' title='required'>*</abbr> | ||
<% end %> | ||
<%= text_field_tag "#{param_prefix}[po_number]", '', id: :po_number, class: 'form-control required', size: 10, maxlength: 10, autocomplete: "off" %> | ||
</p> | ||
<p class='field'> | ||
<%= label_tag :organization_name do %> | ||
<%= Spree.t(:organization_name) %><abbr class='required' title='required'>*</abbr> | ||
<% end %> | ||
<%= text_field_tag "#{param_prefix}[organization_name]", '', id: :organization_name, class: 'form-control required'%> | ||
</p> | ||
|
||
<div class="payment-gateway-fields"> | ||
<div class="mb-4 payment-gateway-field checkout-content-inner-field"> | ||
<%= text_field_tag "#{param_prefix}[po_number]", '', id: 'po_number', class: 'spree-flat-input', placeholder: Spree.t(:po_number), required: true %> | ||
</div> | ||
|
||
<div class="payment-gateway-field checkout-content-inner-field"> | ||
<%= text_field_tag "#{param_prefix}[organization_name]", '', id: 'organization_name', class: 'spree-flat-input', placeholder: Spree.t(:organization_name), required: true %> | ||
</div> | ||
</div> | ||
</div> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
name { 'Spree Test Store' } | ||
url { 'www.example.com' } | ||
mail_from_address { '[email protected]' } | ||
default_currency { 'USD' } | ||
end | ||
|
||
# factory :user, class: Spree.user_class do | ||
|
This file contains 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