caboose-cms 0.9.23 → 0.9.24
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/caboose/cart_old.js +12 -4
- data/app/assets/javascripts/caboose/model/index_table.js +23 -1
- data/app/controllers/caboose/cart_controller.rb +71 -10
- data/app/controllers/caboose/checkout_controller.rb +13 -0
- data/app/controllers/caboose/products_controller.rb +1 -1
- data/app/controllers/caboose/variant_limits_controller.rb +95 -0
- data/app/controllers/caboose/vendors_controller.rb +1 -0
- data/app/models/caboose/schema.rb +7 -0
- data/app/models/caboose/variant_limit.rb +50 -0
- data/app/views/caboose/checkout/checkout.html.erb +9 -9
- data/app/views/caboose/checkout/thanks.html.erb +7 -1
- data/app/views/caboose/invoices_mailer/fulfillment_new_invoice.html.erb +1 -1
- data/app/views/caboose/products/admin_index.html.erb +3 -3
- data/app/views/caboose/users/_admin_header.html.erb +6 -1
- data/app/views/caboose/variant_limits/admin_edit.html.erb +36 -0
- data/lib/caboose/version.rb +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 239f83b3bb1cc285a84046bf35ceb6bc8fefc781
|
4
|
+
data.tar.gz: f298f72d54aff977624e70e0bd86831732ca3877
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd27c86158c9aa067c4d7633740f91f71a8c782c1cc83ddf02dc271b01f207860a67185e0f548deb8d9b7de835b6721eb92e0cf99cbb4d10a965723957a2a9db
|
7
|
+
data.tar.gz: 95dc6d8d51f02e062c6b9f487f110057d7ef71bcfaa7c5f6ed6f3864687a5de9f429f3e092b33026519d9f0158ad372542cd74bd9339f0a75858d74801046f0e
|
@@ -104,10 +104,10 @@ Caboose.Store.Modules.Cart = (function() {
|
|
104
104
|
self.render_item_count(response.item_count);
|
105
105
|
if (self.$add_to_cart.length) self.$add_to_cart.trigger('added');
|
106
106
|
|
107
|
-
if (!self.$add_to_cart.find('.message').length) {
|
107
|
+
if (!self.$add_to_cart.find('.message').length) {
|
108
108
|
self.$add_to_cart
|
109
109
|
.append($('<div/>').hide().addClass('message')
|
110
|
-
.append($('<p/>').text('Successfully added to cart'))
|
110
|
+
.append($('<p/>').text(response.quantity_message ? response.quantity_message : 'Successfully added to cart'))
|
111
111
|
.append($('<p/>')
|
112
112
|
.append($('<a/>').attr('href', '/cart').html('View cart')).append(' | ')
|
113
113
|
.append($('<a/>').attr('href', '/checkout').html('Continue to checkout'))
|
@@ -120,8 +120,16 @@ Caboose.Store.Modules.Cart = (function() {
|
|
120
120
|
// self.$add_to_cart.find('.message').fadeOut(function() { $(this).remove() });
|
121
121
|
//}, 5000);
|
122
122
|
}
|
123
|
-
} else {
|
124
|
-
|
123
|
+
} else {
|
124
|
+
if (!self.$add_to_cart.find('.message').length) {
|
125
|
+
self.$add_to_cart
|
126
|
+
.append($('<div/>').hide().addClass('note error')
|
127
|
+
.append($('<p/>').text(resp.error ? resp.error : (resp.errors ? resp.errors[0] : "Error adding to cart")))
|
128
|
+
.append($('<p/>').append($('<a/>').attr('href', '/cart').html('View cart')))
|
129
|
+
);
|
130
|
+
self.$add_to_cart.find('.message').fadeIn();
|
131
|
+
}
|
132
|
+
//alert(response.errors[0]);
|
125
133
|
}
|
126
134
|
}
|
127
135
|
});
|
@@ -927,7 +927,29 @@ IndexTable.prototype = {
|
|
927
927
|
async: false
|
928
928
|
});
|
929
929
|
}
|
930
|
-
});
|
930
|
+
});
|
931
|
+
|
932
|
+
//var arr = [];
|
933
|
+
//$.each(this.new_model_fields, function(i, f) {
|
934
|
+
// if (f.options_url && !f.options)
|
935
|
+
// {
|
936
|
+
// console.log("Testing1");
|
937
|
+
// arr.push($.ajax({
|
938
|
+
// url: f.options_url,
|
939
|
+
// type: 'get'
|
940
|
+
// }));
|
941
|
+
// }
|
942
|
+
//});
|
943
|
+
//if (arr.length > 0)
|
944
|
+
//{
|
945
|
+
// console.log("Testing");
|
946
|
+
// that.show_message($('<p/>').addClass('loading').html("Getting options..."));
|
947
|
+
// $.when.apply(null, arr).done(function(resp) {
|
948
|
+
// console.log(resp);
|
949
|
+
// //that.new_form();
|
950
|
+
// });
|
951
|
+
// return;
|
952
|
+
//}
|
931
953
|
|
932
954
|
var form = $('<form/>').attr('id', 'new_form')
|
933
955
|
.append($('<input/>').attr('type', 'hidden').attr('name', 'authenticity_token').val(that.form_authenticity_token));
|
@@ -38,16 +38,46 @@ module Caboose
|
|
38
38
|
end
|
39
39
|
|
40
40
|
# @route POST /cart
|
41
|
-
def add
|
41
|
+
def add
|
42
|
+
resp = StdClass.new
|
43
|
+
|
42
44
|
v = Variant.find(params[:variant_id])
|
43
45
|
qty = params[:quantity] ? params[:quantity].to_i : 1
|
46
|
+
if @invoice.line_items.exists?(:variant_id => v.id)
|
47
|
+
li = @invoice.line_items.find_by_variant_id(v.id)
|
48
|
+
qty = li.quantity + qty
|
49
|
+
end
|
50
|
+
|
51
|
+
# Check the variant limits
|
52
|
+
vl = VariantLimit.where(:variant_id => v.id, :user_id => @logged_in_user.id).first
|
53
|
+
vl = VariantLimit.where(:variant_id => v.id, :user_id => User.logged_out_user_id(@site.id)).first if vl.nil?
|
54
|
+
if vl && vl.no_purchases_allowed
|
55
|
+
resp.error = "You don't have permission to purchase this item."
|
56
|
+
resp.error << "You may have different purchase permissions if you <a href='/login'>login</a>." if !logged_in?
|
57
|
+
render :json => resp
|
58
|
+
return
|
59
|
+
end
|
60
|
+
qty2 = logged_in? && vl && vl.current_value ? qty + vl.current_value : qty
|
61
|
+
if vl && !vl.qty_within_range(qty2)
|
62
|
+
resp.quantity_message = vl.quantity_message
|
63
|
+
if !logged_in?
|
64
|
+
resp.quantity_message << "You may have different purchase permissions if you <a href='/login'>login</a>." if !logged_in?
|
65
|
+
if vl.qty_too_low(qty) then qty = vl.min_quantity
|
66
|
+
elsif vl.qty_too_high(qty) then qty = vl.max_quantity
|
67
|
+
end
|
68
|
+
else
|
69
|
+
if vl.qty_too_low(qty)
|
70
|
+
qty = vl.min_quantity
|
71
|
+
resp.quantity_message = "You must purchase at least #{vl.min_quantity} of this item, your cart has been updated."
|
72
|
+
elsif vl.qty_too_high(qty2)
|
73
|
+
qty = vl.max_quantity - vl.current_value
|
74
|
+
resp.quantity_message = "You can only purchase #{vl.max_quantity} of this item, your cart has been updated."
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
44
78
|
|
45
|
-
resp = StdClass.new
|
46
|
-
|
47
79
|
if @invoice.line_items.exists?(:variant_id => v.id)
|
48
80
|
li = @invoice.line_items.find_by_variant_id(v.id)
|
49
|
-
li.quantity += qty
|
50
|
-
li.subtotal = li.unit_price * li.quantity
|
51
81
|
InvoiceLog.create(
|
52
82
|
:invoice_id => @invoice.id,
|
53
83
|
:line_item_id => li.id,
|
@@ -55,11 +85,14 @@ module Caboose
|
|
55
85
|
:date_logged => DateTime.now.utc,
|
56
86
|
:invoice_action => InvoiceLog::ACTION_LINE_ITEM_UPDATED,
|
57
87
|
:field => 'quantity',
|
58
|
-
:old_value => li.quantity
|
59
|
-
:new_value =>
|
88
|
+
:old_value => li.quantity,
|
89
|
+
:new_value => qty
|
60
90
|
)
|
91
|
+
li.quantity = qty
|
92
|
+
li.subtotal = li.unit_price * qty
|
93
|
+
li.save
|
61
94
|
else
|
62
|
-
unit_price = v.clearance && v.clearance_price ? v.clearance_price : (v.on_sale? ? v.sale_price : v.price)
|
95
|
+
unit_price = v.clearance && v.clearance_price ? v.clearance_price : (v.on_sale? ? v.sale_price : v.price)
|
63
96
|
li = LineItem.create(
|
64
97
|
:invoice_id => @invoice.id,
|
65
98
|
:variant_id => v.id,
|
@@ -105,7 +138,35 @@ module Caboose
|
|
105
138
|
end
|
106
139
|
case name
|
107
140
|
when 'quantity' then
|
108
|
-
|
141
|
+
|
142
|
+
value = value.to_i
|
143
|
+
qty = value
|
144
|
+
|
145
|
+
# Check the variant limits
|
146
|
+
vl = VariantLimit.where(:variant_id => li.variant_id, :user_id => @logged_in_user.id).first
|
147
|
+
vl = VariantLimit.where(:variant_id => li.variant_id, :user_id => User.logged_out_user_id(@site.id)).first if vl.nil?
|
148
|
+
if vl && vl.no_purchases_allowed
|
149
|
+
resp.error = "You don't have permission to purchase this item."
|
150
|
+
resp.error << "You may have different purchase permissions if you <a href='/login'>login</a>." if !logged_in?
|
151
|
+
render :json => resp
|
152
|
+
return
|
153
|
+
end
|
154
|
+
qty2 = logged_in? && vl && vl.current_value ? qty + vl.current_value : qty
|
155
|
+
if vl && !vl.qty_within_range(qty2)
|
156
|
+
resp.quantity_message = vl.quantity_message
|
157
|
+
if !logged_in?
|
158
|
+
resp.quantity_message << "You may have different purchase permissions if you <a href='/login'>login</a>." if !logged_in?
|
159
|
+
if vl.qty_too_low(qty) then qty = vl.min_quantity
|
160
|
+
elsif vl.qty_too_high(qty) then qty = vl.max_quantity
|
161
|
+
end
|
162
|
+
else
|
163
|
+
if vl.qty_too_low(qty) then qty = (qty == 0 ? 0 : vl.min_quantity)
|
164
|
+
elsif vl.qty_too_high(qty2) then qty = vl.max_quantity - vl.current_value
|
165
|
+
end
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
if qty != li.quantity
|
109
170
|
op = li.invoice_package
|
110
171
|
if op
|
111
172
|
op.shipping_method_id = nil
|
@@ -118,7 +179,7 @@ module Caboose
|
|
118
179
|
li.invoice.calculate
|
119
180
|
end
|
120
181
|
end
|
121
|
-
li.quantity =
|
182
|
+
li.quantity = qty
|
122
183
|
if li.quantity == 0
|
123
184
|
li.destroy
|
124
185
|
InvoiceLog.create(
|
@@ -211,9 +211,13 @@ module Caboose
|
|
211
211
|
# Make sure all the variants still exist
|
212
212
|
@invoice.line_items.each do |li|
|
213
213
|
v = Variant.where(:id => li.variant_id).first
|
214
|
+
vl = VariantLimit.where(:variant_id => v.id, :user_id => @invoice.customer_id).first
|
214
215
|
if v.nil? || v.status == 'Deleted'
|
215
216
|
render :json => { :error => 'One or more of the products you are purchasing are no longer available.' }
|
216
217
|
return
|
218
|
+
elsif !vl.qty_within_range( vl.current_value + li.quantity )
|
219
|
+
render :json => { :error => 'You have exceeded the limit you are allowed to purchase.' }
|
220
|
+
return
|
217
221
|
end
|
218
222
|
end
|
219
223
|
|
@@ -262,6 +266,15 @@ module Caboose
|
|
262
266
|
|
263
267
|
@invoice.status = Invoice::STATUS_PENDING
|
264
268
|
@invoice.invoice_number = @site.store_config.next_invoice_number
|
269
|
+
|
270
|
+
# Update variant limits to reflect this purchase
|
271
|
+
@invoice.line_items.each do |li|
|
272
|
+
vl = VariantLimit.where(:user_id => @invoice.customer_id, :variant_id => li.variant_id).first
|
273
|
+
if vl
|
274
|
+
vl.current_value += li.quantity
|
275
|
+
vl.save
|
276
|
+
end
|
277
|
+
end
|
265
278
|
|
266
279
|
# Send out emails
|
267
280
|
begin
|
@@ -71,7 +71,7 @@ module Caboose
|
|
71
71
|
|
72
72
|
elsif params[:id].to_i > 0 && Product.exists?(params[:id])
|
73
73
|
@product = Product.find(params[:id])
|
74
|
-
render 'product/not_available' and return if @product.status == 'Inactive'
|
74
|
+
render 'product/not_available' and return if @product.status == 'Inactive' || @product.site_id != @site.id
|
75
75
|
|
76
76
|
@category = @product.categories.first
|
77
77
|
@review = Review.new
|
@@ -0,0 +1,95 @@
|
|
1
|
+
module Caboose
|
2
|
+
class VariantLimitsController < ApplicationController
|
3
|
+
layout 'caboose/admin'
|
4
|
+
|
5
|
+
# @route GET /admin/variant-limits/json
|
6
|
+
def admin_json
|
7
|
+
render :json => false and return if !user_is_allowed_to 'view', 'variantlimits'
|
8
|
+
pager = Caboose::Pager.new(params, {
|
9
|
+
'variant_id' => '',
|
10
|
+
'user_id' => params[:user_id]
|
11
|
+
},
|
12
|
+
{
|
13
|
+
'model' => 'Caboose::VariantLimit',
|
14
|
+
'sort' => 'variant_id',
|
15
|
+
'desc' => 'false',
|
16
|
+
'base_url' => '/admin/variant-limits',
|
17
|
+
'items_per_page' => 100
|
18
|
+
})
|
19
|
+
render :json => {
|
20
|
+
:pager => pager,
|
21
|
+
:models => pager.items.as_json(:include => [:variant])
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
# @route GET /admin/variant-limits/:id/json
|
26
|
+
def admin_json_single
|
27
|
+
render :json => false and return if !user_is_allowed_to 'edit', 'variantlimits'
|
28
|
+
variantlimit = VariantLimit.find(params[:id])
|
29
|
+
render :json => variantlimit.as_json(:include => [:variant])
|
30
|
+
end
|
31
|
+
|
32
|
+
# @route POST /admin/variant-limits
|
33
|
+
def admin_add
|
34
|
+
return unless (user_is_allowed_to 'edit', 'variantlimits')
|
35
|
+
resp = Caboose::StdClass.new
|
36
|
+
if VariantLimit.where(:user_id => params[:user_id], :variant_id => params[:variant_id]).exists?
|
37
|
+
resp.error = 'That variant is already added to this user.'
|
38
|
+
else
|
39
|
+
c = VariantLimit.new
|
40
|
+
c.user_id = params[:user_id]
|
41
|
+
c.variant_id = params[:variant_id]
|
42
|
+
c.min_quantity = 0
|
43
|
+
c.max_quantity = 0
|
44
|
+
c.current_value = 0
|
45
|
+
c.save
|
46
|
+
resp.success = true
|
47
|
+
end
|
48
|
+
render :json => resp
|
49
|
+
end
|
50
|
+
|
51
|
+
# @route PUT /admin/variant-limits/:id
|
52
|
+
def admin_update
|
53
|
+
return unless (user_is_allowed_to 'edit', 'variantlimits')
|
54
|
+
resp = Caboose::StdClass.new
|
55
|
+
variantlimit = VariantLimit.find(params[:id])
|
56
|
+
user = logged_in_user
|
57
|
+
if user
|
58
|
+
|
59
|
+
params.each do |k,v|
|
60
|
+
case k
|
61
|
+
when "user_id" then variantlimit.user_id = v
|
62
|
+
when "variant_id" then variantlimit.variant_id = v
|
63
|
+
when "min_quantity" then variantlimit.min_quantity = v
|
64
|
+
when "max_quantity" then variantlimit.max_quantity = v
|
65
|
+
when "current_value" then variantlimit.current_value = v
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
resp.success = variantlimit.save
|
70
|
+
end
|
71
|
+
render :json => resp
|
72
|
+
end
|
73
|
+
|
74
|
+
# @route GET /admin/users/:user_id/variant-limits
|
75
|
+
def admin_edit
|
76
|
+
return unless (user_is_allowed_to 'edit', 'users')
|
77
|
+
@edituser = Caboose::User.find(params[:user_id])
|
78
|
+
end
|
79
|
+
|
80
|
+
# @route_priority 1
|
81
|
+
# @route GET /admin/variant-limits/variant-options
|
82
|
+
def admin_variant_options
|
83
|
+
return unless user_is_allowed('edit', 'users')
|
84
|
+
options = [{ 'value' => nil, 'text' => 'Select a Variant' }]
|
85
|
+
products = Caboose::Product.where(:site_id => @site.id).all
|
86
|
+
products.each do |p|
|
87
|
+
p.variants.each do |v|
|
88
|
+
options << { 'value' => v.id, 'text' => v.full_title }
|
89
|
+
end
|
90
|
+
end
|
91
|
+
render :json => options
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
95
|
+
end
|
@@ -95,6 +95,7 @@ module Caboose
|
|
95
95
|
|
96
96
|
# @route_priority 1
|
97
97
|
# @route GET /admin/store/vendors/options
|
98
|
+
# @route GET /admin/vendors/options
|
98
99
|
def options
|
99
100
|
render :json => Vendor.where(:site_id => @site.id).reorder(:name).all.collect{ |v| { :value => v.id, :text => v.name }}
|
100
101
|
end
|
@@ -971,6 +971,13 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
971
971
|
[ :downloadable , :boolean , { :default => false }],
|
972
972
|
[ :is_bundle , :boolean , { :default => false }]
|
973
973
|
],
|
974
|
+
Caboose::VariantLimit => [
|
975
|
+
[ :variant_id , :integer ],
|
976
|
+
[ :user_id , :integer ],
|
977
|
+
[ :min_quantity , :integer ],
|
978
|
+
[ :max_quantity , :integer ],
|
979
|
+
[ :current_value , :integer ]
|
980
|
+
],
|
974
981
|
Caboose::Vendor => [
|
975
982
|
[ :site_id , :integer ],
|
976
983
|
[ :alternate_id , :string ],
|
@@ -0,0 +1,50 @@
|
|
1
|
+
module Caboose
|
2
|
+
class VariantLimit < ActiveRecord::Base
|
3
|
+
self.table_name = 'store_variant_limits'
|
4
|
+
|
5
|
+
belongs_to :variant
|
6
|
+
belongs_to :user
|
7
|
+
attr_accessible :id ,
|
8
|
+
:variant_id ,
|
9
|
+
:user_id ,
|
10
|
+
:min_quantity ,
|
11
|
+
:max_quantity ,
|
12
|
+
:current_value
|
13
|
+
|
14
|
+
def quantity_message
|
15
|
+
if self.min_quantity == 0 && self.max_quantity == 0
|
16
|
+
return "You are not allowed to purchase this item."
|
17
|
+
end
|
18
|
+
if self.max_quantity
|
19
|
+
if self.min_quantity && self.min_quantity > 0
|
20
|
+
return "You are allowed to purchase between #{self.min_quantity} and #{self.max_quantity} of this item."
|
21
|
+
else
|
22
|
+
return "You are allowed to purchase up to #{self.max_quantity} of this item."
|
23
|
+
end
|
24
|
+
end
|
25
|
+
if self.min_quantity && self.min_quantity > 0
|
26
|
+
return "You must purchase at least #{self.min_quantity} of this item."
|
27
|
+
end
|
28
|
+
return nil
|
29
|
+
end
|
30
|
+
|
31
|
+
def no_purchases_allowed
|
32
|
+
return self.min_quantity == 0 && self.max_quantity == 0
|
33
|
+
end
|
34
|
+
|
35
|
+
def qty_within_range(qty)
|
36
|
+
return false if self.min_quantity && qty < self.min_quantity
|
37
|
+
return false if self.max_quantity && qty > self.max_quantity
|
38
|
+
return true
|
39
|
+
end
|
40
|
+
|
41
|
+
def qty_too_low(qty)
|
42
|
+
return self.min_quantity && qty < self.min_quantity
|
43
|
+
end
|
44
|
+
|
45
|
+
def qty_too_high(qty)
|
46
|
+
return self.max_quantity && qty > self.max_quantity
|
47
|
+
end
|
48
|
+
|
49
|
+
end
|
50
|
+
end
|
@@ -85,15 +85,15 @@ tr.invoice_totals_header td { border: 0; }
|
|
85
85
|
#invoice_1_instore_pickup_background { border: none; }
|
86
86
|
#invoice_1_instore_pickup { top: 0; width: 30px; height: 30px; }
|
87
87
|
|
88
|
-
.mb_container.first_name { display: block; width:
|
89
|
-
.mb_container.last_name { display: block; width:
|
90
|
-
.mb_container.company { display: block; width: 100% !important; clear:left; } .mb_container.company input { width: 100% !important; border-color: #b9b9b9;
|
91
|
-
.mb_container.address1 { display: block; width: 100% !important; } .mb_container.address1 input { width: 100% !important; border-color: #b9b9b9;
|
92
|
-
.mb_container.address2 { display: block; width: 100% !important; } .mb_container.address2 input { width: 100% !important; border-color: #b9b9b9;
|
93
|
-
.mb_container.city { display: block; width:
|
94
|
-
.mb_container.state { display: block; width:
|
95
|
-
|
96
|
-
.mb_container.zip { display: block; width: 25% !important; }
|
88
|
+
.mb_container.first_name { display: block; width: 49% !important; float: left; margin-right: 2%; } .mb_container.first_name input { width: 100% !important; border-color: #b9b9b9; margin-bottom: 10px; }
|
89
|
+
.mb_container.last_name { display: block; width: 49% !important; } .mb_container.last_name input { width: 100% !important; border-color: #b9b9b9; }
|
90
|
+
.mb_container.company { display: block; width: 100% !important; clear:left; margin-bottom: 10px; } .mb_container.company input { width: 100% !important; border-color: #b9b9b9; }
|
91
|
+
.mb_container.address1 { display: block; width: 100% !important; margin-bottom: 10px; } .mb_container.address1 input { width: 100% !important; border-color: #b9b9b9; }
|
92
|
+
.mb_container.address2 { display: block; width: 100% !important; margin-bottom: 10px; } .mb_container.address2 input { width: 100% !important; border-color: #b9b9b9; }
|
93
|
+
.mb_container.city { display: block; width: 48% !important; float: left; margin-right: 2%; margin-bottom: 10px; } .mb_container.city input { width: 100% !important; border-color: #b9b9b9; }
|
94
|
+
.mb_container.state { display: block; width: 23% !important; float: left; margin-right: 2%; margin-bottom: 10px; } .mb_container.state select { width: 100% !important; border-color: #b9b9b9; border-left: 1px; border-bottom: 1px; border-top: 1px; height: 36px !important; font-size: 1em; }
|
95
|
+
.mb_container.state input { width: 100% !important; border-color: #b9b9b9; }
|
96
|
+
.mb_container.zip { display: block; width: 25% !important; } .mb_container.zip input { width: 100% !important; border-color: #b9b9b9; }
|
97
97
|
|
98
98
|
#gift_cards_container p { float: right; margin-bottom: 0 !important; }
|
99
99
|
#gift_cards_container input[type="text"] { margin-top: 0px !important; margin-right: 10px !important; display: block; float: right; }
|
@@ -1,7 +1,10 @@
|
|
1
|
+
|
2
|
+
<div id="checkout-thanks-wrapper" style="max-width:1000px;margin:0 auto;padding:20px 2%;">
|
1
3
|
<h3>All Finished!</h3>
|
2
4
|
<p>Thank you for your order! Your order has been submitted.</p>
|
3
5
|
<p>Please allow up to 48 hours for your order to be processed. Orders are processed during normal business hours Monday through Friday.</p>
|
4
6
|
|
7
|
+
|
5
8
|
<% if @last_invoice.has_downloadable_items? %>
|
6
9
|
<% sc = Caboose::StoreConfig.where(:site_id => @site.id).last %>
|
7
10
|
<% instr = (sc && !sc.download_instructions.blank?) ? sc.download_instructions : "Your order contained downloadable items. Download your items with the links below:" %>
|
@@ -15,7 +18,10 @@
|
|
15
18
|
</ul>
|
16
19
|
<% end %>
|
17
20
|
|
18
|
-
<
|
21
|
+
<br />
|
22
|
+
<p><a href="/products" class="btn">Continue Shopping</a></p>
|
23
|
+
|
24
|
+
</div>
|
19
25
|
|
20
26
|
|
21
27
|
<%= content_for :caboose_css do %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<!-- <h1>Thank you for your invoice!</h1> -->
|
4
4
|
<h1>New Order Received</h1>
|
5
5
|
|
6
|
-
<h4><a href="
|
6
|
+
<h4><a href="http://<%= @invoice.site.primary_domain.domain %>/admin/invoices/<%= @invoice.id %>" target="_blank" title="View Order">View Order</a></h4>
|
7
7
|
|
8
8
|
<h2>Order Details</h2>
|
9
9
|
|
@@ -2,10 +2,10 @@
|
|
2
2
|
<h1>Products</h1>
|
3
3
|
|
4
4
|
<p style="margin: 12px 0">
|
5
|
-
<a href="/admin/vendors/new">New Vendor</a><span style="margin: 0 3px">|</span>
|
5
|
+
<a href="/admin/store/vendors/new">New Vendor</a><span style="margin: 0 3px">|</span>
|
6
6
|
<a href="/admin/products/sort">Sort Products</a><span style="margin: 0 3px">|</span>
|
7
|
-
<a href="/admin/products/alternate-ids">Alternate IDs</a
|
8
|
-
|
7
|
+
<a href="/admin/products/alternate-ids">Alternate IDs</a><!-- <span style="margin: 0 3px">|</span> -->
|
8
|
+
<!-- <a href='#'>Search Form</a> -->
|
9
9
|
</p>
|
10
10
|
|
11
11
|
<form action="/admin/products" method="get" id="search_form" style="margin: 0 0 12px">
|
@@ -13,11 +13,16 @@ tabs = {
|
|
13
13
|
'Login Logs' => "/admin/login-logs?user_id=#{@edituser.id}",
|
14
14
|
'Password' => "/admin/users/#{@edituser.id}/password",
|
15
15
|
'Roles' => "/admin/users/#{@edituser.id}/roles",
|
16
|
-
'Subscriptions' => "/admin/users/#{@edituser.id}/subscriptions",
|
17
16
|
'Delete' => "/admin/users/#{@edituser.id}/delete"
|
18
17
|
}
|
19
18
|
if @site.use_store
|
20
19
|
arr = tabs.to_a.insert(1, ['Payment Method', "/admin/users/#{@edituser.id}/payment-method"])
|
20
|
+
tabs = Hash[arr]
|
21
|
+
arr = tabs.to_a.insert(5, ['Variant Limits', "/admin/users/#{@edituser.id}/variant-limits#user_id=#{@edituser.id}"])
|
22
|
+
tabs = Hash[arr]
|
23
|
+
end
|
24
|
+
if Caboose::Subscription.where(:site_id => @site.id).exists?
|
25
|
+
arr = tabs.to_a.insert(6, ['Subscriptions', "/admin/users/#{@edituser.id}/subscriptions"])
|
21
26
|
tabs = Hash[arr]
|
22
27
|
end
|
23
28
|
tabs = Caboose.plugin_hook('admin_user_tabs', tabs, @edituser, @site)
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<%= render :partial => 'caboose/users/admin_header' %>
|
2
|
+
|
3
|
+
<div id='variant-limits'></div>
|
4
|
+
|
5
|
+
<%= render :partial => 'caboose/users/admin_footer' %>
|
6
|
+
|
7
|
+
<% content_for :caboose_js do %>
|
8
|
+
<%= javascript_include_tag 'caboose/model/all' %>
|
9
|
+
<script type='text/javascript'>
|
10
|
+
|
11
|
+
$(document).ready(function() {
|
12
|
+
var that = this;
|
13
|
+
var table = new IndexTable({
|
14
|
+
form_authenticity_token: '<%= form_authenticity_token %>',
|
15
|
+
container: 'variant-limits',
|
16
|
+
base_url: '/admin/variant-limits',
|
17
|
+
allow_bulk_edit: false,
|
18
|
+
allow_bulk_delete: false,
|
19
|
+
allow_duplicate: false,
|
20
|
+
allow_advanced_edit: false,
|
21
|
+
allow_import: false,
|
22
|
+
fields: [
|
23
|
+
{ show: true , editable: true, bulk_edit: false, name: 'variant_id' , nice_name: 'Product Variant' , sort: 'variant_id' , type: 'select' , value: function(r) { return r.variant_id }, text: function(r) { return (r.variant ? (r.variant.alternate_id ? r.variant.alternate_id : r.variant.id) : '') }, width: 150, options_url: '/admin/variant-limits/variant-options' },
|
24
|
+
{ show: true , editable: true, bulk_edit: false, name: 'min_quantity' , nice_name: 'Min Qty' , sort: 'min_quantity' , type: 'text' , value: function(r) { return r.min_quantity }, width: 150 },
|
25
|
+
{ show: true , editable: true, bulk_edit: false, name: 'max_quantity' , nice_name: 'Max Qty' , sort: 'max_quantity' , type: 'text' , value: function(r) { return (r.max_quantity == null || r.max_quantity == '' ? 0 : r.max_quantity) }, width: 150 },
|
26
|
+
{ show: true , editable: false, bulk_edit: false, name: 'current_value' , nice_name: 'Purchased' , sort: 'current_value' , type: 'text' , value: function(r) { return (r.current_value ) }, width: 150 }
|
27
|
+
],
|
28
|
+
new_model_text: 'New Variant Limit',
|
29
|
+
new_model_fields: [
|
30
|
+
{ name: 'variant_id', nice_name: 'Product', type: 'select', width: 400, options_url: '/admin/variant-limits/variant-options' },
|
31
|
+
{ name: 'user_id', nice_name: 'User', type: 'hidden', width: 400, value: <%= @edituser.id %> }
|
32
|
+
]
|
33
|
+
});
|
34
|
+
});
|
35
|
+
</script>
|
36
|
+
<% end %>
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.24
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
@@ -828,6 +828,7 @@ files:
|
|
828
828
|
- app/controllers/caboose/subscriptions_controller.rb
|
829
829
|
- app/controllers/caboose/users_controller.rb
|
830
830
|
- app/controllers/caboose/variant_children_controller.rb
|
831
|
+
- app/controllers/caboose/variant_limits_controller.rb
|
831
832
|
- app/controllers/caboose/variants_controller.rb
|
832
833
|
- app/controllers/caboose/vendors_controller.rb
|
833
834
|
- app/helpers/caboose/application_helper.rb
|
@@ -953,6 +954,7 @@ files:
|
|
953
954
|
- app/models/caboose/variant.rb
|
954
955
|
- app/models/caboose/variant_child.rb
|
955
956
|
- app/models/caboose/variant_default.rb
|
957
|
+
- app/models/caboose/variant_limit.rb
|
956
958
|
- app/models/caboose/vendor.rb
|
957
959
|
- app/models/caboose/wish_list.rb
|
958
960
|
- app/models/caboose/wish_list_line_item.rb
|
@@ -1237,6 +1239,7 @@ files:
|
|
1237
1239
|
- app/views/caboose/users/admin_index.html.erb
|
1238
1240
|
- app/views/caboose/users/admin_new.html.erb
|
1239
1241
|
- app/views/caboose/users/admin_update_pic.html.erb
|
1242
|
+
- app/views/caboose/variant_limits/admin_edit.html.erb
|
1240
1243
|
- app/views/caboose/variants/admin_edit.html.erb
|
1241
1244
|
- app/views/caboose/variants/admin_edit_option1_media.html.erb
|
1242
1245
|
- app/views/caboose/variants/admin_edit_option2_media.html.erb
|