当前位置: 首页>>代码示例>>PHP>>正文


PHP is_shop_enabled函数代码示例

本文整理汇总了PHP中is_shop_enabled函数的典型用法代码示例。如果您正苦于以下问题:PHP is_shop_enabled函数的具体用法?PHP is_shop_enabled怎么用?PHP is_shop_enabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_shop_enabled函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: do_action

/**
 * woocommerce_show_product_images hook
 *
 * @hooked woocommerce_show_product_sale_flash - 10
 * @hooked woocommerce_show_product_images - 20
 */
do_action('woocommerce_before_single_product_summary');
?>

        <div class="summary entry-summary">

            <?php 
if (!is_shop_enabled() || !yit_get_option('shop-detail-show-price')) {
    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_price', 25);
}
if (!is_shop_enabled() || !yit_get_option('shop-detail-add-to-cart')) {
    remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30);
}
remove_action('woocommerce_single_product_summary', '');
// add a separator after title and price
add_action('woocommerce_single_product_summary', create_function('', 'echo do_shortcode("[line]");'));
/**
 * woocommerce_single_product_summary hook
 *
 * @hooked woocommerce_template_single_title - 5
 * @hooked woocommerce_template_single_price - 10
 * @hooked woocommerce_template_single_excerpt - 20
 * @hooked woocommerce_template_single_add_to_cart - 30
 * @hooked woocommerce_template_single_meta - 40
 * @hooked woocommerce_template_single_sharing - 50
 */
开发者ID:VitaliyProdan,项目名称:wp_shop,代码行数:31,代码来源:content-single-product.php

示例2:

<?php

