op_cart 0.0.12 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b53bcf845fbb66f6499ce3c4379859f668bf0a57
|
4
|
+
data.tar.gz: bc9c5fc2170f6e18c1820eac88e796185d11a13a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2efa883210203ab59244df6053ccb5ff706740806b87e097b0da27870b29febd219f35fdc4f8f615a8c462fecb4176670d9d13f838b877aa1049097f6ef7749e
|
7
|
+
data.tar.gz: c185243268ffb1c4f6ef97d7a9658d2a14889b5f2659851a3ac782ef1454c08b278f8fe7b2302538466656d1b870fbc062962348bd77d0c580d87e505c1e891f
|
@@ -75,10 +75,10 @@
|
|
75
75
|
@updateDisplayedQuantity productId
|
76
76
|
|
77
77
|
updateDisplayedQuantities: ->
|
78
|
-
$('
|
78
|
+
$('[data-product-id]').each -> OpCart.updateDisplayedQuantity $(@).data('product-id')
|
79
79
|
|
80
80
|
updateDisplayedQuantity: (productId) ->
|
81
|
-
$quantity = $ "#line_item_product_#{productId} .quantity
|
81
|
+
$quantity = $ "#line_item_product_#{productId} .quantity"
|
82
82
|
$quantity.html @lineItemQuantity(productId)
|
83
83
|
|
84
84
|
lineItemQuantity: (productId, quantity) ->
|
@@ -67,7 +67,7 @@ module OpCart
|
|
67
67
|
end
|
68
68
|
|
69
69
|
unless signed_in?
|
70
|
-
sign_in User.create name: params[:
|
70
|
+
sign_in User.create name: params[:shipping_address][:full_name],
|
71
71
|
email: params[:user][:email], password: params[:user][:password],
|
72
72
|
password_confirmation: params[:user][:password]
|
73
73
|
end
|
@@ -1,65 +1,80 @@
|
|
1
|
-
-
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
.op-cart_content
|
2
|
+
- if @products.present?
|
3
|
+
.op-cart_new-order
|
4
|
+
.op-cart_purchasable-items
|
5
|
+
h2 Purchasable Items
|
6
|
+
table
|
7
|
+
thead
|
8
|
+
tr
|
9
|
+
th Product Name
|
10
|
+
th Description
|
11
|
+
th Price
|
12
|
+
th
|
13
|
+
tbody
|
14
|
+
- @products.each do |product|
|
15
|
+
tr id="#{dom_id product}" data-product-id=(product.id)
|
16
|
+
td = product.name
|
17
|
+
td = product.description
|
18
|
+
td = number_to_currency product.price / 100
|
19
|
+
td
|
20
|
+
a.op-cart_add href="#" onclick="OpCart.addItemToOrder(#{product.id}, 1); return false" Add to Order
|
12
21
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
.op-cart_items-in-order
|
23
|
+
h2 Items in Order
|
24
|
+
table
|
25
|
+
thead
|
26
|
+
tr
|
27
|
+
th Product Name
|
28
|
+
th Price
|
29
|
+
th Qty
|
30
|
+
th
|
31
|
+
tbody
|
32
|
+
- @products.each do |product|
|
33
|
+
tr id="#{dom_id product, 'line_item'}"
|
34
|
+
td = product.name
|
35
|
+
td = number_to_currency product.price / 100
|
36
|
+
td.quantity 0
|
37
|
+
td
|
38
|
+
a.op-cart_remove href="#" onclick="OpCart.removeItemFromOrder(#{product.id}); return false" Remove
|
24
39
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
40
|
+
= simple_form_for @order, data: { stripe_key: Rails.configuration.stripe[:publishable_key] } do |f|
|
41
|
+
span.payment-errors
|
42
|
+
.op-cart_your-information
|
43
|
+
h2 Your Information
|
44
|
+
- if signed_in?
|
45
|
+
strong Email:
|
46
|
+
span = current_user.email
|
47
|
+
- else
|
48
|
+
= simple_fields_for :user do |fu|
|
49
|
+
= fu.input :email, autofocus: true, input_html: { autocomplete: 'email' }
|
50
|
+
= fu.input :password
|
36
51
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
52
|
+
.op-cart_shipping-address
|
53
|
+
h2 Shipping Address
|
54
|
+
= simple_fields_for :shipping_address do |sa|
|
55
|
+
- focus_name = signed_in? ? true : false
|
56
|
+
= sa.input :full_name, autofocus: focus_name, input_html: { autocomplete: 'name' }
|
57
|
+
= sa.input :street, input_html: { autocomplete: 'street-address' }
|
58
|
+
= sa.input :postal_code, input_html: { autocomplete: 'postal-code' }
|
59
|
+
= sa.input :locality, disabled: true, input_html: { autocomplete: 'city' }
|
60
|
+
= sa.input :region, disabled: true, input_html: { autocomplete: 'state' }
|
46
61
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
62
|
+
.op-cart_card-details
|
63
|
+
h2 Card Details
|
64
|
+
- if f.object.card_token.present?
|
65
|
+
span Card information already provided.
|
66
|
+
- else
|
67
|
+
#card_form_inputs
|
68
|
+
= simple_fields_for :credit_card do |c|
|
69
|
+
= c.input :number, input_html: { autocomplete: 'cc-number' }
|
70
|
+
= c.input :expiry, input_html: { autocomplete: 'cc-exp' }
|
71
|
+
= c.input :cvc, input_html: { autocomplete: 'cc-csc' }
|
57
72
|
|
58
|
-
|
59
|
-
|
60
|
-
|
73
|
+
= simple_fields_for :line_items do |li|
|
74
|
+
= li.input :quantities_json, as: :hidden
|
75
|
+
= f.input :card_token, as: :hidden
|
61
76
|
|
62
|
-
|
63
|
-
|
64
|
-
- else
|
65
|
-
|
77
|
+
.form-actions
|
78
|
+
= f.button :button, "Submit Payment"
|
79
|
+
- else
|
80
|
+
p Add an item to your order to begin.
|
@@ -1,24 +1,25 @@
|
|
1
|
-
.
|
2
|
-
|
3
|
-
|
4
|
-
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
1
|
+
.op-cart_content
|
2
|
+
.op-cart_new-order
|
3
|
+
h2 Items in Order
|
4
|
+
ul.op-cart_items-in-order
|
5
|
+
- @order.line_items.each do |line_item|
|
6
|
+
li id="#{dom_id line_item}"
|
7
|
+
p = line_item.sellable.name
|
8
|
+
p.quantity
|
9
|
+
= line_item.quantity
|
10
|
+
| @
|
11
|
+
= number_to_currency line_item.unit_price / 100
|
12
|
+
| =
|
13
|
+
= number_to_currency line_item.total / 100
|
14
|
+
li
|
15
|
+
p Order Total: #{number_to_currency @order.total / 100}
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
.op-cart_your-information
|
18
|
+
h2 Your Information
|
19
|
+
= @order.user.email
|
20
|
+
.op-cart_shipping-address
|
21
|
+
h2 Shipping Address
|
22
|
+
- sa = @order.shipping_address
|
23
|
+
p = sa.full_name
|
24
|
+
p = sa.street
|
25
|
+
p = "#{sa.locality}, #{sa.region} #{sa.postal_code}"
|
data/lib/op_cart/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: op_cart
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Boehs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|