-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature/134-cart-layout Cart layout #134 #270
Open
Puneetsehgal
wants to merge
3
commits into
dev
Choose a base branch
from
feature/134-cart-layout
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,83 @@ | ||
<ul> | ||
{{#each cartItems}} | ||
<li>{{product_name}}</li> | ||
{{/each}} | ||
</ul> | ||
<div class="cart-items" data-template="cart-items"> | ||
<h2 class="heading heading--section">Items in Cart</h2> | ||
<ul class="cart-items__item-list"> | ||
{{#each cartItems}} | ||
<li class="cart-items__item" data-cart-id="{{cart_id}}"> | ||
<a class="cart-items__item-link" href="../pdp/index.html?product_id={{product_id}}" aria-label="Shirt Malo. | ||
Size: Medium, Color: blue, quantity: {{quantity}}, Item unit price: ${{price_sale}}, Item total price: ${{total_price}}"> | ||
<img class="cart-items__image" alt="" src="{{../rootPath}}/{{thumbnail_url}}"> | ||
<div class="cart-items__description"> | ||
<p class="cart-items__item-title">{{product_name}}</p> | ||
<dl class="cart-items__details"> | ||
<div class="cart-items__detail"> | ||
<dt>Price</dt> | ||
<dd class="detail__price">${{price_sale}}</dd> | ||
</div> | ||
<div class="cart-items__detail"> | ||
<dt>Color</dt> | ||
<dd>{{color}}</dd> | ||
</div> | ||
<div class="cart-items__detail"> | ||
<dt>Size</dt> | ||
<dd>{{size}}</dd> | ||
</div> | ||
</dl> | ||
<dl class="cart-items__details"> | ||
<div class="cart-items__detail cart-items__column"> | ||
<dt>Quantity</dt> | ||
<dd> | ||
<span class="quantity-comp"> | ||
<button class="quantity-comp__decrease btn btn--black-inverted btn--icon" type="button" data-event-cart-id="{{cart_id}}"> | ||
<span class="sr-only">Decrease quantity</span> | ||
<svg class="icon icon--ruler"> | ||
<use xlink:href="../sprite.svg#remove"></use> | ||
</svg> | ||
</button> | ||
<!-- <label for="quantity">Qty:</label> --> | ||
<input type="test" aria-label="quantity" value="{{quantity}}" class="quantity-comp__text" name="quantity" | ||
id="quantity" data-js="quantity" data-event-cart-id="{{cart_id}}"> | ||
<span aria-live="assertive" aria-atomic="true" class="element-invisible quantity-comp__aria">Quantity is | ||
now | ||
<span> {{quantity}} </span></span> | ||
<button class="quantity-comp__increase btn btn--black-inverted btn--icon" type="button" data-event-cart-id="{{cart_id}}"> | ||
<span class="sr-only">Increase quantity</span> | ||
<svg class="icon icon--ruler"> | ||
<use xlink:href="../sprite.svg#add"></use> | ||
</svg> | ||
</button> | ||
</span> | ||
</dd> | ||
</div> | ||
</dl> | ||
<dl class="cart-items__details"> | ||
<div class="cart-items__detail cart-items__column"> | ||
<dt>Item Total</dt> | ||
<dd class="detail__price">${{total_price}}</dd> | ||
</div> | ||
</dl> | ||
</div> | ||
</a> | ||
<div class="cart-items__controls"> | ||
<button class="cart-items__control btn--link" data-remove="{{cart_id}}"> | ||
<svg class="icon mini-cart__control-icon"> | ||
<use xlink:href="{{../rootPath}}/sprite.svg#trash"></use> | ||
</svg> | ||
Remove <span class="sr-only">item</span> | ||
</button> | ||
<a class="cart-items__control btn--link" href="../pdp/index.html?product_id={{product_id}}"> | ||
<svg class="icon mini-cart__control-icon"> | ||
<use xlink:href="{{../rootPath}}/sprite.svg#edit"></use> | ||
</svg> | ||
Edit <span class="sr-only">item</span> | ||
</a> | ||
<button class="cart-items__control btn--link" data-modal-show="construction-modal"> | ||
<svg class="icon mini-cart__control-icon icon--heart-outline"> | ||
<use xlink:href="{{../rootPath}}/sprite.svg#heart"></use> | ||
</svg> | ||
Save <span class="sr-only">to wish list</span> | ||
</button> | ||
</div> | ||
</li> | ||
{{/each}} | ||
</ul> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<div class="cart-moneybox" data-template="cart-moneybox"> | ||
<h2 class="heading heading--section">Cost of Cart</h2> | ||
<div class="cart-moneybox__summary-subtotal--header"> | ||
<p class="cart-moneybox__subtotal-title">Subtotal</p> | ||
<p class="cart-moneybox__subtotal">${{cartSubtotal}}</p> | ||
</div> | ||
<div class="cart-moneybox__summary-subtotal"> | ||
<p class="cart-moneybox__subtotal-title">Shipping estimate</p> | ||
<p class="cart-moneybox__subtotal">Free</p> | ||
</div> | ||
<div class="cart-moneybox__summary-subtotal"> | ||
<p class="cart-moneybox__subtotal-title">Taxes estimate</p> | ||
<p class="cart-moneybox__subtotal">$0.00</p> | ||
</div> | ||
<hr class="divider"> | ||
<div class="cart-moneybox__summary-subtotal"> | ||
<p class="cart-moneybox__subtotal-title">Estimated Total</p> | ||
<p class="cart-moneybox__subtotal">${{cartSubtotal}}</p> | ||
</div> | ||
<div class="cart-moneybox__summary-controls"> | ||
<a href="../plp/index.html" class="cart-moneybox__cta-btn btn btn--outline-black">Continue Shopping</a> | ||
<a href="../checkout/index.html" class="cart-moneybox__cta-btn cart-moneybox__checkout btn btn--primary">Pay Securely Now</a> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
import { getCartFromStorage } from '../../components/cart/cart'; | ||
import cartItemsTemplate from './cart-items.hbs'; | ||
import { getCartFromStorage, loadCart} from '../../components/cart/cart'; | ||
|
||
(function cartPage() { | ||
const cartData = getCartFromStorage(); | ||
const cartItemsEl = document.querySelector('[data-template="cart-items"]'); | ||
cartItemsEl.outerHTML = cartItemsTemplate(cartData); | ||
})(); | ||
// load card data on page load | ||
loadCart(cartData); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<h1 class="template-heading">Your Cart</h1> | ||
<p class="cart__total-quantity">You have {{cartItemCount}} {{cartItemsLabel}} in your cart. Estimated total is ${{cartSubtotal}}.</p> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per BEM, should this be
.cart-items__heading
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are other places it was used like this so I just copied and pasted
like in
cart-moneyBox.hbs
product-sort.hbs
product-filter.hbs
Do you still want me to changes?
if yes
is this ok?