콘텐츠로 건너뛰기 사이드바로 건너뛰기

Waiting for author

Topic Tags: Compatibility, WCML

Overview of the issue

When using Bookings and Appointments For WooCommerce Premium with WPML and WCML, it is not possible to add the same bookable product to the cart multiple times.

Attempting to do so results in the message:

“You cannot add another product name to your cart.”

Workaround

Please, make sure of having a full site backup of your site before proceeding.

  • Add the following code to your theme’s functions.php file.
    // WPML Workaround for compsupp-8226 
    add_filter( 'wcml_add_to_cart_sold_individually', function( $allow, $cart_item_data, $post_id, $qty ) {
        $product = wc_get_product( $post_id );
        if ( $product && 'phive_booking' === $product->get_type() ) {
            return false;
        }
        return $allow;
    }, 10, 4 );
            

답글 남기기

주제에 집중하고 다른 사람을 존중해 주세요. 이 게시물과 관련 없는 문제에 도움이 필요하면 지원 포럼을 사용하여 채팅을 시작하거나 티켓을 제출하세요.

다음 태그를 사용할 수 있습니다:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>