* VRFS-3094 - update style and minor issues in shopping cart screen

This commit is contained in:
Seth Call 2015-04-27 15:42:38 -05:00
parent 907e2a4552
commit 1bd054d050
7 changed files with 96 additions and 46 deletions

View File

@ -117,7 +117,7 @@ module JamAdmin
config.email_smtp_domain = 'www.jamkazam.com'
config.email_smtp_authentication = :plain
config.email_smtp_user_name = 'jamkazam'
config.email_smtp_password = 'jamjamblueberryjam'
config.email_smtp_password = 'snorkeltoesniffyfarce1'
config.email_smtp_starttls_auto = true
config.facebook_app_id = ENV['FACEBOOK_APP_ID'] || '468555793186398'

View File

@ -11,7 +11,7 @@ module JamRuby
end
def shopping_carts
ShoppingCart.where(anonymous_user_id: @id)
ShoppingCart.where(anonymous_user_id: @id).order('created_at DESC')
end
def destroy_all_shopping_carts

View File

@ -25,7 +25,7 @@ module JamRuby
def product_info
product = self.cart_product
{name: product.name, price: product.price, product_id: cart_id, plan_code: product.plan_code, real_price: real_price(product), total_price: total_price(product), quantity: quantity, marked_for_redeem: marked_for_redeem, free: free?} unless product.nil?
{name: product.name, price: product.price, product_id: cart_id, plan_code: product.plan_code, real_price: real_price(product), total_price: total_price(product), quantity: quantity, marked_for_redeem: marked_for_redeem, free: free?, sales_region: product.sales_region} unless product.nil?
end
# multiply quantity by price

View File

@ -75,13 +75,24 @@
function renderShoppingCarts(carts) {
var data = {};
var latest_cart = carts[carts.length - 1];
if(carts.length > 0) {
var latest_cart = carts[0];
}
var $latestCartHtml = "";
var any_in_us = false
context._.each(carts, function(cart) {
if(cart.product_info.sales_region == 'United States') {
any_in_us = true
}
})
if (latest_cart) {
latest_cart.any_in_us = any_in_us
$latestCartHtml = $(
context._.template(
$('#template-shopping-cart-header').html(),

View File

@ -8,7 +8,7 @@
}
.checkout-image {
width: 10%;
margin-right:20px;
float: left;
}
@ -20,7 +20,7 @@
margin-bottom: 7px;
}
div#note {
.note {
font-style: italic;
font-size: 13px;
}
@ -35,22 +35,43 @@
}
.cart-item-price {
text-align: right;
text-align: right;
width:120px;
}
.cart-item-quantity {
text-align: right;
text-align: left;
width:150px;
}
.cart-item-actions {
//text-align: center;
}
.cart-item-price {
padding-right:11px;
}
th.cart-item-quantity {
padding-left:15px;
}
.remove-cart {
color:#fc0;
float:right;
margin-right:20px;
}
.cart-value {
margin-left:63px;
}
.cart-items {
width: 100%;
min-height: 200px;
width: 80%;
// overflow: auto;
margin-top: 30px;
margin-bottom:20px;
}
.cart-item {
@ -58,12 +79,17 @@
}
.shopping-sub-total {
width: 65%;
float: left;
text-align: right;
margin: 10px 0 20px;
font-weight: bold;
font-size: 17px;
margin-top:30px;
.sub-total-text {
color:white;
float:left;
margin-left:10px;
}
.sub-total-value {
color:white;
}
}
.no-cart-items {
@ -73,5 +99,13 @@
font-weight: bold;
font-size: 15px;
}
.actions {
margin-right:20%;
}
.proceed-checkout {
margin-right:2px;
}
}
}

View File

@ -15,41 +15,46 @@
1 item added to shopping cart
%div
{{data.cart_type}}: {{data.product_info.name}}
#note
= "{% if (data.any_in_us) { %}"
.note
Note: You must be in the United States to purchase this {{data.type}} due to licensing constraints.
= "{% } %}"
.clearall
%script{type: 'text/template', id: 'template-shopping-cart-body'}
%table.cart-items
%tr
%th.cart-item-caption
YOUR SHOPPING CART NOW CONTAINS:
%th.cart-item-price
Price
%th.cart-item-quantity
Quantity
%th
= "{% if (data.carts.length == 0) { %}"
%tr
%td.no-cart-items colspan=4 Nothing in cart
= "{% } %}"
%thead
%tr
%th.cart-item-caption
YOUR SHOPPING CART NOW CONTAINS
%th.cart-item-price
PRICE
%th.cart-item-quantity
QUANTITY
%tbody
= "{% if (data.carts.length == 0) { %}"
%tr
%td.no-cart-items colspan=4 Nothing in cart
= "{% } %}"
= "{% _.each(data.carts, function(cart) { %}"
%tr.cart-item{"cart-id" => "{{cart.id}}"}
%td.cart-item-caption
{{cart.cart_type}}: {{cart.product_info.name}}
%td.cart-item-price
$ {{Number(cart.product_info.real_price).toFixed(2)}}
%td.cart-item-quantity
{{cart.quantity}}
%td.cart-item-actions
%a.button-grey.remove-cart{href: "#", "cart-id" => "{{cart.id}}"}
DELETE
= "{% }); %}"
.shopping-sub-total
Subtotal: $ {{data.sub_total.toFixed(2)}}
= "{% _.each(data.carts, function(cart, index) { %}"
%tr.cart-item{"cart-id" => "{{cart.id}}"}
%td.cart-item-caption
{{cart.cart_type}}: {{cart.product_info.name}}
%td.cart-item-price
$ {{Number(cart.product_info.real_price).toFixed(2)}}
= "{% if(index == data.carts.length - 1) { %}"
.shopping-sub-total
%span.sub-total-text Subtotal:
%span.sub-total-value $ {{data.sub_total.toFixed(2)}}
= "{% } %}"
%td.cart-item-quantity
%span.cart-value {{cart.quantity}}
%a.remove-cart{href: "#", "cart-id" => "{{cart.id}}"} delete
= "{% }); %}"
.clearall
.right
.right.actions
%a.button-grey{href: "#"} HELP
%a.button-orange{href: "/client#/jamtrackBrowse"} CONTINUE SHOPPING
%a.button-orange.proceed-checkout{href: "#"} PROCEED TO CHECKOUT

View File

@ -229,7 +229,7 @@ if defined?(Bundler)
config.email_smtp_domain = 'www.jamkazam.com'
config.email_smtp_authentication = :plain
config.email_smtp_user_name = 'jamkazam'
config.email_smtp_password = 'jamjamblueberryjam'
config.email_smtp_password = 'snorkeltoesniffyfarce1'
config.email_smtp_starttls_auto = true
config.facebook_app_id = ENV['FACEBOOK_APP_ID'] || '468555793186398'