E-Coupon | 微信小程序:电子优惠券领取 | Frontend Framework library
kandi X-RAY | E-Coupon Summary
kandi X-RAY | E-Coupon Summary
微信小程序:电子优惠券领取(商城、淘宝客)
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Format a Date object
- Format a number
E-Coupon Key Features
E-Coupon Examples and Code Snippets
Community Discussions
Trending Discussions on E-Coupon
QUESTION
I have been going in circles with this I have added an apply coupon field to mini-cart.php and am trying to get it to run without refreshing the whole page. Any suggestions would be amazing help.
functions:
...ANSWER
Answered 2022-Feb-09 at 22:27You can get the new mini cart HTML inside your ajax callback on the server and then return that as a response to the jQuery ajax call then simply replace the whole mini cart HTML on the front-end with the updated HTML.
QUESTION
I used Add the Coupon Code names to Woocommerce View Order details and email notifications to inspire my snippet.
I'm trying to expand the snippet to also include the coupon percentage amount in brackets, if the coupon type is a percentage discount.
This is what it should look like:
Here is my attempt. Any ideas if this is correct:
...ANSWER
Answered 2021-Aug-27 at 11:35Besides the fact that your code contains mistakes, it also contains some outdated code
get_used_coupons()
is deprecated since 3.7.0 - Replaced with better named method to reflect the actual data being returned.$coupon->discount_type
has been replaced with$coupon->get_discount_type()
$coupon->coupon_amount
has been replaced with$coupon->get_amount()
So you get:
QUESTION
I have tried to move the coupon code to the bottom of the checkout page at hook "woocommerce_review_order_before_payment"
with this code:
ANSWER
Answered 2021-Nov-15 at 19:22You can't nest the coupon form inside the checkout form. This will move the coupon form below the checkout form.
QUESTION
I would like to use ACF to store a variable which I then use in a wc_enqueue_js tag. If the variable is available via php as $couponCheck, I need to make it available as an array inside the 'updated_checkout' function. So then when the coupon is submitted it gets checked with the array.
Does that makes sense?
...ANSWER
Answered 2021-May-18 at 18:24You can use PHP json_encode
function to convert PHP array to jQuery object.
Then you can use jQuery.inArray
to check if couponCheck is present in the Javascript object.
QUESTION
Based on Make coupon field mandatory for a product category in WooCommerce answer, I am trying to implement a mandatory coupons for specific products in woocommerce.
Here is my code attempt:
...ANSWER
Answered 2021-Feb-24 at 18:03There are some mistakes in your code, use the following instead:
QUESTION
I would like to change the "[Remove]" link text to an icon for coupons in WooCommerce checkout page.
Instead of "[Remove]" I would like it to be a trash can icon from Font Awesome.
I have found 2 code snippets to change the text:
...ANSWER
Answered 2021-Feb-18 at 18:35For example you can add a Font Awesome Icon using the following, on your 2nd code snippet:
QUESTION
I want to display the remaining number of the coupon on the WooCommerce thankyou page
For example: You used the test coupon 3 times and there are 10 more left.
This is my code:
...ANSWER
Answered 2021-Jan-20 at 09:25Instead of using the cart object, the order object is used on the thankyou page. So we're going to use that object instead
You can use get_usage_limit_per_user() to get coupon usage limit per customer (for a single customer)
OR use get_usage_limit() to get coupon usage limit.
So you get:
QUESTION
I'm using the below function which currently accepts a single (or array of) static coupon codes. How can I change this to work with any valid (i.e. not already used the maximum times etc.) coupon code that exists in the site?
...ANSWER
Answered 2020-Oct-28 at 16:46As wooCommerce already check for coupons validity when they are applied, If they are not valid it displays different warning messages depending on the reason for invalidity, removing invalid applied coupons…
So you don't need to get all valid coupons in your code… You just need the following:
QUESTION
I want to change the remove coupon link in the cart. At the moment it's the word Remove in brackets: [Remove]
.
I found the function wc_cart_totals_coupon_html
in the cart-totals.php
template.
And I also found the link inside that function.
ANSWER
Answered 2020-Jul-26 at 12:37Try with static url link as per your need.
Create code as per the WooCommerce standard.
QUESTION
I want to hide the coupon field in the cart.
To do so, I've wrapped it in a Bootstrap collapse element and added display:none
to the existing coupon field.
EDIT: After the comment from @gael (WooCommerce: Coupon doens't work in cart if I wrap it in collapse element), I figuered out, that the form works if I show it in other places of the template. But now it doesn't show any success or error messages anymore?!
Here's my code:
...ANSWER
Answered 2020-Apr-15 at 07:54I would override the Cart page on WooCommerce to wrap the Coupon in a collapse element.
This template can be overridden by copying the file from wp-content/plugins/woocommerce/templates/cart/cart.php
it to wp-content/themes/yourtheme/woocommerce/cart/cart.php
.
Then from line 142 to 150 in WooCommerce v4, you can insert your snippet like so:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install E-Coupon
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page