Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change calculation payment_total #3

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e2f98ba
Change new order button text on users edit page
kennyadsl Sep 30, 2016
0960b93
Fix deprecations from PromotionAction.of_type
Oct 13, 2016
5df664d
Add the ability to simple results from taxon API
Jul 13, 2016
721ae1a
Merge pull request #1331 from gmacdougall/simple-taxon-show-api
gmacdougall Oct 14, 2016
4a4e602
Remove prototypes controller
Sep 29, 2016
d3ed7a7
Remove prototype views
Sep 29, 2016
8f7f432
Remove prototype-creation feature spec
Sep 29, 2016
f29476d
Remove @prototype assignment from controller
Sep 30, 2016
b2c0680
Remove prototype routes
Sep 30, 2016
722863c
Remove prototypes from product sub tabs
Oct 4, 2016
5434a7f
Remove prototypes button from toolbar
Oct 4, 2016
bb83bc7
Remove prototype from form
Oct 4, 2016
1ad2198
Remove prototype for ajax
Oct 4, 2016
5b5e4c3
Remove prototype from new product page
Oct 4, 2016
c7ee8b3
Remove prototype clearfix
Oct 4, 2016
da8f769
Remove test for prototypes tab on homepage
Oct 4, 2016
a39a9bd
Remove prototype sections of spec
Oct 4, 2016
cdc51e1
Delete prototype model
Oct 4, 2016
cb83680
Remove prototype models and associations
Oct 5, 2016
82865eb
Remove callback and accessor from product model
Oct 5, 2016
2e795e8
Remove relations from property model
Oct 5, 2016
3e81f93
Delete property prototype model
Oct 5, 2016
b0c4383
Delete prototype taxon
Oct 5, 2016
54faba9
Remove prototype relations from taxon
Oct 5, 2016
64b8824
Remove prototype translations
Oct 5, 2016
98f92d1
Remove prototype from product display permission set
Oct 5, 2016
27b43a9
Remove prototype from product management permission set
Oct 5, 2016
a490cb3
Remove prototype from PermittedAttributes
Oct 5, 2016
923a726
Remove prototype factory
Oct 5, 2016
f687a00
Remove prototype factory spec
Oct 5, 2016
46a2d3e
Remove prototype from product display spec
Oct 5, 2016
c35c7d4
Remove prototype from product management permission set spec
Oct 5, 2016
25bbec4
Remove prototype-contexts from product model spec
Oct 5, 2016
0ef151c
Remove prototype shared contexts
Oct 6, 2016
95cd0f1
Remove sample prototypes
Oct 6, 2016
4ffd596
Update CHANGELOG
Oct 12, 2016
27bb376
Do not require 'wrapper_class' var in price checkbox partial
mamhoff Oct 17, 2016
bac074a
Merge pull request #1517 from gevann/prototypes-move-to-extension
jhawthorn Oct 17, 2016
1256569
Merge pull request #1522 from jhawthorn/fix_of_type_deprecation
jhawthorn Oct 17, 2016
ebda5c8
Merge pull request #1488 from nebulab/improve-button-text
jhawthorn Oct 17, 2016
d3e3274
Merge pull request #1528 from mamhoff/fix-missing-wrapper-class-error
jhawthorn Oct 18, 2016
c851404
Fix how orders payment total is calculated
DanielePalombo Oct 14, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Solidus 2.1.0 (master, unreleased)
* Prototypes were removed from the admin; the extension `solidus_prototype`
provides the same functionality

* Remove `currency` from line items.

Expand Down Expand Up @@ -238,7 +240,7 @@

https://github.com/solidusio/solidus/pull/904

In order to convert your historical shipping rate taxation data, please run
In order to convert your historical shipping rate taxation data, please run
`rake solidus:upgrade:one_point_three` - this will create persisted taxation notes
for historical shipping rates. Be aware though that these taxation notes are
estimations and should not be used for accounting purposes.
Expand Down
11 changes: 11 additions & 0 deletions api/app/controllers/spree/api/taxons_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ def products
# Products#index does not do the sorting.
taxon = Spree::Taxon.find(params[:id])
@products = paginate(taxon.products.ransack(params[:q]).result)
@products = @products.includes(master: :default_price)

if params[:simple]
@exclude_data = {
variants: true,
option_types: true,
product_properties: true,
classifications: true
}
@product_attributes = %i(id name display_price)
end
render "spree/api/products/index"
end

Expand Down
2 changes: 1 addition & 1 deletion api/app/views/spree/api/products/index.v1.rabl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object false
node(:count) { @products.count }
node(:count) { @products.size }
node(:total_count) { @products.total_count }
node(:current_page) { @products.current_page }
node(:per_page) { @products.limit_value }
Expand Down
41 changes: 26 additions & 15 deletions api/app/views/spree/api/products/show.v1.rabl
Original file line number Diff line number Diff line change
@@ -1,31 +1,42 @@
object @product
cache [I18n.locale, @current_user_roles.include?('admin'), current_pricing_options, root_object]

attributes *product_attributes
@product_attributes ||= product_attributes
attributes(*@product_attributes)

node(:display_price) { |p| p.display_price.to_s }
node(:has_variants) { |p| p.has_variants? }

child :master => :master do
extends "spree/api/variants/small"
end
@exclude_data ||= {}
unless @exclude_data[:variants]
node(:has_variants) { |p| p.has_variants? }

child :master => :master do
extends "spree/api/variants/small"
end

child :variants => :variants do
extends "spree/api/variants/small"
child :variants => :variants do
extends "spree/api/variants/small"
end
end

child :option_types => :option_types do
attributes *option_type_attributes
unless @exclude_data[:option_types]
child :option_types => :option_types do
attributes(*option_type_attributes)
end
end

