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

Add price per item to Quick Order List #2792

Merged
merged 8 commits into from
Jul 7, 2023

Conversation

sofiamatulis
Copy link
Contributor

@sofiamatulis sofiamatulis commented Jul 7, 2023

PR Summary:

Add variant list price change to the variant List section when there is volume pricing

Approach

I am re-using the price per item from Vol Pricing. I had to make some changes to ensure it works for variant list

Demo links

Editor

@sofiamatulis sofiamatulis changed the title Variantlist price Add price per item to Quick Order List Jul 7, 2023
@@ -299,3 +364,17 @@
{% # theme-check-enable %}
</td>
</tr>

<volume-pricing class="hidden" id="Volume-{{ variant.id }}">
Copy link
Contributor Author

@sofiamatulis sofiamatulis Jul 7, 2023

Choose a reason for hiding this comment

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

To get the volume pricing, I had to create a hidden volume pricing element to access it and make it hidden

But maybe we can look into an API later

{%- liquid
assign volume_pricing_array = variant.quantity_price_breaks | sort: 'price'
-%}
<price-per-item
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thoughts on making this a snippet?

Copy link
Contributor

Choose a reason for hiding this comment

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

Eventually we will do it but maybe in a quieter time?

@sofiamatulis sofiamatulis requested a review from KaichenWang July 7, 2023 17:36
Copy link
Contributor

@KaichenWang KaichenWang left a comment

Choose a reason for hiding this comment

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

I'm still testing, but noticed this so far.

Also, we should probably rebase and fix the conflict.

@sofiamatulis sofiamatulis requested a review from KaichenWang July 7, 2023 19:07
@sofiamatulis sofiamatulis force-pushed the variantlist-price branch 2 times, most recently from fe762a3 to b909e43 Compare July 7, 2023 20:02
Copy link
Contributor

@eugenekasimov eugenekasimov left a comment

Choose a reason for hiding this comment

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

Works good.

@KaichenWang
Copy link
Contributor

Don't think this was introduced in this PR, but adding to cart and then adjusting quantity in Quick order list causes an error. I checked and it seems on cart update, the HTML in the DOM for Quick order errors is replaced with the same element, but with an incorrect id. Quickest fix was just to move the element in Liquid - #2798

screencast.2023-07-07.17-20-11.mp4

* Add variant list price

* Fix price logic

* Change min to step after rebase

* Update assets/variant-list.js

Co-authored-by: Kai <KaichenWang@users.noreply.github.com>

* Update assets/component-volume-pricing.css

Co-authored-by: Kai <KaichenWang@users.noreply.github.com>

* Update assets/price-per-item.js

Co-authored-by: Kai <KaichenWang@users.noreply.github.com>

* Add missing part after rebase

---------

Co-authored-by: Sofia Matulis <sofia.matulis@shopify.com>
Co-authored-by: Kai <KaichenWang@users.noreply.github.com>
@sofiamatulis sofiamatulis merged commit 1156f8a into variantlist-volpricing Jul 7, 2023
@sofiamatulis sofiamatulis deleted the variantlist-price branch July 7, 2023 21:34
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.

3 participants