File: D:/HostingSpaces/ERijn/knijft.eu/wwwroot/wp-content/themes/cheope/woocommerce/loop/add-to-cart.php
<?php
/**
* Loop Add to Cart
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.1.0
*/
global $product;
$details = sprintf('<a href="%s" rel="nofollow" title="%s" class="details">%s</a>', get_permalink(), __( 'Details', 'yit' ), __( 'Details', 'yit' ));
if ( ! yit_get_option('shop-view-show-details') )
{ $details = ''; }
if ( ! is_shop_enabled() || ! yit_get_option('shop-view-show-add-to-cart') || ! $product->is_purchasable() ) :
$add_to_cart = '';
$out_of_stock = '';
?>
<?php elseif ( ! $product->is_in_stock() ) : $add_to_cart = ''; $label = apply_filters( 'out_of_stock_add_to_cart_text', __( 'Out of stock', 'yit' ) ); ?>
<?php $out_of_stock = sprintf( '<a class="button out-of-stock" title="%s">%s</a>', $label, $label ); ?>
<?php else : ?>
<?php
$add_to_cart = '';
switch( $product->product_type ){
case "variable" :
$link = apply_filters( 'variable_add_to_cart_url', get_permalink( $product->id ) );
$label = apply_filters( 'variable_add_to_cart_text', __('Select options', 'yit') );
$add_to_cart = apply_filters( 'woocommerce_loop_add_to_cart_link',
sprintf( '<a href="%s" rel="nofollow" class="view-options" title="%s">%s</a>', $link, $label, $label),
$product );
break;
default :
$add_to_cart = apply_filters( 'woocommerce_loop_add_to_cart_link',
sprintf( '<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="button %s product_type_%s">%s</a>',
esc_url( $product->add_to_cart_url() ),
esc_attr( $product->id ),
esc_attr( $product->get_sku() ),
$product->is_purchasable() ? 'add_to_cart_button' : '',
esc_attr( $product->product_type ),
esc_html( $product->add_to_cart_text() )
),
$product );
break;
}
?>
<?php endif; ?>
<?php if ( ! empty( $add_to_cart ) || ! empty( $details ) ) : ?>
<div class="product-actions">
<?php echo $details; ?>
<?php echo $add_to_cart; ?>
<?php if (isset($out_of_stock) && $out_of_stock != '') : echo $out_of_stock; endif ?>
</div>
<?php endif; ?>