Woocommerce: getting customer e-mail when hooking into 'applied coupon' action - wordpress

I found there is an action called woocommerce_applied_coupon that passes the coupon code down to the hook you write.
But, my use-case is this: I want to update a tag on the mailchimp-subscriber information on certain coupons being used. That way, we prevent sending e-mails reminding customers about the coupon if they already used it.
Is there a way to get the customer information when hooking into the woocommerce_applied_coupon action so I know which contact to update?

Related

Trigger email action after updating custom post types in wordpress

I have a CPT programs where details (title, date, time, instructor etc. field) about the program are added. There's also a custom filed status which indicates if the program is active or not. By default it is set to active whenever a new program is added. Below the program details page I have a registration button which triggers a registration form. With wpmail + wpforms plugin, after the submission of form I'm sending form data to both user and admin.
But now I have to send email to the registered users whenever a program gets cancelled or status is changed. In my case the CPT and registration form where the user puts his email are both separate.
So how do I accomplish this? I know I can use some event manager plugin but in my case all of those events fields are already covered by ACF. So is there any way to do this within CPT or other options?

WooCommerce updating the shipping method depending on the shipping choice field changes

In my online store, there are sevral shipping methods. I added a plugin for distance delivery (Boxtal Connect)
I would like to be able to autorefresh total amount when a new shipping method is chose on the checkout page.
I think the selector is name=shipping_method[0] and the trigger is jQuery('body').trigger('update_checkout',
I would like to find an code to add on my child function.php to do it.
In fact it works well on the cart page and I think it is a native woocommerce function.
Thanks for you help

Generate Email Coupon Wordpress

This might be off topic question but I would like to ask it anyway to the developers out there.
Is there a plugin or whatever, that can enable automatic single use coupon code delivery to a user on wordpress/page?
Basically WordPress will send an email to the customer and then the user takes an action (clicks button, clicks link from email), and can see a unique, single use, coupon code back to the wordpress site? Each user of course would see a unique coupon code because there would need to have been a list of unique coupon codes selected/uploaded to begin with.
Thanks for your kind answers if there is any. Please.
I am not sure if this is what you are looking for:
YITH WOOCOMMERCE COUPON EMAIL SYSTEM

Save custom post fields value before Woocommerce email send

I have an issue regarding emails sent by Woocommerce.
I have multiple custom fields, set up using the ACF plugin, for Wooocomerce orders. These fields contain additional info that should be visible in the emails sent to the user.
But for some reason I can't get them to save before the email is send and thus the email is empty of those values. Only after I click resend email are the values visible.
I tried prioritizing the action hooks using the Prioritize Hooks plugin but to no avail. Tried multiple things in order to prioritize.
I have the Woocommerce emails set up in the template that I use and get retrieve the custom fields like this:
$fields = get_field('fields', $customer_order->ID);
How can I get this to work properly? Any help is appreciated.
you need to store your data before send the email, so you need to find the correct hook.
If i'm not wrong the before_woocommerce_pay hook is your answer check here for more woocommerce hooks

Form posting - postback then post, (Paypal) is this possible?

I need to submit my cart to paypal in a <form />, (using the web payments standard option).
Rather than draw the contents of this form to the page, and have the 'place order' button post directly to paypal.com, is it possible to have the 'place order' button post back to me, for me to then post the cart, and redirect the user to the correct location?
If not the only option i could see would be to post the cart to paypal myself, retrieve some unique id, and then redirect the user to a page with this unique id, however i dont think 'web payments standard' supports this.
Paypal uses whats called IPN (Instant Payment Notification). You should have all your customer's data saved with some kind of identifier. Post your form to paypal including the identifier. They will post the results back to a page you have designated. This will allow you to match the results they are sending you with your saved data via your identifier so you can now process the order.
Copy Paste Code Sample:
http://forums.asp.net/t/92314.aspx

Resources