WP Okulu Soru & Cevap

Aradığınız cevaplara buradan ulaşabilirsiniz...

WP Kulüp Forums Genel CF7 WooCommerce Integration

  • CF7 WooCommerce Integration

    Bu yazı Fikret Tozak tarafından oluşturuldu 03/02/2022 at 01:34

    1- JS code for Page

    <script>
    document.addEventListener( 'wpcf7mailsent', function( event ) {
      if (document.getElementsByName("radio-232")[0].checked){location = 'https://learn.sb1.wpokulu.club/?add-to-cart=14';}
      if (document.getElementsByName("radio-232")[1].checked){location = 'https://learn.sb1.wpokulu.club/?add-to-cart=16';}
      if (document.getElementsByName("radio-232")[2].checked){location = 'https://learn.sb1.wpokulu.club/?add-to-cart=15';}
    }, false );
    </script>

     

    2- PHP code for redirect Checkout Page

    // Woocommerce redirect after add to cart push
    function bbloomer_redirect_checkout_add_cart( $url ) {
        $url = get_permalink( get_option( 'woocommerce_checkout_page_id' ) ); 
        return $url;
    }
    add_filter( 'woocommerce_add_to_cart_redirect', 'bbloomer_redirect_checkout_add_cart' );
    add_filter( 'woocommerce_subscription_add_to_cart', 'bbloomer_redirect_checkout_add_cart' );

    3- PHP code for only one product in cart

    // before addto cart, only allow 1 item in a cart
    add_filter( 'woocommerce_add_to_cart_validation', 'woo_custom_add_to_cart_before' );
     
    function woo_custom_add_to_cart_before( $cart_item_data ) {
     
        global $woocommerce;
        $woocommerce->cart->empty_cart();
     
        // Do nothing with the data and return
        return true;
    }

     

    https://youtu.be/D5C2n8ecLys

    Silinmiş Kullanıcı cevapladı 3 yıllar, 2 ay önce 2 Üye · 1 Reply
  • 1 Reply
  • Silinmiş Kullanıcı

    Silinmiş Kullanıcı
    03/02/2022 at 08:42

    👏

Log in to reply.

Gün :
Saat :
Dakika :
Saniye

Hoşgeldin !
Seni Tekrar Aramızda Görmek İstiyoruz

WP Kulüp
840TL İndirim

WP Kulüp BAŞVURU

WP Kulüp hakkında daha fazla bilgi almak istediğinizi duyduk.

Size uygun yol haritasını oluşturmak için bilgilerinizi bırakın uzmanlarımız sizi arasın.