rdusnr

Untitled

Oct 5th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. <?php
  2. /**
  3. * Single variation cart button
  4. *
  5. * @see https://docs.woocommerce.com/document/template-structure/
  6. * @author WooThemes
  7. * @package WooCommerce/Templates
  8. * @version 3.0.0
  9. */
  10. if ( ! defined( 'ABSPATH' ) ) {
  11. exit;
  12. }
  13.  
  14. global $product;
  15. ?>
  16. <div class="woocommerce-variation-add-to-cart variations_button">
  17. <?php
  18. /**
  19. * @since 3.0.0.
  20. */
  21. do_action( 'woocommerce_before_add_to_cart_quantity' );
  22.  
  23. woocommerce_quantity_input( array(
  24. 'min_value' => apply_filters( 'woocommerce_quantity_input_min', $product->get_min_purchase_quantity(), $product ),
  25. 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->get_max_purchase_quantity(), $product ),
  26. 'input_value' => isset( $_POST['quantity'] ) ? wc_stock_amount( $_POST['quantity'] ) : $product->get_min_purchase_quantity(),
  27. ) );
  28.  
  29. /**
  30. * @since 3.0.0.
  31. */
  32. do_action( 'woocommerce_after_add_to_cart_quantity' );
  33. ?>
  34. <button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
  35.  
  36. <?php do_action(sqr_woocommerce_after_add_to_cart_button); ?>
  37.  
  38. <input type="hidden" name="add-to-cart" value="<?php echo absint( $product->get_id() ); ?>" />
  39. <input type="hidden" name="product_id" value="<?php echo absint( $product->get_id() ); ?>" />
  40. <input type="hidden" name="variation_id" class="variation_id" value="0" />
  41. </div>
Advertisement
Add Comment
Please, Sign In to add comment