/**
 * Loop Add to Cart
 *
 * @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     1.6.4
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
if (!is_shop_enabled() || !yit_get_option('shop-view-show-add-to-cart')) {
    return;
}
global $product;
?>

<?php 
if (!$product->is_in_stock()) {
    ?>

	<a href="<?php 
    echo apply_filters('out_of_stock_add_to_cart_url', get_permalink($product->id));
    ?>
" class="out-of-stock button"><?php 
    echo apply_filters('out_of_stock_add_to_cart_text', __('Out Of Stock', 'yit'));
    ?>
</a>
开发者ID:jayeshnair,项目名称:ctp,代码行数:30,代码来源:add-to-cart.php

示例3: array

}
if ( ! ( yit_get_option( 'shop-view-show-wishlist' ) && get_option( 'yith_wcwl_enabled' ) == 'yes' ) ) {
    $wishlist = '';
}
//if ( ! yit_get_option('shop-view-show-share') )    { $share    = ''; }

//if ( !( isset( $woocommerce->integrations->integrations['sharethis'] ) && $woocommerce->integrations->integrations['sharethis']->publisher_id ) ) { $share = ''; }

$buttons = array( $details, $wishlist, $compare, $share );
foreach ( array( 'details', 'wishlist', 'compare', 'share' ) as $var ) {
    if ( empty( ${$var} ) ) {
        $count_buttons --;
    }
}

if ( ! is_shop_enabled() || ! yit_get_option( 'shop-view-show-add-to-cart' ) || ! $product->is_purchasable() ) {
    $add_to_cart  = '';
    $out_of_stock = '';


    if ( $product->product_type == 'external' ) {
        $link        = apply_filters( 'external_add_to_cart_url', get_permalink( $product->id ) );
        $label       = apply_filters( 'external_add_to_cart_text', __( 'Read More', 'yit' ) );
        $add_to_cart = sprintf( '<a href="%s" rel="nofollow" class="view-options" title="%s">%s</a>', apply_filters( 'yit_external_add_to_cart_link_loop', $link, $product ), $label, $label );
    }

}
elseif ( ! $product->is_in_stock() ) {
    $add_to_cart = '';
    $label       = apply_filters( 'out_of_stock_add_to_cart_text', __( 'Out of stock', 'yit' ) ); ?>
开发者ID:simonsays88,项目名称:costa,代码行数:30,代码来源:add-to-cart.php

示例4: empty

if (!yit_get_option('shop-view-show-title')) {
    $title_class[] = 'hide';
}
if (yit_get_option('shop-title-uppercase')) {
    $title_class[] = 'upper';
}
$title_class = empty($title_class) ? '' : ' class="' . implode(' ', $title_class) . '"';
yit_detect_span_catalog_image();
//automatically add the classes
if (0 == ($woocommerce_loop['loop'] - 1) % $woocommerce_loop['columns'] || 1 == $woocommerce_loop['columns']) {
    $woocommerce_loop['li_class'][] = 'first';
}
if (0 == $woocommerce_loop['loop'] % $woocommerce_loop['columns']) {
    $woocommerce_loop['li_class'][] = 'last';
}
if (!is_shop_enabled() || !yit_get_option('shop-view-show-price')) {
    remove_action('woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price');
}
$image = yit_image("size=shop_catalog&output=array");
$height = isset($image[2]) ? $image[2] : 0;
//quick view js
do_action('yit_quick_view_load_static');
?>
<li <?php 
post_class($woocommerce_loop['li_class']);
if ($woocommerce_loop['view'] == 'list') {
    ?>
 style="min-height: <?php 
    echo $height;
    ?>
px;"<?php 
开发者ID:jayeshnair,项目名称:ctp,代码行数:31,代码来源:content-product.php

示例5: isset

<?php

global $woocommerce, $product;
$id = isset($id) ? (int) $id : '';
$attribute_id = isset($attribute_id) ? (int) $attribute_id : '';
$show_price = isset($show_price) && $show_price == 'yes' ? true : false;
$show_cart = isset($show_cart) && $show_cart == 'yes' ? true : false;
$product = get_product($id);
if (!$product->is_purchasable()) {
    return;
}
?>


<?php 
if ($product->is_in_stock() && is_shop_enabled()) {
    ?>
	
	<?php 
    if ($product->product_type == 'simple') {
        ?>
		<?php 
        if ($show_price) {
            echo $product->get_price_html();
        }
        ?>
		<?php 
        if ($show_cart) {
            ?>
			<form action="<?php 
            echo esc_url($product->add_to_cart_url());
开发者ID:zgomotos,项目名称:Bazar,代码行数:31,代码来源:yit_add_to_cart.php

示例6: admin_init

 static function admin_init()
 {
     if (!is_shop_enabled() || basename($_SERVER['PHP_SELF']) != 'nav-menus.php') {
         return;
     }
     wp_enqueue_script('nav-menu-query', YIT_THEME_ASSETS_URL . '/js/metabox_nav_menu.js', 'nav-menu', false, true);
     add_meta_box('products-by-prices', 'Prices Filter', array(__CLASS__, 'nav_menu_meta_box'), 'nav-menus', 'side', 'low');
 }
开发者ID:VitaliyProdan,项目名称:wp_shop,代码行数:8,代码来源:woocommerce.php

示例7: get_option

    $class_subscription = "subscription";
    $woo_option         = get_option( 'woocommerce_subscriptions_add_to_cart_button_text' );
    $label              = $woo_option ? $woo_option : apply_filters( 'subscription_add_to_cart_text', __( 'Sign Up Now', 'yit' ) );
}
else {
    $label = apply_filters( 'single_add_to_cart_text',yit_icl_translate( "theme", "yit", "add_to_cart_text", yit_get_option( 'add-to-cart-text' ) ));
}


?>

<?php do_action( 'woocommerce_before_add_to_cart_form' ); ?>

<form action="<?php echo esc_url( $product->add_to_cart_url() ); ?>" class="variations_form cart group" method="post" enctype='multipart/form-data' data-product_id="<?php echo $post->ID; ?>" data-product_variations="<?php echo esc_attr( json_encode( $available_variations ) ) ?>">

    <?php if ( is_shop_enabled() && yit_get_option( 'shop-detail-add-to-cart' ) && yit_product_form_position_is( 'in-sidebar' ) ) : ?>
        <div class="quantity-wrap group">
            <label><?php _e( 'Quantity', 'yit' ) ?></label>
            <?php woocommerce_quantity_input(); ?>
        </div>
    <?php endif; ?>

    <div class="variations">
        <?php $loop = 0; foreach ( $attributes as $name => $options ) : $loop ++; ?>
            <label for="<?php echo sanitize_title( $name ); ?>"><?php echo wc_attribute_label( $name ); ?></label>
            <div class="select-wrapper">
                <select id="<?php echo esc_attr( sanitize_title( $name ) ); ?>" name="attribute_<?php echo sanitize_title( $name ); ?>">
                    <option value=""><?php echo __( 'Choose an option', 'yit' ) ?>&hellip;</option>
                    <?php
                    if ( is_array( $options ) ) {
开发者ID:simonsays88,项目名称:costa,代码行数:30,代码来源:variable.php

示例8: do_action

            ?>
>            
        <?php 
        }
        ?>
        </div>
    <?php 
    }
    ?>
    
    <?php 
    if ($show_breadcrumb) {
        ?>
        <!-- BREDCRUMB -->          
        <div class="breadcrumbs">        	
        <?php 
        do_action('yit_before_breadcrumb');
        if (!is_shop_installed() || is_shop_enabled() && !is_woocommerce()) {
            yit_breadcrumb(apply_filters('yit_breadcrumb_delimiter', '|'));
        }
        ?>
        </div>  
    <?php 
    }
    ?>
   
    </div></div></div>
</div>
<!-- END PAGE META -->
<?php 
}
开发者ID:zgomotos,项目名称:Bazar,代码行数:31,代码来源:page-meta.php

示例9:

<?php

/**
 * Your Inspiration Themes
 *
 * @package WordPress
 * @subpackage Your Inspiration Themes
 * @author Your Inspiration Themes Team <info@yithemes.com>
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
if (!is_shop_installed() || !is_shop_enabled() || !yit_get_option('show-header-woocommerce-cart')) {
    return;
}
?>
<div class="woo_cart<?php 
if (!yit_get_option('responsive-show-header-cart')) {
    echo ' hidden-phone';
}
?>
">
    <?php 
the_widget('YIT_Widget_Cart');
?>
</div>
开发者ID:jayeshnair,项目名称:ctp,代码行数:28,代码来源:cart.php

示例10: yit_get_option

/**
 * Your Inspiration Themes
 *
 * @package WordPress
 * @subpackage Your Inspiration Themes
 * @author Your Inspiration Themes Team <info@yithemes.com>
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
$show_cart = yit_get_option('show-header-woocommerce-cart');
$show_cart_widget = yit_get_option('show-header-woocommerce-cart-widget');
$show_search = yit_get_option('show-header-search');
if (!is_shop_installed() || !is_shop_enabled()) {
    $show_cart = $show_cart_widget = false;
}
$responsive_header_cart = yit_get_option('responsive-show-header-cart');
$responsive_header_search = yit_get_option('responsive-show-header-search');
if (!$show_cart && !$show_cart_widget && !$show_search) {
    return;
}
global $woocommerce;
?>
<div id="header-cart-search">
    <?php 
if ($show_cart || $show_cart_widget) {
    ?>
    <div class="cart-row group<?php 
    if (!$responsive_header_cart) {
开发者ID:zgomotos,项目名称:Bazar,代码行数:31,代码来源:cart-search.php

示例11: yit_get_option

 *
 * @package WordPress
 * @subpackage Your Inspiration Themes
 * @author Your Inspiration Themes Team <info@yithemes.com>
 *
 * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.gnu.org/licenses/gpl-3.0.txt
 */
$show_cart        = yit_get_option('show-header-woocommerce-cart');
$show_cart_widget = yit_get_option('show-header-woocommerce-cart-widget');
$show_search      = yit_get_option('show-header-search');


if( ! is_shop_installed() || ! is_shop_enabled() ) $show_cart = $show_cart_widget = false;

$responsive_header_cart   = yit_get_option('responsive-show-header-cart');
$responsive_header_search = yit_get_option('responsive-show-header-search');

if ( ! $show_cart && ! $show_cart_widget && ! $show_search ) return;

global $woocommerce;

?>
<div id="header-cart-search">
    <?php if( ( $show_cart || $show_cart_widget ) && !yit_ywctm_hide_cart_page() ): ?>
    <div class="cart-row group<?php if ( ! $responsive_header_cart ) echo ' hidden-phone' ?>">
        <?php if( $show_cart == '1' ): ?>

            <?php list( $cart_items, $cart_subtotal, $cart_currency ) = yit_get_current_cart_info(); ?>
开发者ID:simonsays88,项目名称:costa,代码行数:31,代码来源:cart-search.php

示例12:

        <a href="<?php 
echo $profile_link;
?>
"><?php 
echo $user_name;
?>
 <span class="sf-sub-indicator"> +</span></a>
    </div>
    <div class="welcome_menu hidden-phone">

        <div class="welcome_menu_inner">
            <?php 
if (!$logged_in) {
    ?>
                <?php 
    if (is_shop_installed() && is_shop_enabled()) {
        global $woocommerce;
        ?>
                    <form method="post" action="<?php 
        echo get_permalink(get_option('woocommerce_myaccount_page_id'));
        ?>
" class="group">
                        <input type="text" name="username" id="header_username" placeholder="<?php 
        _e('Username', 'yit');
        ?>
" />
                        <input type="password" name="password" id="header_password" placeholder="<?php 
        _e('Password', 'yit');
        ?>
" />
开发者ID:lieison,项目名称:IndustriasFenix,代码行数:30,代码来源:welcome.php


注:本文中的is_shop_enabled函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。