-
-
Save JustinSainton/d426c20f8407fd96cb03 to your computer and use it in GitHub Desktop.
Add quantity to add_to_cart shortcode.
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_action( 'wpsc_add_to_cart_button_form_end', function( $product_id ) { | |
?> | |
<fieldset><legend><?php _e('Quantity', 'wpsc'); ?></legend> | |
<div class="wpsc_quantity_update"> | |
<input type="text" id="wpsc_quantity_update_<?php echo $product_id; ?>" name="wpsc_quantity_update" size="2" value="1" /> | |
<input type="hidden" name="key" value="<?php echo wpsc_the_cart_item_key(); ?>"/> | |
<input type="hidden" name="wpsc_update_quantity" value="true" /> | |
<input type='hidden' name='wpsc_ajax_action' value='wpsc_update_quantity' /> | |
</div><!--close wpsc_quantity_update--> | |
</fieldset> | |
<?php | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment