<?php
/**
 * @package WordPress
 * @subpackage Campoal
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

global $campoal_options;
global $product;

$add_cart_button = isset($campoal_options['conikal_add_cart_style_field']) ? $campoal_options['conikal_add_cart_style_field'] : 'fluid';

if('text' == $add_cart_button){
	
	echo apply_filters( 'woocommerce_loop_add_to_cart_link',
		sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s ui primary labeled icon button"><i class="cart plus icon"></i> '. esc_html__('Add To Cart', 'campoal') .'</a>',
			esc_url( $product->add_to_cart_url() ),
			esc_attr( isset( $quantity ) ? $quantity : 1 ),
			esc_attr( $product->get_id() ),
			esc_attr( $product->get_sku() ),
			str_replace('button p', 'p', esc_attr( isset( $class ) ? $class : 'button' )),
			esc_html( $product->add_to_cart_text() )
		),
	$product, 10, 4 );
	
} else if ('fluid' == $add_cart_button) {
	
	echo apply_filters( 'woocommerce_loop_add_to_cart_link',
		sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s ui primary fluid button">'. esc_html__('Add To Cart', 'campoal') .'</a>',
			esc_url( $product->add_to_cart_url() ),
			esc_attr( isset( $quantity ) ? $quantity : 1 ),
			esc_attr( $product->get_id() ),
			esc_attr( $product->get_sku() ),
			str_replace('button p', 'p', esc_attr( isset( $class ) ? $class : 'button' )),
			esc_html( $product->add_to_cart_text() )
		),
	$product, 10, 4 );

} else if ('icon' == $add_cart_button) {
	
	echo apply_filters( 'woocommerce_loop_add_to_cart_link',
		sprintf( '<a rel="nofollow" href="%s" data-quantity="%s" data-product_id="%s" data-product_sku="%s" class="%s ui primary icon button"><i class="cart plus icon"></i></a>',
			esc_url( $product->add_to_cart_url() ),
			esc_attr( isset( $quantity ) ? $quantity : 1 ),
			esc_attr( $product->get_id() ),
			esc_attr( $product->get_sku() ),
			str_replace('button p', 'p', esc_attr( isset( $class ) ? $class : 'button' )),
			esc_html( $product->add_to_cart_text() )
		),
	$product, 10, 4 );
	
}