First of all, at my /shop page, the button “In den Warenkorb” should redirect to the Single Product Page like on “Weiterlesen” for all products. So that you cant add a product to the cart directly from the shop page.
On my start page at the bottom, there are images for each product category. How can I easily add a mouseover effect to display the same icon in green and not in black.
1. Please create add-to-cart.php file into your child-theme/woocommerce/loop folder
<?php
/**
* Loop Add to Cart
*
* This template can be overridden by copying it to yourtheme/woocommerce/loop/add-to-cart.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
* the readme will list any important changes.
*
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.3.0
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
global $product;
$class = '';
$html = '<a href="%s" data-quantity="%s" class="btn border-grey %s product_type_%s" %s><i class="ico-smallpacket"></i> %s</a>';
// if(etheme_get_option('ajax_addtocart') && $product->is_purchasable() && $product->is_in_stock() > 0 && $product->get_type() == 'simple') {
// $class .= 'etheme_add_to_cart_button ajax_add_to_cart ';
// $html = '<a href="%s" data-quantity="%s" class="add_to_cart_button btn border-grey progress-button %s product_type_%s" %s data-style="shrink" data-horizontal><i class="ico-smallpacket"></i> %s</a>';
// }
echo apply_filters( 'woocommerce_loop_add_to_cart_link', // WPCS: XSS ok.
sprintf( $html,
esc_url( $product->get_permalink() ),
esc_attr( isset( $args['quantity'] ) ? $args['quantity'] : 1 ),
esc_attr( $class ),
esc_attr( $product->get_type() ),
isset( $args['attributes'] ) ? wc_implode_html_attributes( $args['attributes'] ) : '',
esc_html( $product->add_to_cart_text() )
),
$product, $args );
Our mission is to help Internet businesses and their customers interact in a way that mirrors real-world customer experience: personal, human, and fun.
Upload your translation files
Lorem ipsum dolor sit amet consectetur adipisicing elitsed do
Love us as much as we love you?
If you love XStore theme and have something nice to say
don’t hesitate to tell about this! We’d appreciate if you could take a moment to give us 5-stars!