Last active
July 22, 2016 18:28
-
-
Save sunshinephotocart/64bf83fd97a49f135e7b46478914bfa5 to your computer and use it in GitHub Desktop.
Default lightbox quantity to 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add following to your theme's functions.php file or use something like https://wordpress.org/plugins/custom-css-js-php/ | |
add_action( 'sunshine_before_add_to_cart_form', 'sunshine_lightbox_default_qty_1' ); | |
function sunshine_lightbox_default_qty_1() { | |
?> | |
<script> | |
jQuery( document ).ready( function($){ | |
$( 'input[name="quantity"]' ).val( 1 ); | |
}); | |
</script> | |
<?php | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment