Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter neudmark

    (@neudmark)

    Solutuion:

    /* Use WPCF7_Submission object's get_posted_data() method to get it. */
    add_action('wpcf7_before_send_mail', 'my_wpcf7_before_send_mail');
    function my_wpcf7_before_send_mail($form) {
      $submission = WPCF7_Submission::get_instance();
      $posted_data = $submission->get_posted_data();
      $_SESSION['your-name'] = $posted_data['your-name'];
    
    }
    Thread Starter neudmark

    (@neudmark)

    This work properly!
    <p><?php $get_total = $order->get_total(); $orderid = $order->get_order_number(); echo "Order ID #$orderid"; ?></p>

    Thread Starter neudmark

    (@neudmark)

    Work fine, when I’m rename functions names.

    add_filter( 'woocommerce_package_rates', 'hide_shipping_based_on_tag1' ,    10, 1 );
    function check_cart_for_share1() {
    // specify the category id's you want to hide local_pickup
     $category_ID = array(
        '98', // lovci snov
     );
    global $woocommerce;
    $cart = $woocommerce->cart->cart_contents;
    $found = false;
    // loop through the array looking for the categories. Switch to true if the category is found.
      foreach ($woocommerce->cart->cart_contents as $key => $values ) {
            $terms = get_the_terms( $values['product_id'], 'product_cat' );
            foreach ($terms as $term) {
                if( in_array( $term->term_id, $category_ID ) ) {
    
            $found = true;
            break;
        }
      }
    }
    return $found;
    }
    
    function hide_shipping_based_on_tag1( $available_methods ) {
    // use the function above to check the cart for the categories.
    if ( check_cart_for_share1() ) {
        // remove the method you want
        unset( $available_methods['flat_rate'] );
    }
    // return the available methods without the one you unset.
    return $available_methods;
    }
    Thread Starter neudmark

    (@neudmark)

    Any ideas?

Viewing 4 replies - 1 through 4 (of 4 total)