child :product_properties => :product_properties do
attributes *product_property_attributes
unless @exclude_data[:product_properties]
child :product_properties => :product_properties do
attributes(*product_property_attributes)
end
end

child :classifications => :classifications do
attributes :taxon_id, :position
unless @exclude_data[:classifications]
child :classifications => :classifications do
attributes :taxon_id, :position

child(:taxon) do
extends "spree/api/taxons/show"
child(:taxon) do
extends "spree/api/taxons/show"
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ $ ->
$('#taxon_id').on "change", (e) ->
Spree.ajax
url: Spree.routes.taxon_products_api,
data: { id: e.val }
data: { id: e.val, simple: 1 }
success: (data) ->
sortable.html productListTemplate(data.products)
6 changes: 0 additions & 6 deletions backend/app/controllers/spree/admin/products_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ class ProductsController < ResourceController
helper 'spree/products'

before_action :load_data, except: [:index]
create.before :create_before
update.before :update_before
helper_method :clone_object_url

Expand Down Expand Up @@ -115,11 +114,6 @@ def collection
@collection
end

def create_before
return if params[:product][:prototype_id].blank?
@prototype = Spree::Prototype.find(params[:product][:prototype_id])
end

def update_before
# note: we only reset the product properties if we're receiving a post
# from the form on that tab
Expand Down
26 changes: 0 additions & 26 deletions backend/app/controllers/spree/admin/prototypes_controller.rb

This file was deleted.

2 changes: 1 addition & 1 deletion backend/app/models/spree/backend_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class BackendConfiguration < Preferences::Configuration
ORDER_TABS ||= [:orders, :payments, :creditcard_payments,
:shipments, :credit_cards, :return_authorizations,
:customer_returns, :adjustments, :customer_details]
PRODUCT_TABS ||= [:products, :option_types, :properties, :prototypes,
PRODUCT_TABS ||= [:products, :option_types, :properties,
:variants, :product_properties, :taxonomies,
:taxons]
REPORT_TABS ||= [:reports]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
<li>
<%= link_to_add_fields Spree.t(:add_product_properties), 'tbody#product_properties', :class => 'plus button' %>
</li>
<li>
<span id="new_ptype_link">
<%= link_to Spree.t(:select_from_prototype), available_admin_prototypes_url, :remote => true, :class => 'button fa fa-copy' %>
</span>
</li>
</ul>
<% end %>
<% end %>
Expand All @@ -23,8 +18,6 @@
<legend align="center"><%= plural_resource_name(Spree::ProductProperty) %></legend>
<div class="add_product_properties" data-hook="add_product_properties"></div>

<div id="prototypes" data-hook></div>

<table class="index sortable" data-hook data-sortable-link="<%= update_positions_admin_product_product_properties_url %>">
<thead>
<tr data-hook="product_properties_header">
Expand Down
2 changes: 1 addition & 1 deletion backend/app/views/spree/admin/products/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
</div>

<% if show_rebuild_vat_checkbox? %>
<%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "product"%>
<%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "product" %>
<div class="clearfix"></div>
<% end %>

Expand Down
33 changes: 0 additions & 33 deletions backend/app/views/spree/admin/products/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,6 @@
</div>
<% end %>

<div data-hook="new_product_prototype" class="col-xs-3">
<%= f.field_container :prototype do %>
<%= f.label :prototype_id, Spree::Prototype.model_name.human %><br />
<%= f.collection_select :prototype_id, Spree::Prototype.all, :id, :name, {:include_blank => true}, {:class => 'select2 fullwidth'} %>
<% end %>
</div>

<div data-hook="new_product_price" class="col-xs-3">
<%= f.field_container :price do %>
<%= f.label :price, class: 'required' %><br />
Expand Down Expand Up @@ -69,33 +62,7 @@
</div>
</div>

<div class="clearfix" data-hook="product-from-prototype" id="product-from-prototype">
<%= render :file => 'spree/admin/prototypes/show' if @prototype %>
</div>

<%= render :partial => 'spree/admin/shared/new_resource_links' %>

</fieldset>
<% end %>

<script type="text/javascript">
//<![CDATA[
(function($){
var base_url = "<%= admin_prototypes_url %>";
var prototype_select = $('#product_prototype_id');
prototype_select.change(function() {
var id = prototype_select.val();
if (id.length) {
var url = new Uri(base_url);
url.setPath(url.path() + '/' + id);
$('#product-from-prototype').load(url.toString());
} else {
$('#product-from-prototype').empty();
}
})
if (prototype_select.html() == "") {
prototype_select.change();
}
})(jQuery);
//]]>
</script>
36 changes: 0 additions & 36 deletions backend/app/views/spree/admin/prototypes/_form.html.erb

This file was deleted.

25 changes: 0 additions & 25 deletions backend/app/views/spree/admin/prototypes/_prototypes.html.erb

This file was deleted.

2 changes: 0 additions & 2 deletions backend/app/views/spree/admin/prototypes/available.js.erb

This file was deleted.

15 changes: 0 additions & 15 deletions backend/app/views/spree/admin/prototypes/edit.html.erb

This file was deleted.

50 changes: 0 additions & 50 deletions backend/app/views/spree/admin/prototypes/index.html.erb

This file was deleted.

9 changes: 0 additions & 9 deletions backend/app/views/spree/admin/prototypes/new.html.erb

This file was deleted.

5 changes: 0 additions & 5 deletions backend/app/views/spree/admin/prototypes/new.js.erb

This file was deleted.

4 changes: 0 additions & 4 deletions backend/app/views/spree/admin/prototypes/select.js.erb

This file was deleted.

Loading