Skip to content
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

Show unit price in checkout process (both cart page and cart sidebar) #6905

Merged

Conversation

jibees
Copy link
Contributor

@jibees jibees commented Feb 17, 2021

What? Why?

Closes #6498
This issue display fake unit price in the checkout process, both cart sidebar and /cart page.

What should we test?

  1. Fill up your cart with some products from a shopfront
  2. Click on the top-right cart icon. The sidebar should show each line item's unit price.
  3. The shopping cart page /cart should display the item's unit price.

Screenshots

Shopping cart

Capture d’écran 2021-02-16 à 23 26 01

Sidebar cart

Capture d’écran 2021-02-16 à 22 46 50

Release notes

Display unit price on checkout process

Changelog Category: User facing changes

@jibees jibees force-pushed the 6498-show-unit-price-in-checkout branch from 037e9d6 to 5ac00de Compare February 17, 2021 13:44
@@ -219,6 +219,12 @@ def unit_value
final_weight_volume / quantity
end

def unit_price_price_and_unit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't it be unit_price_and_unit? I also think we should document why this is random. No other dev will understand.

Copy link
Contributor Author

@jibees jibees Feb 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I havent' spend to much time on it since @andrewpbrett will re-do this part.
I wanted to create a structure like:

def unit_price 
  price = # ... whateever
  unit = # ... whatever
  return {
    price: price, 
    unit: unit
  }
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well, we can live with it until he works on it 👍

"question-mark-with-tooltip-animation" => true,
context: "'cart-sidebar'"}
.options-text
{{ line_item.variant.unit_price_price | localizeCurrency }} / {{ line_item.variant.unit_price_unit }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed that unit_price_price. I think it should be changed to unit_price as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I commented here #6905 (comment) I wanted to have such thing like : unit_price.price and unit_price.unit.

 - .total-price element must be a div (display: block) to be text right aligned (and not being float: right)
 - use .option-text to display a grey text
 - use display: flex to display question mark icon and text information
 - This behavior permit use to create custom CSS specifications to display this tooltip best fitted to the context.
 - Use a new class to specify css customization
 - Add to `line_item.rb` a fake method: `unit_price_price_and_unit` @andrewpbrett will change it with real values.
 - Add a new variable: $text-xs to specify small font-size


squash "Display unit price on /cart page"
@jibees jibees force-pushed the 6498-show-unit-price-in-checkout branch from 5ac00de to dd0ef0d Compare February 18, 2021 14:05
Copy link
Contributor

@sauloperez sauloperez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked it locally and it's working great. What I'm missing is some testing, even at view level so can confidently know we're showing the right unit price and hiding it when no toggled. I can help you with that.

@filipefurtad0 filipefurtad0 self-assigned this Feb 24, 2021
@filipefurtad0 filipefurtad0 added the pr-staged-fr staging.coopcircuits.fr label Feb 24, 2021
@filipefurtad0
Copy link
Contributor

Hey @jibees ,

Nice, unit prices are now showing up in the cart side bar as well, on desktop:

image

And mobile iPhone 12:

image

Agree with @sauloperez , it's a good idea to add a simple feature test here 👍 Created this tech-debt issue.

Moving to ready to go.

@filipefurtad0 filipefurtad0 removed the pr-staged-fr staging.coopcircuits.fr label Feb 24, 2021
@sauloperez
Copy link
Contributor

Agree. We can work on it separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display unit price on cart page
3 participants