I did it.
The “stock.available-on-backorder.step-1” is the css class of the availability text ( Available- made to measure
).
<?php
add_action( 'woocommerce_before_add_to_cart_quantity', 'made_to_measure' );
function made_to_measure() {
global $product;
if ( $product->is_type('variable') ) {
?>
<script>
jQuery(document).ready(function($) {
$('input.variation_id').change( function(){
if( '' != $('input.variation_id').val() ) {
//var var_id = $('input.variation_id').val();
var pa_size = jQuery( "#pa_size" ).val();
if (pa_size=='l' || pa_size=='xl')
{
$('.stock.available-on-backorder.step-1').html("Available- made to measure");
}
}
});
Related Posts:
- How to correctly add Javascript in functions.php
- Remove commas from WooCommerce checkout addresses fields
- combine Code 1 with Code 2
- WooCommerce – Reset quantity input field when variation changes
- Pass Category Name, Description and Photo into variables to pass to jQuery
- Change “add to cart” button color based on Woocommerce product category [closed]
- How can I get the values of my WordPress $wpdb query in Jquery?
- Execute PHP code only with specific user role
- WooCommerce Query Product Titles
- Display custom field value in woocommerce variable product via jQurey
- Woocommerce – if selected attribute term equals
- AJAX to add to cart multiple products woocommerce
- How to echo a PHP code into WooCommerce variation product?
- I was wondering if it’s possible to implement card.js on WordPress
- jQuery doesn’t work in my php snippet
- Add specific phrase after every product title including the discounted price? [closed]
- Replace the image of a product with its video in the shop page
- How to add product in woocommerce with php code [closed]
- How to add date range in woocommerce with code
- Creating custom Woocommerce attribute taxonomies from a plugin
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to get the original price of the product in woocommerce?
- Woocommerce, recognize the loop of related products
- WooCommerce Link to Product Category
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- Append a term to WooCommerce product existing product category terms
- Writing scripts using WordPress / WooCommerce classes?
- How to make custom total price reactive in navigation
- Asking popup for delete post in WordPress [closed]
- Change description on specific WooCommerce product status change
- How to add a second ‘place order’ button in WooCommerce [closed]
- How to test nonce with AJAX – Plugin development
- Woocommerce redirect thankyou page based on product ID doesn’t empty Cart
- tracking number field in Woocommerce order [closed]
- Slider loading issue
- WooCommerce Related Products by Attribute
- Image as Sales Badge
- Modify HTML structure of fields in woocommerce checkout form
- Add a product to checkout via form
- Trying to place a custom field after the total section in the checkout page in woocommerce
- WordPress default Search function inconsistent in WooCommerce Product Titles
- Why ajax doesn’t work on certain wordpress hooks and reload the page instead?
- Limit Widgets to Sidebar ID’s
- How to add a do_action on refreshing of WP customizer?
- Trouble checking if custom woocommerce checkout field is empty or not
- WordPress Multiple Navigation bars
- My new button is in the wrong place
- Add / Update Custom Fields After Select Pictures in Media Window
- echo something inside a shortcode
- Function returns text instead of html [closed]
- require_once() if a product in woocommerce contains a tag [closed]
- How to display SQL query that ran in WC_Order_Query?
- Call WC_Product get_price()?
- Changing the order of custom fields in the dashboard for Woocommerce variable products [closed]
- woocommerce wc_create_order(); is creating multiple orders instead of one?
- Proper way to use WordPress function with AJAX PHP file
- Live search from database table
- Replacing WordPress Icons (menu,icons32, etc)?
- How to work Woocommerce pagination inside shortcode?
- How to restrict shipping zone in a specific interval time
- Database entry removed on browser refresh, Ajax PHP jQuery
- Hide specific product from Woocommerce if the logged-in user has already enrolled into the course
- Remove Author Links
- Change the URL of an image from wp_get_attachment_image_src for Product Posts based on Category
- Combine change Email WordPress and woocommerce emails template
- get orders of today’s date
- product_type_options get saved value [closed]
- How can I update the price when someone enters postcode or zip code in woocommerce checkout page?
- Including user data in “new user notification email”
- wp_ajax_ 400 Bad Request
- update_post_meta Not Processing Array Data (Not Sure What I Am Missing)
- How do I remove an action hook inside a class that is called by another class?
- Add Shortcode to ::before class
- WooCommerce get products based on the taxonomy
- Woocommerce Add custom “Add to cart button” in single page with tags
- Woocommerce remove menu item on myaccount dashboard
- How to call a function from functions.php with ajax?
- random woocommerce categories are not showing when count enabled?
- how to display woocomerce description of each category in wordpress? [closed]
- WordPress 3.0 PHP Error – notice WordPress_product_Type was called incorrectly
- WooCommerce – Add product category below product price [closed]
- woocommerce plugin bugs
- Using Custom Javascript and pHp to send email to myself when a user clicks on an input button but only works on Chrome, IE, and Micorosft Edge
- ajax form with multiple submit buttons and values
- Woocommerce Price Text
- Adding unique marketing messages between certain products whilst using isotope/Infinite Scroll
- Pass php to database in JQuery: With AJAX?
- Why this plugin is not working?
- Trying to fix multiple category drop down
- ajax form function error
- Ajax Load More or View More functionality for woocommerce category layout by template overriding
- wc_add_notice not working on cart page
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- Woocommerce – Shipping tax class based on cart items not using the highest tax available
- ACF repeater image in video poster with jquery
- How do I update product shipping using PHP in WooCommerce?
- How can I edit the WooCommerce Mini DropDown Cart to read as follows
- Grabbing value of input field inside of array
- WooCommerce Checkout Cart [closed]
- Woocommerce – add tracking code to another email template