My action was wrong in the ajax request
jQuery(document).ready(function () {
jQuery(".redeem_gift_card").click(function (e) {
e.preventDefault();
jQuery.ajax({
type: "post",
dataType: "json",
url: myAjax.ajaxurl,
data: { action: "gift_card_redeem" }, // not redeem_gift_card
success: function (response) {
if (response.type == "success") {
jQuery("#test").html(response.type);
} else {
alert("something broke");
}
},
});
});
});
Related Posts:
- get all products of one category
- Show special field when correct shipping is chosen
- Woocommerce checkout update totals with datepicker
- “add to cart” links css class “ajax_add_to_cart” doesn’t show in woocommerce in widget sidebar
- Trigger a JavaScript function based on the data fetched from Woo commerce hook
- Return custom product in ajax call loop
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- Build path for a custom portfolio plugin
- WooCommerce get Shipping Class of product from either the product id or the order after order is completed
- Using AJAX in a plugin to submit form – REALLY confused
- Adding callback function for wp_ajax_ has no effect
- Get returned variable from a function to add_shortcode function
- Woocommerce add custom button to backend order table
- How do I hook a custom discount to change a WC_Order price total on WooCommerce?
- WP_LOCALIZE_SCRIPT doesn’t work
- Admin-ajax.php appending a status code to ajax response
- Print value of an array or variable in a payment plugin
- Cannot search post by taxonomy
- How to update total price of completed order in woocommerce? [closed]
- WordPress Ajax callback function from plugin – OOP
- $wpdb -> Batch insert from XML File?
- WP AJAX is not working, always returns 0
- Frontend Ajax call not working using wp_ajax, wp_enqueue_script and wp_localize_script
- Fetching the value of forms in WordPress AJAX
- How do I add custom column to woocommerce cart?
- WooCommerce Conditional Tag inside plugin
- Custom attribute type not displaying terms in edit product – WooCommerce
- update woocommere total value on checkout based on selected payment method
- how to add custom functionality after woocommerce place order button
- Adding a brand column to WooCommerce Products
- How can I rewrite a URL to pass requests to a custom method via AJAX? (I can’t use admin-ajax.php)
- How to localize admin.php only once
- PHP – Extend WordPress Woocommerce Revenue Analytics with custom field
- “import declarations may only appear at top level of a module” when importing WooCommerce API node module
- Woocommerce extend tax report with custom column
- How to get Metabox custom field to show checked if value is updated using post meta query?
- Create custom HTML/JS app inside page
- Use just a shortcode from another page
- Update Data parameter of a wp_localize_script() call
- jquery & ajax sending data to php
- wp_localize_script is not adding a global variable for javascript
- Can’t get AJAX call working in custom plugin
- 400 Bad Request, in wordpress theme development, wp_ajax
- ajax recursive calls on wordpress returning answers outsite the function scope
- Are there any security risks when submitting data-attribute data through AJAX?
- How to get error object returned by wp_create_user
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Data not insert and update through ajax and jQuery in admin page?
- Can woocommerse be used dynamically for billing from another plugin for payment processing?
- WP ajax requests not stacking?
- WooCommerce Endpoints content
- How to call code when adding WooCommerce menu items via woocommerce_account_menu_items
- AJAX button with success callback. (Titan Framework)
- ajax working when function is on child theme but not in plugin page
- Custom Plugin Options Won’t Update
- AJAX call returns ‘testtest0’ instead of ‘test’ – why?
- add_action wp_ajax_ not loading in plugin file WP Network
- Ajax +wordpress onClick link redirect to new page and create html content
- Remove Products From Category
- WordPress (pagenow link) in ajaxurl change after i change plugin language
- wp_query ‘s’ parameter does not work with WC_AJAX
- How to do admin ajax request in a plugin for rest api
- Jquery php request is returning a weird result
- WordPress Does not grab the string sends useing AJAX response, wp_ajax hook
- Posts form with AJAX request – Plugin development
- Bad request 400 using class based files
- Does $this context change in an AJAX callback?
- Getting products information, in woocommerce based on products ID
- WC REST API Error Handling
- want to confirm popup with “Yes” and “No” button when user click on add to cart
- How to remove the WooCommerce Product->Category thumbnail from admin [closed]
- Performing ajax request in wordpress
- Override WooCommerce files from plugin
- ajax multiple Values
- woocommerce add a new bulk action in the bulk actions dropdown in the orders list
- Using JavaScript in WordPress page to call for server data using AJAX
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Ajax Response Error | just getting error as the response
- external Integration with wordpress timeout error
- admin-ajax.php returns “No Script Kiddies!” sometimes
- Handle changed Woocommerce function
- Making Woocommerce optimized for more than 500k products
- Ajax functionality not being called under wordpress plugin
- Array/List Edit in Backend
- WP Cron as Fast as WordPress AJAX?
- Declaring a new woo commerce product type i get this error
- WordPress plugin: admin-ajax.php not passing data to custom function
- Ajax url value to pass ‘variable’ to use in query
- Ajax functions – no access to wp-admin.php only online
- How to only Load scripts on variable products page
- How to design WooCommerce-like admin tabs for plugin settings page?
- Woocommerce: block user removing cart item
- PHPUnit Ajax Serialization of ‘Closure’ is not allowed
- What is the meta_query key name for the woo product average rating? [closed]
- WooCommerce adds a newline symbol (\n) between email recipients
- Why my admin-ajax url returns 0 even after adding echo and die() at the end of function?
- WordPress plugin boilerplate AJAX functionality
- Allow HTML in product attributes and variation for WooCommerce
- How do I add multiple custom menu Woo-commerce my account page?
- I want to redirect user to an amazon product page from my wordpress website when they add product to there cart [closed]