Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #3803487
Configuring
Open

Comments

  •  1
    Marcel started the conversation

    Hi,

    I am configuring WPC Frequently Bought Together. Is it possible, when a product is configured as Bought Together, to change the button 'Add to cart' to 'More Details' in the shop? Because people MUST make a choice and if they press the 'Add to cart' button in de shop they only add that product instead of going to the product page en being forced to choose.

  •  1,355
    Dustin replied

    Hi Marcel,

    Actually, products in the frequently-bought-together list are optional, so we don't change the add-to-cart button by default.

    Please add the custom code below if you still want to change the add-to-cart button. (How to add custom code? ↗):

    add_filter( 'woocommerce_loop_add_to_cart_link', function ( $link, $product ) {
    	if ( ( $items = WPCleverWoobt::instance()->get_items( $product ) ) && ! empty( $items ) ) {
    		$link = sprintf(
    			'<a href="%s" class="button">%s</a>',
    			esc_url( $product->get_permalink() ),
    			esc_html__( 'More Details', 'woo-bought-together' )
    		);
    	}
    
    	return $link;
    }, 10, 2 );

    Best regards,
    Dustin