-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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 Prices tab to Products overview #1117
Conversation
expect(page).to have_content(master_price.money.to_s) | ||
expect(page).to have_content(master_price.currency) | ||
expect(page).to have_content(other_price.money.to_s) | ||
expect(page).to have_content(other_price.currency) |
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.
Can you please set expectations on the actual value (e.g. 'USD') instead?
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.
Sure, will do.
@gmacdougall incorporated your feedback, and added pagination. |
<% end %> | ||
<% if can?(:destroy, price) %> | ||
| ||
<%#= link_to_delete(price, :no_text => true) unless price.deleted? %> |
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.
Is this intentional to disable the delete link here?
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.
Yes it is - there's no route for deletion yet. I should add that I guess 🐑 .
👍 tried this out. More work is needed, but I think it's good enough to merge. We can then collaborate on making it better. Future steps:
|
I also think, this is good enough. How to we ensure to not lose track on the follow up tasks? Maybe a "pricing todo" issue? |
Thanks John. |
#1169 should fix the validation issue. I've amended this PR to use a |
We have great functionality for dealing with multiple prices for each variant. This is an absolutely basic interface so that as a store admin, it's possible to edit and update prices. I'm unsure about allowing deletion and have left it out for now: When you delete a price, you might end up with no price that has `is_default` set, which will then make the variant in question become "unavailable". As a new price gets the `is_default` boolean anyways, the old one becomes so meaningless it's as if it was deleted. There are plans for a much better interface, but I need something simple that works for 1.3 to get out the door.
This defaults to ten prices per page. We can add a config option for this later.
This prevents invalid currencies from being entered. Unfortunately, translating the currencies' name carries loading lots and lots of CLDR data, so the string presenting individual currencies in the select box doesn't pass through `I18n`.
We want to minimize the amount of logic in views, and there is a method that basically does this.
The table works just as well or better without us telling the browser how exactly to render it.
Thanks as always Martin |
We have great functionality for dealing with multiple prices for each variant. This is an
absolutely basic interface so that as a store admin, it's possible to edit and update prices.
I'm unsure about allowing deletion and have left it out for now: When you delete a price,
you might end up with no price that has
is_default
set, which will then make the variantin question become "unavailable". As a new price gets the
is_default
boolean anyways, the oldone becomes so meaningless it's as if it was deleted.
There are plans for a much better interface, but I need something simple that works for 1.3
to get out the door.