spree_enhanced_option_types 0.30.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +12 -12
- data/app/controllers/admin/prototypes_controller_decorator.rb +7 -5
- data/app/views/products/_cart_form.html.erb +1 -1
- data/config/routes.rb +1 -1
- data/spree-enhanced-option-types.gemspec +1 -1
- metadata +4 -12
- data/README.md +0 -13
data/README.markdown
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
#
|
1
|
+
# Enhanced Option Types
|
2
2
|
|
3
3
|
Now supporting Spree 0.30.x !
|
4
4
|
|
5
5
|
## Description
|
6
6
|
|
7
|
-
This extension
|
7
|
+
This extension enhances spree functionality when handling products with
|
8
8
|
numerous and complex variants.
|
9
9
|
|
10
|
-
Following
|
10
|
+
Following enhancements are provided:
|
11
11
|
|
12
12
|
* Admin side:
|
13
13
|
* Selecting order of option types for prototype with drag & drop
|
@@ -26,13 +26,13 @@ Following enchancements are provided:
|
|
26
26
|
* using 2d table of radio boxes (only when there are only 2 option types!)
|
27
27
|
* Javascript helpers:
|
28
28
|
* Instant updating of price based on variant selected using above methods
|
29
|
-
*
|
29
|
+
* Instant updating of number of on_hand units
|
30
30
|
* enabling/disabling options that don't have corresponding variant.
|
31
31
|
* products.js override (edge spree only) for working with variant images
|
32
32
|
|
33
33
|
Some of the functionality might not work without javascript, but much work was put
|
34
|
-
to make JS as unintrusive as possible, so
|
35
|
-
to make it
|
34
|
+
to make JS as unintrusive as possible, so it should be fairly easy exercise
|
35
|
+
to make it completely JS independent.
|
36
36
|
|
37
37
|
## Credits
|
38
38
|
|
@@ -56,10 +56,10 @@ Second one shows selects - it's much more compact then previous example,
|
|
56
56
|
|
57
57
|
Thrid shows the 2d table for variant choosing.
|
58
58
|
|
59
|
-
##
|
59
|
+
## Installation
|
60
60
|
|
61
61
|
Add the following to your Gemfile:
|
62
|
-
<code>gem 'spree_enhanced_option_types', :git => '
|
62
|
+
<code>gem 'spree_enhanced_option_types', :git => 'https://github.com/swistak/spree-enhanced-option-types.git'</code>
|
63
63
|
|
64
64
|
Run:
|
65
65
|
<code>bundle install</code>
|
@@ -73,9 +73,9 @@ and finally:
|
|
73
73
|
## Customization
|
74
74
|
|
75
75
|
User interface change is limited only to _cart_form partial from original spree.
|
76
|
-
it was separated into several subfiles to make customization and
|
76
|
+
it was separated into several subfiles to make customization and embedding in custom layouts easier.
|
77
77
|
|
78
|
-
There are no inline styles (except for 2d table, that
|
78
|
+
There are no inline styles (except for 2d table, that absolutely requires
|
79
79
|
some wire frame styles to look sane), you can either use provided _cart_form
|
80
80
|
partial as a replacement for generic spree partial, or you can roll your own and
|
81
81
|
only include one of variant choosing partials.
|
@@ -84,7 +84,7 @@ There are some special css classes you might be interested in:
|
|
84
84
|
.price.update - price field that should be updated with new price value if variant changes.
|
85
85
|
span.
|
86
86
|
|
87
|
-
Source is
|
87
|
+
Source is extensively documented and I recommend reading it.
|
88
88
|
|
89
89
|
## Limitations
|
90
90
|
|
@@ -92,7 +92,7 @@ Source is extensivelly documented and I recomend reading it.
|
|
92
92
|
|
93
93
|
## TODO
|
94
94
|
|
95
|
-
-
|
95
|
+
- graceful handling non-js users.
|
96
96
|
- test under other browsers then FF
|
97
97
|
|
98
98
|
## License
|
@@ -1,7 +1,12 @@
|
|
1
1
|
Admin::PrototypesController.class_eval do
|
2
2
|
skip_after_filter :set_habtm_associations
|
3
|
+
|
4
|
+
update.after :reorder_option_types
|
5
|
+
create.after :reorder_option_types
|
3
6
|
|
4
|
-
|
7
|
+
protected
|
8
|
+
|
9
|
+
def reorder_option_types
|
5
10
|
set_habtm_associations
|
6
11
|
@prototype.option_types_prototypes.each do |otp|
|
7
12
|
new_position = params[:option_type][:id].index(otp.option_type_id.to_s)
|
@@ -15,7 +20,4 @@ Admin::PrototypesController.class_eval do
|
|
15
20
|
})
|
16
21
|
end
|
17
22
|
end
|
18
|
-
|
19
|
-
update.after(&reorder_option_types)
|
20
|
-
create.after(&reorder_option_types)
|
21
|
-
end
|
23
|
+
end
|
@@ -14,7 +14,7 @@
|
|
14
14
|
|
15
15
|
<% if @product.has_variants? %>
|
16
16
|
<div id="product-variants">
|
17
|
-
<%= render :partial => 'radio_sets', :locals => {:f => f} %>
|
17
|
+
<%= render :partial => (Spree::Config[:eot_presentation_type] || 'radio_sets'), :locals => {:f => f} %>
|
18
18
|
</div>
|
19
19
|
<% end%>
|
20
20
|
<% if @product.has_stock? || Spree::Config[:allow_backorders] %>
|
data/config/routes.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.platform = Gem::Platform::RUBY
|
3
3
|
s.name = 'spree_enhanced_option_types'
|
4
|
-
s.version = '0.
|
4
|
+
s.version = '0.50.0'
|
5
5
|
s.summary = 'Enchances Spree functionality when handling products with numerous and complex variants.'
|
6
6
|
s.description = 'This extension enchances spree functionality when handling products with numerous and complex variants.'
|
7
7
|
s.required_ruby_version = '>= 1.8.7'
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spree_enhanced_option_types
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 103
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
|
-
-
|
7
|
+
- 50
|
9
8
|
- 0
|
10
|
-
version: 0.
|
9
|
+
version: 0.50.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Marcin Raczkowski
|
@@ -17,18 +16,16 @@ autorequire:
|
|
17
16
|
bindir: bin
|
18
17
|
cert_chain: []
|
19
18
|
|
20
|
-
date: 2011-
|
19
|
+
date: 2011-04-27 00:00:00 +04:00
|
21
20
|
default_executable:
|
22
21
|
dependencies:
|
23
22
|
- !ruby/object:Gem::Dependency
|
24
23
|
name: spree_core
|
25
24
|
prerelease: false
|
26
25
|
requirement: &id001 !ruby/object:Gem::Requirement
|
27
|
-
none: false
|
28
26
|
requirements:
|
29
27
|
- - ">="
|
30
28
|
- !ruby/object:Gem::Version
|
31
|
-
hash: 99
|
32
29
|
segments:
|
33
30
|
- 0
|
34
31
|
- 30
|
@@ -48,7 +45,6 @@ files:
|
|
48
45
|
- .gitignore
|
49
46
|
- LICENSE
|
50
47
|
- README.markdown
|
51
|
-
- README.md
|
52
48
|
- Rakefile
|
53
49
|
- app/controllers/admin/prototypes_controller_decorator.rb
|
54
50
|
- app/controllers/admin/variants_controller_decorator.rb
|
@@ -102,29 +98,25 @@ rdoc_options: []
|
|
102
98
|
require_paths:
|
103
99
|
- lib
|
104
100
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
101
|
requirements:
|
107
102
|
- - ">="
|
108
103
|
- !ruby/object:Gem::Version
|
109
|
-
hash: 57
|
110
104
|
segments:
|
111
105
|
- 1
|
112
106
|
- 8
|
113
107
|
- 7
|
114
108
|
version: 1.8.7
|
115
109
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
-
none: false
|
117
110
|
requirements:
|
118
111
|
- - ">="
|
119
112
|
- !ruby/object:Gem::Version
|
120
|
-
hash: 3
|
121
113
|
segments:
|
122
114
|
- 0
|
123
115
|
version: "0"
|
124
116
|
requirements:
|
125
117
|
- none
|
126
118
|
rubyforge_project:
|
127
|
-
rubygems_version: 1.3.
|
119
|
+
rubygems_version: 1.3.6
|
128
120
|
signing_key:
|
129
121
|
specification_version: 3
|
130
122
|
summary: Enchances Spree functionality when handling products with numerous and complex variants.
|