• Hi

    Fiddly this, a real pain. For each of the category ages I want to both get rid of the the price, i.e. stop it being shown and change the button wording to just be ‘Read More’.

    This is how the add-to-cart.php looked:

    global $product;

    echo apply_filters( ‘woocommerce_loop_add_to_cart_link’,
    sprintf( ‘<i class=”icon-basket”></i>%s‘,
    esc_url( $product->add_to_cart_url() ),
    esc_attr( $product->id ),
    esc_attr( $product->get_sku() ),
    esc_attr( isset( $quantity ) ? $quantity : 1 ),
    $product->is_purchasable() && $product->is_in_stock() ? ‘add_to_cart_button’ : ”,
    esc_attr( $product->product_type ),
    esc_html( $product->add_to_cart_text() )
    ),
    $product );

    I’ve tried something like this;

    esc_url( $product->add_to_cart_url() ),
    esc_attr( $product->id ),
    esc_attr( $product->get_sku() ),
    esc_attr( isset( $quantity ) ? $quantity : 1 ),
    $product->is_purchasable() && $product->is_in_stock() ? ‘add_to_cart_button’ : ”,
    esc_html( ‘Read More’ ),
    ),
    $product );

    but errors.

    Any ideas on this changing the button text above and also stopping the price being shown.

    I’ve stopped it on the actual product page just need it taken off for the category page?

    Thanks in advance ??

  • The topic ‘Woo commerce – changing add-to-cart.php’ is closed to new replies.