piggybak 0.6.30 → 0.6.31
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/piggybak/piggybak.js +6 -3
- data/app/controllers/piggybak/orders_controller.rb +2 -2
- data/app/models/piggybak/order.rb +3 -1
- data/app/views/piggybak/cart/_items.html.erb +4 -2
- data/app/views/piggybak/orders/_billing_address.html.erb +1 -1
- data/app/views/piggybak/orders/_shipping.html.erb +1 -1
- data/app/views/piggybak/orders/_shipping_address.html.erb +1 -1
- data/app/views/rails_admin/main/_order_details.html.erb +1 -1
- data/db/migrate/20130516200305_add_confirmation_sent_to_orders.rb +5 -0
- data/lib/piggybak.rb +1 -1
- data/lib/piggybak/version.rb +1 -1
- metadata +5 -4
data/Gemfile.lock
CHANGED
@@ -12,18 +12,21 @@ $(function() {
|
|
12
12
|
piggybak.update_tax();
|
13
13
|
$('#new_piggybak_order').validate({
|
14
14
|
submitHandler: function(form) {
|
15
|
+
var submit = $($('#new_piggybak_order input[type=submit]'));
|
16
|
+
submit.prop('disabled',true);
|
17
|
+
submit.attr('value','Processing...');
|
15
18
|
form.submit()
|
16
19
|
}
|
17
20
|
});
|
18
21
|
});
|
19
22
|
|
20
23
|
var piggybak = {
|
21
|
-
shipping_els:
|
24
|
+
shipping_els: '#piggybak_order_shipping_address_attributes_state_id,#piggybak_order_shipping_address_attributes_country_id,#piggybak_order_shipping_address_attributes_zip',
|
22
25
|
initialize_listeners: function() {
|
23
|
-
|
26
|
+
$(document).on('change', piggybak.shipping_els, function() {
|
24
27
|
piggybak.update_shipping_options($(this));
|
25
28
|
});
|
26
|
-
$(
|
29
|
+
$(document).on('change', '#piggybak_order_billing_address_attributes_state_id', function() {
|
27
30
|
piggybak.update_tax();
|
28
31
|
});
|
29
32
|
$('#shipping select').change(function() {
|
@@ -92,7 +92,7 @@ module Piggybak
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def email
|
95
|
-
order = Order.find(params[:id])
|
95
|
+
order = Piggybak::Order.find(params[:id])
|
96
96
|
|
97
97
|
if can?(:email, order)
|
98
98
|
Piggybak::Notifier.order_notification(order).deliver
|
@@ -104,7 +104,7 @@ module Piggybak
|
|
104
104
|
end
|
105
105
|
|
106
106
|
def cancel
|
107
|
-
order = Order.find(params[:id])
|
107
|
+
order = Piggybak::Order.find(params[:id])
|
108
108
|
|
109
109
|
if can?(:cancel, order)
|
110
110
|
order.recorded_changer = current_user.id
|
@@ -21,7 +21,7 @@ module Piggybak
|
|
21
21
|
validate :number_payments
|
22
22
|
before_save :postprocess_order, :update_status, :set_new_record
|
23
23
|
after_save :record_order_note
|
24
|
-
after_save :deliver_order_confirmation, :if => Proc.new { |order| order.
|
24
|
+
after_save :deliver_order_confirmation, :if => Proc.new { |order| !order.confirmation_sent }
|
25
25
|
|
26
26
|
default_scope :order => 'created_at DESC'
|
27
27
|
|
@@ -30,7 +30,9 @@ module Piggybak
|
|
30
30
|
:order_notes_attributes, :details, :recorded_changer, :ip_address
|
31
31
|
|
32
32
|
def deliver_order_confirmation
|
33
|
+
Rails.logger.warn "stephie inside deliver order confirmation"
|
33
34
|
Piggybak::Notifier.order_notification(self).deliver
|
35
|
+
self.update_column(:confirmation_sent,true)
|
34
36
|
end
|
35
37
|
|
36
38
|
def initialize_defaults
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<td><%= number_to_currency item[:sellable].price %></td>
|
17
17
|
<td>
|
18
18
|
<% if page == "cart" -%>
|
19
|
-
<%=
|
19
|
+
<%= number_field_tag "quantity[#{item[:sellable].id}]", item[:quantity] %>
|
20
20
|
<% else -%>
|
21
21
|
<%= item[:quantity] %>
|
22
22
|
<% end -%>
|
@@ -66,7 +66,9 @@
|
|
66
66
|
</table>
|
67
67
|
|
68
68
|
<% if page == "cart" %>
|
69
|
-
|
69
|
+
<div data-no-turbolink>
|
70
|
+
<%= link_to "Proceed to Checkout", piggybak.orders_url, :id => "checkout" %>
|
71
|
+
</div>
|
70
72
|
<%= submit_tag "Update", :id => "update" %>
|
71
73
|
<% end -%>
|
72
74
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div id="shipping">
|
1
|
+
<div id="shipping" data-no-turbolink>
|
2
2
|
<h3>Shipping Option</h3>
|
3
3
|
<%= f.fields_for :line_items, @order.line_items.detect { |li| li.line_item_type == "shipment" } do |line_item_f| %>
|
4
4
|
<%= line_item_f.hidden_field :line_item_type, { :value => "shipment" } %>
|
@@ -25,7 +25,7 @@ N/A
|
|
25
25
|
<td valign="top">Actions</td>
|
26
26
|
<td>
|
27
27
|
<ul>
|
28
|
-
<li><%= link_to "
|
28
|
+
<li><%= link_to "Resend Email Confirmation", piggybak.email_order_url(form.object.id) %></li>
|
29
29
|
<li><%= link_to "View as Text", piggybak.download_order_url(form.object.id) %></li>
|
30
30
|
<% if form.object.total_due == 0.00 -%>
|
31
31
|
<li><%= link_to "Cancel Order", piggybak.cancel_order_url(form.object.id) %> (This does not refund payments.)</li>
|
data/lib/piggybak.rb
CHANGED
data/lib/piggybak/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: piggybak
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.31
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-
|
14
|
+
date: 2013-05-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rails
|
@@ -191,6 +191,7 @@ files:
|
|
191
191
|
- db/migrate/20111228231806_create_payment_methods.rb
|
192
192
|
- db/migrate/20121018213421_drop_sort_from_line_items.rb
|
193
193
|
- db/migrate/20121022164235_convert_all_decimal_fields.rb
|
194
|
+
- db/migrate/20130516200305_add_confirmation_sent_to_orders.rb
|
194
195
|
- db/migrate/20121210211600_change_user_agent_type.rb
|
195
196
|
- db/migrate/20111228231838_create_shipments.rb
|
196
197
|
- db/migrate/20120104020930_populate_countries_and_states.rb
|
@@ -235,7 +236,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
235
236
|
version: '0'
|
236
237
|
segments:
|
237
238
|
- 0
|
238
|
-
hash: -
|
239
|
+
hash: -2815695535894919528
|
239
240
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
241
|
none: false
|
241
242
|
requirements:
|
@@ -244,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
245
|
version: '0'
|
245
246
|
segments:
|
246
247
|
- 0
|
247
|
-
hash: -
|
248
|
+
hash: -2815695535894919528
|
248
249
|
requirements: []
|
249
250
|
rubyforge_project:
|
250
251
|
rubygems_version: 1.8.23
|