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
- Retrive the value of the Active variation of the product and then link it to the “read more” to dynamically change
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- How do I add a php statement to a jQuery string
- Woocommerce: How to override core functions in functions.php?
- Can’t use get_results() in ajax query
- Get WooCommerce shipping methods programmatically
- Add a custom text field to WooCommerce admin product data “Variations”
- Translating add to cart woocommerce button [closed]
- Passing jQuery value using Ajax to a page template
- ajax_object is not defined when ajax calls the function
- Ajax return code 400
- How do I display a user’s previous orders as a select box option on a product?
- ajax, right way to do it and make it works?
- Automated Cart Update With Alert Box Each Time
- Two Different Links for Same Product – WooCommerce [closed]
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- Show prices with tax in Woocommerce Mini Cart [closed]
- WordPress ajax doesn’t display object method on jQuery .change() function
- Problem with custom plugin using AJAX to pull info from php file
- Is it possible to intercept all ajax requests and get the parameters and the returns?
- How to make products with no cost in WooCommerce
- Incorrect amount of posts returned when filtering related Woo products by custom taxonomy
- Menu jumping when calling it via PHP
- Setting value of session with Ajax not working
- Click a radio button must set textfield value
- How to keep track of when a vote is cast?
- Remove page title in product page using a function
- woocommerce specific quantities for product
- Output votes to div dynamically in wordpress
- WordPress site with embedded menu – gives You don’t have permission to access /wp-content/themes/xxx/taxonomy-redirect.php on this server
- JS file is not loading when i put wp_head() and wp_footer
- Angular not defined [closed]
- limit number of post for achive page
- Adding wp_list_categories to a specific div that was appended using jQuery
- How to separate product payment and shipping payment in WooCommerce checkout? [closed]
- Output product category link from WP_Query
- How to get woocommerce orders with get_posts method in a shortcode
- How to send a php var to jQuery Ajax call with two different file
- Variation prices breakdown only for single product page
- How do I call a value from the datase using ajax
- Woocommerce disable order item link (backend) [closed]
- Set all WooCommerce Products to Simple, Virtual & Downloadable
- Undefined array key 0 wp-includes/capabilities.php on line 76
- How do I know if the user is a customer?
- Dropdown Category form. Only show Sub-Categories
- Where to add my PHP codes for AJAX Jquery to work?
- I want to fusion the product columns in email table order
- WooCommerce is_product_category() not working
- How to use wp_ajax_set_post_thumbnail?
- Best way to use variables in multiple functions?
- Display all categories including sub categories under a list ul
- Woocommerce – get daily sales meta
- Custom woocommerce payment gateway – Form
- Discount in the specific product title using keyword ( Woocoommerce )
- Can’t make lazy load for my site, help!
- Place product field value as variable in php
- Change CSS Variable value in Theme Customizer Live Preview
- How can I add another row to the total field in WooCoommerce cart, checkout and recipe mail?
- number of posts with “Load More”
- Put a span class in the shortened product title
- Add missing alt tag to featured images for “storefront” theme
- Sort WooCommerce data with WP-CRON?
- Display specific main Sub Nav on Woocommerce product pages
- Clone the “proceed to cart” button and place it above checkout on the cart page, but only appear display size is 320px
- Need Quick Help With Product Category Page
- Calling header from JavaScript file
- Slider from different widgets
- How to set up and use a custom upload directory for post type ‘product’
- How to get the rating value of each comment
- How keep woocommerce users separeted in multisite install and keep admins on network
- Load Meta box value into div AJAX [duplicate]
- Exclude specific product tags from related products in WooCommerce 3+ [closed]
- WooCommerce Orders pagination
- Product Category Page in Full Width
- After declaring woocommerce theme support products are no longer displayed
- Woocommerce product variations getting created without attribute values selected
- PHP Add products to cart with WooCommerce Addons
- Adding extra cost to woocommerce flat rate based on shipping zone
- I got this error POST https://localhost/meraboilerwp/[object%20Object] 404 (Not Found)
- Woocommerce product search result page layout
- Woocommerce attatch files and custom input meta to cart items and then to order
- Woocommerce, via php snippet: How to get product price and divide it by a number from an attribute, and then display the new price via php/html?
- WooCommerce: Custom dropdown for variation selection