public static function instance()
 {
     if (is_null(self::$_instance)) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
示例#2
0
文件: variable.php 项目: Bebeau/hwa
if (!defined('ABSPATH')) {
    exit;
}
global $product;
$attribute_keys = array_keys($attributes);
do_action('woocommerce_before_add_to_cart_form');
?>

<form class="variations_form cart" method="post" enctype='multipart/form-data' data-dh_disable_variation_gallery="<?php 
echo esc_attr(get_post_meta(get_the_ID(), '_dh_disable_variation_gallery', true));
?>
" data-product_id="<?php 
echo absint($product->id);
?>
" data-product_images="<?php 
echo esc_attr(DH_Woocommerce_Product_Variable::instance()->get_product_image($product));
?>
"  data-product_variations="<?php 
echo esc_attr(json_encode($available_variations));
?>
">
	<?php 
do_action('woocommerce_before_variations_form');
?>

	<?php 
if (empty($available_variations) && false !== $available_variations) {
    ?>
		<p class="stock out-of-stock"><?php 
    esc_html_e('This product is currently out of stock and unavailable.', 'jakiro');
    ?>