forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move checkout coupon code section into summary
This commit moves the coupon code application section of checkout into the summary box, still visible in payment step only. It also wraps the coupon code input + button into a real form so it still works if, for some reason, JS is not working, falling back to submitting a simple order form for now.
- Loading branch information
Showing
8 changed files
with
53 additions
and
19 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
frontend/app/assets/javascripts/spree/frontend/checkout/coupon-code.js
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="coupon-code" data-hook='coupon_code'> | ||
<%= form_for order, url: update_checkout_path(order.state) do |form| %> | ||
<%= form.label :coupon_code %> | ||
<%= form.text_field :coupon_code, placeholder: :coupon_code %> | ||
|
||
<button type="submit" class="button coupon-code-apply-button" id="coupon-code-apply-button"> | ||
<%= t('spree.apply_code') %> | ||
</button> | ||
<% end %> | ||
|
||
<div id='coupon_status'></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
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 |
---|---|---|
|
@@ -70,3 +70,7 @@ | |
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<% if order.state == 'payment' %> | ||
<%= render 'coupon_code', order: order %> | ||
<% end %> |
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