/home/techb158/l2hypotheques.com/wp-content/themes/pylon/inc
Edit: /home/techb158/l2hypotheques.com/wp-content/themes/pylon/inc/woocommerce.php (10247B)
';
if (pylon_options('sidebar_shop') == 'left') {
do_action('pylon_get_sidebar','shop');
}
echo '
';
}
if (is_product()) {
echo '
';
}
}
add_action('woocommerce_after_main_content','pylon_closing_row_clsses',1);
function pylon_closing_row_clsses() {
if (!is_product()) {
// code...
echo '
';
if (pylon_options('sidebar_shop') == 'right') {
do_action('pylon_get_sidebar','shop');
}
echo '
';
}
if (is_product()) {
echo '
';
}
}
// Adding parent class to shop page
add_action('woocommerce_before_shop_loop','pylon_result_ordering_wrapping_open',19);
if(!function_exists('pylon_result_ordering_wrapping_open')) {
function pylon_result_ordering_wrapping_open() {
echo '
';
}
}
add_filter( 'loop_shop_per_page', 'pylon_products_per_page', 20 );
function pylon_products_per_page( $cols ) {
// Return the number of products you wanna show per page.
$cols = pylon_options('pylon_product_per_page');
if(!empty($cols))
{
}
else{
$cols = 9;
}
return $cols ;
}
add_action('woocommerce_before_shop_loop','pylon_result_ordering_wrapping_close',31);
if(!function_exists('pylon_result_ordering_wrapping_close')) {
function pylon_result_ordering_wrapping_close() {
echo '
';
}
}
// Changing the layout of product card as per theme
remove_action('woocommerce_before_shop_loop_item','woocommerce_template_loop_product_link_open',10);
remove_action('woocommerce_after_shop_loop_item','woocommerce_template_loop_product_link_close',5);
add_action('woocommerce_shop_loop_item_title','pylon_product_content_element_open',8);
if(!function_exists('pylon_product_content_element_open')) {
function pylon_product_content_element_open() {
echo '
';
}
}
add_action('woocommerce_shop_loop_item_title','pylon_product_content_element_close',12);
if(!function_exists('pylon_product_content_element_close')) {
function pylon_product_content_element_close() {
echo '
';
}
}
remove_action('woocommerce_after_shop_loop_item_title','woocommerce_template_loop_rating',5);
add_action('woocommerce_after_shop_loop_item_title','woocommerce_template_loop_rating',11);
add_action('woocommerce_shop_loop_item_title','woocommerce_template_loop_product_link_open',9);
add_action('woocommerce_shop_loop_item_title','woocommerce_template_loop_product_link_close',11);
remove_action('woocommerce_after_shop_loop_item','woocommerce_template_loop_add_to_cart',10);
add_action('woocommerce_before_shop_loop_item_title','pylon_loop_product_image_parent_open',8);
if (!function_exists('pylon_loop_product_image_parent_open')) {
function pylon_loop_product_image_parent_open() {
echo '
';
}
}
add_action('woocommerce_before_shop_loop_item_title','pylon_loop_product_image_parent_close',12);
if (!function_exists('pylon_loop_product_image_parent_close')) {
function pylon_loop_product_image_parent_close() {
echo '
';
}
}
add_action('woocommerce_before_shop_loop_item_title','pylon_loop_product_image_child_open',10);
if (!function_exists('pylon_loop_product_image_child_open')) {
function pylon_loop_product_image_child_open() {
echo '
';
}
}
add_action('woocommerce_before_shop_loop_item_title','pylon_loop_product_image_child_close',12);
if (!function_exists('pylon_loop_product_image_child_close')) {
function pylon_loop_product_image_child_close() {
echo '
';
// /.product-card__image-content
}
}
// To change add to cart text on product archives(Collection) page
add_filter( 'woocommerce_product_add_to_cart_text', 'pylon_custom_add_to_cart_text' );
function pylon_custom_add_to_cart_text() {
return '';
}
add_action('woocommerce_before_shop_loop_item_title','pylon_wishlist_button',10);
function pylon_wishlist_button() {
if( shortcode_exists('yith_wcwl_add_to_wishlist') ) {
echo do_shortcode('[yith_wcwl_add_to_wishlist]');
}
}
// changed position of add to cart button
add_action('woocommerce_before_shop_loop_item_title','woocommerce_template_loop_add_to_cart',10);
// Showing a sold out tag if product is out of stock
add_action( 'woocommerce_before_shop_loop_item_title', 'pylon_out_of_stock_loop_product',9);
if (!function_exists('pylon_out_of_stock_loop_product')) {
function pylon_out_of_stock_loop_product() {
global $product;
if ( ! $product->is_in_stock() ) {
echo '
' . esc_html__('Sold Out', 'pylon') . '';
}
}
}
// Change Price Filter Widget Increment
function change_price_filter_step() {
return 0.1;
}
add_filter( 'woocommerce_price_filter_widget_step', 'change_price_filter_step', 10 );
}
/************************************************
* Changing Content of single product page *
************************************************/
add_action('woocommerce_single_product_summary','single_product_template_before_title',4);
if (!function_exists('single_product_template_before_title')) {
function single_product_template_before_title() {
echo '
';
}
}
remove_action('woocommerce_single_product_summary','woocommerce_template_single_price',10);
add_action('woocommerce_single_product_summary','woocommerce_template_single_price',9);
add_action('woocommerce_single_product_summary','single_product_template_after_title',11);
if (!function_exists('single_product_template_after_title')) {
function single_product_template_after_title() {
echo '
';
}
}
add_action('woocommerce_single_product_summary','pylon_available_stock_loop_product',25);
if (!function_exists('pylon_available_stock_loop_product')) {
function pylon_available_stock_loop_product() {
global $product;
if ( $product->is_in_stock() ) {
echo '
' . esc_html__('Available in store', 'pylon') . '
';
}
}
}
remove_action('woocommerce_single_product_summary','woocommerce_template_single_meta',40);
add_action('woocommerce_single_product_summary','woocommerce_template_single_meta',22);
remove_action('woocommerce_single_product_summary','woocommerce_template_single_sharing',50);
// Adding social links
add_action('woocommerce_single_product_summary','pylon_social_link_for_woocommerce',50);
if (!function_exists('pylon_social_link_for_woocommerce')) {
function pylon_social_link_for_woocommerce() {
echo '
' . esc_html__('Share with friends', 'pylon') . '
';
if(function_exists('pylon_post_share_social'))
{
pylon_post_share_social();
}
echo '
';
}
}