daily pastebin goal
41%
SHARE
TWEET

variation-add-to-cart-button.php (Without Qty Selector)

a guest Jan 29th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.    
  18.     <button type="submit" class="single_add_to_cart_button button alt"><?php echo esc_html( $product->single_add_to_cart_text() ); ?></button>
  19.     <input type="hidden" name="add-to-cart" value="<?php echo absint( $product->get_id() ); ?>" />
  20.     <input type="hidden" name="product_id" value="<?php echo absint( $product->get_id() ); ?>" />
  21.     <input type="hidden" name="variation_id" class="variation_id" value="0" />
  22. </div>
RAW Paste Data
Pastebin PRO WINTER Special!
Get 40% OFF Pastebin PRO accounts!
Top