Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Peter,

    I resolved the problem myself, Woothemes wasn’t very hulpful.
    This needs to be added to QuickCSS to hide the blue (duplicate) order buttons in related products:

    
    .related ul.products a.add_to_cart_button { display:none; } 
    .related ul.products .avia_cart_buttons a.add_to_cart_button { display:block; }
    

    And this is the modified wp-content/plugins/woocommerce/templates/loop/add-to-cart.php:

    
    <?php 
    /** 
    * Loop Add to Cart 
    * 
    * @author WooThemes 
    * @package WooCommerce/Templates 
    * @version 2.1.0 
    */
    
    if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
    
    global $product;
    
    // ## DENIS - 31/07/2014 
    $theurl = ($product->product_type == 'addons' ? $theurl = get_permalink( $product->id ) : $product->add_to_cart_url() );
    
    echo 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>', 
    // ## DENIS - 31/07/2014 
    //esc_url( $product->add_to_cart_url() ), ## ORIGINAL 
    esc_url( $theurl ),
    esc_attr( $product->id ), 
    esc_attr( $product->get_sku() ), 
    $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '', 
    esc_attr( $product->product_type ), 
    esc_html( $product->add_to_cart_text() ) 
    ), 
    $product );
    

    As you can see the Woothemes Products Add-on doesn’t take into account the “addons” product type when constructing the add to cart/view product button.
    That’s all, and produces the desired and correct result.

    Denis.

    Hi Peter,

    I have contacted Woothemes and they are looking into it.
    Thanks for the support.

    Kind regards,

    Denis.

Viewing 2 posts - 1 through 2 (of 2 total)