Подршка » Додаци и унапређења » WooCommerce » wc marketplace prilagoodjeno slanje po prodavcu

  • Pozdrav, radim sajt sa pluginom wc marketplace gde se korsnici registruju i postavljaju svoje proizvode na prodaju.Hteo bih da prodavac moze da odredi svoju cenu dostave na osnovu zbira u korpi i destinaciji. Pronasao sam kako da menjam cenu dostave ali ne znam kako da ta decan bude meta podatak prodavca posto bi ona tamo cuvala.
    Ovo je kod koji mi izvaci id proizvodjaca u korpi sad bi hteo da preko get_user_met izvucem cenu koju bi stavio za cenu dosatve.
    // vendor id prozvoda u korpi i sa bi teo da
    global $woocommerce;
    foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ){
    $post_obj = get_post( $cart_item[‘product_id’] ); // The WP_Post object
    echo $post_author = $post_obj->post_author; // <=== The post author ID
    }

Посматрање 9 одговора - 1 до 9 (од укупно 9)
  • Hi @jefimijaorg, do you want to set shipping fee from seller’s location to customer’s ?

    Thread Starter jefimijaorg

    (@jefimijaorg)

    I apologize for losing English. Yes, I want the seller to determine the price of shipping. The price would be in the user’s meta. In addition, I need the code for the total price of the vendors in the basket.Here’s the picture I want to do. There would be a special way of delivery, so I know how to do it. It’s only important for me to find the seller’s id https://sr-rs.imgbb.com/

    • Овај одговор је промењен 5 years, 10 months раније од стране jefimijaorg.
    • Овај одговор је промењен 5 years, 10 months раније од стране jefimijaorg.

    Hi @jefimijaorg, do you want to fetch the vendor_id from the order? I am afraid the link you have shared, doesn’t have any image with it.

    Thread Starter jefimijaorg

    (@jefimijaorg)

    @jefimijaorg, you have to fetch the author_id from the product_id, the get the vendor_id from that author_id.

    Thread Starter jefimijaorg

    (@jefimijaorg)

    That it’s ok, but where can I put that code? What’s the hook for something like that where to change? How do I get the product ID in the cart I know, but I do not know how to display it where I marked it

    Hi @jefimijaorg you have to add these code in the function.php of the current active theme. Please look into this forums, they will be able to help you out further on this: https://stackoverflow.com/questions/27385920/woocommerce-get-current-product-id and this document: https://docs.woocommerce.com/wc-apidocs/hook-docs.html

    Thread Starter jefimijaorg

    (@jefimijaorg)

    Ocito se ne razumemo. Ja pisem prevod preko googl-a pa je moguce da je zato.Izvucem ja id od vendora koji su u korpi. To je ovaj kod global $woocommerce;
    // For all Woocommerce versions
    foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ){
    $post_obj = get_post( $cart_item[‘product_id’] ); // The WP_Post object
    $post_author[] = $post_obj->post_author; // <=== The post author ID
    }
    $states = array_unique($post_author);
    foreach ($states as $vendor)

    echo $vendor;
    i kad ubacim da mi menja cenu transporta vuce samo za prvog ali ne i za sve koji su u korpi. Da li je sad jasnije sta zelim da postignem?

    Thread Starter jefimijaorg

    (@jefimijaorg)

    We obviously do not understand. I can not translate it through googl so it is possible that is why. I’m the id of the vendors who are in the basket. This is this code in
    -`global $woocommerce;
    // For all Woocommerce versions
    foreach( WC()->cart->get_cart() as $cart_item_key => $cart_item ){
    $post_obj = get_post( $cart_item[‘product_id’] ); // The WP_Post object
    $post_author[] = $post_obj->post_author; // <=== The post author ID
    }
    $product_vendor = array_unique($post_author);
    foreach ($product_vendor as $vendor)
    {
    echo $vendor;
    }`
    and when I add that the price of the tug cargo is only for the first but not for everyone in the cargo. Now, is there any clearer I want to achieve?

    • Овај одговор је промењен 5 years, 10 months раније од стране jefimijaorg.
Посматрање 9 одговора - 1 до 9 (од укупно 9)
  • Тема „wc marketplace prilagoodjeno slanje po prodavcu„ је закључана за нове одговоре.