Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Default lightbox quantity to 1
<?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
You can’t perform that action at this time.