手动折扣输入在Shopify购物车页面上不起作用
I need a coupon code input on my cart page but it doesn't seem to work in its plain form:
<input type="hidden" name="discount" value="{{ settings.modal_promo_code }}" >
I have it right before the submit button, inside the form.
现场优惠券没有应用于结帐页面上的订单。
我还需要做其他事情才能工作吗?
Edit: The form looks like this —
<form action="/cart" method="post" class="cart">
<input type="hidden" name="discount" value="{{ settings.modal_promo_code }}" >
And it redirects to a URL like this:
https://store.com/4934605xxxx/checkouts/04d6478feeb9d3262fbea5571b682ebc?_ga=2.260083023.358228188.1608464294-110675315.1604953057
it seems there is a不允许折扣应用于URL的冲突或通过?_GA = 2.260083023.358228188.1608464294-110675315.1604953057
正在应用。
对此有什么想法吗?我如何才能这样工作: https://store.com/4934605xxxx/checkouts/04d6478feeb9d3262fbea5571b682ebc?_ga=2.260083023.358228188.1608464294-110675315.1604953057&discount=TBSRWDVS
thank you
I need a coupon code input on my cart page but it doesn't seem to work in its plain form:
<input type="hidden" name="discount" value="{{ settings.modal_promo_code }}" >
I have it right before the submit button, inside the form.
Live coupons are not being applied to the order on the checkout page.
Is there anything else I need to do for it to work?
Edit: The form looks like this —
<form action="/cart" method="post" class="cart">
<input type="hidden" name="discount" value="{{ settings.modal_promo_code }}" >
And it redirects to a URL like this:
https://store.com/4934605xxxx/checkouts/04d6478feeb9d3262fbea5571b682ebc?_ga=2.260083023.358228188.1608464294-110675315.1604953057
it seems there is a conflict that doesn't let the discount apply to the URL or get removed by ?_ga=2.260083023.358228188.1608464294-110675315.1604953057
because when disabling the JS in the chrome setting and submitting the checkout again it works and the discount is getting applied.
any thoughts on this? how can I get this working like this:https://store.com/4934605xxxx/checkouts/04d6478feeb9d3262fbea5571b682ebc?_ga=2.260083023.358228188.1608464294-110675315.1604953057&discount=TBSRWDVS
thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只要您的购物车不利用Ajax来升级和转移这一点。
结帐页面确认对“ rebate =”的争论,其中包括一个 name =“ discount” 的字段,将包括对结帐的争论。
如果您专门产生标准形状,则可以像它一样起作用。 (如果您对购物车进行大修,则将不存在现场折扣内容,并且希望再次重新输入))如果您必须大修形状带有Ajax的购物车或将其作为饼干放出。
因此,您的代码应该正常工作,我在Dev商店中进行了两次检查,并且没有问题,因为存在Get争夺,它将回扣适用于结帐页面。
PS:这不包括对购物车问题的折扣,这是允许结帐转移纳入“竞争者”的允许的。因此,通常可以与
Checkout
As long as your cart isn't utilizing AJAX to upgrade and divert this ought to work.
The checkout page acknowledges a get contention of ?rebate= and including a field with a name="discount" will include that contention to the checkout.
This works as it were in the event that you yield the standard shape specifically. (in the event that you overhaul the cart, the field rebate content will not be present and you wish to re-enter it again) If you must overhaul the shape you may get to keep the markdown code in a few ways, through overhauling the cart with ajax or putting away it as a cookie.
So your code ought to be working, I twofold-checked it on my dev store and there are no issues, it applies a rebate to the checkout page since the get contention is present.
PS: This does not include a rebate to the cart question, it is as it permitted for the checkout divert to incorporate a get contention, nothing else. So usually comparable to making an interface with
Checkout
回答较晚,但想回答您的问题并为此分享解决方案。
首先,不,您不能按照您的描述方式应用折扣代码,这是可能的,可行的,但比将输入字段贴在表单上要复杂一些。
没有为此的OOTB Shopify解决方案,但是有一些无证件的API端点可以用于创建此功能。
查看 shopify discify discounter web组件,它支持:
样式定制,希望这会有所帮助。
A late response, but want to answer your questions and share a solution for this.
First off no you cannot apply a discount code to cart the way you discribed, it is possible and doable but a bit more complicated than ading an input field to a form.
There is no OOTB Shopify solution for this, but there is some undocumented API endpoints that can be used to create this feature.
Check out Shopify Discounter Web Component, it supports:
Hope this helps.
在Shopify中,如果您使用的是Dawn主题,则可以删除if语句以始终出现折扣字段。
要执行此操作,请访问您的主车是liquid部分文件,并查找下面的代码块:
只需删除包装if语句和最终代码,就应该看起来像这样:
In Shopify, if you are using the Dawn theme, you can just remove an if statement to have the discount field appear at all times.
To do this go to your main-cart-footer.liquid section file and look for the block of code below:
Just remove the wrapping if statement and your final code should look like this: