• Pete

    (@perthmetro)


    I’m using this piece of code in the functions.php to display the product options on the product category page. Unfortunately the extra options overlaps some of the product details. I was hoping someone might have a bit of css that would fix the overlap issue?

    Thanks.

    if ( ! function_exists( 'woocommerce_template_loop_add_to_cart' ) ) {
    
      function woocommerce_template_loop_add_to_cart() {
        global $product;
    
        if ($product->product_type == "variable" && (is_product() || is_product_category() || is_product_tag())) {
          woocommerce_variable_add_to_cart();
        }
        else {
          woocommerce_get_template( 'loop/add-to-cart.php' );
        }
      }
    
    }
    
    remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart'); // remove that ajaxified Add To Cart button that automatically adds 1 item to the cart.
    
    add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 1); // replace it with the Add To Cart Button, complete with QTY field.. the same one that is used on the Single Product page.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Conflicting css’ is closed to new replies.