Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter vbotto

    (@vbotto)

    Ano, dakujem, hodnotu PointId som si vybral z databazy tak ako pisete, na spocitanie hmotnosti som pouzil funkciu:

    function my_get_total_order_weight( $order_id ) {
    	$order        = wc_get_order( $order_id );
    	$order_items  = $order->get_items();
    	$total_qty    = 0;
        $total_weight = 0; 
        
    	foreach ( $order_items as $item_id => $product_item ) {
    		$product         = $product_item->get_product();
    		if ( ! $product ) continue;
            $product_weight  = $product->get_weight();        
    		    $quantity        = $product_item->get_quantity();
            $total_qty      += $quantity;
            if ($product_weight) {
              $total_weight   += floatval( $product_weight * $quantity );
    	      }
      }
    	return $total_weight;
    }

    A tieto dve hodnoty som nasledne priradil k vlasnostiam objednavky:

    update_post_meta( $order->get_id(), 'zasilkovna_id_pobocky', $zasilkovna_id_pobocky );
    update_post_meta( $order->get_id(), 'zasilkovna_custom_weight', $zasilkovna_custom_weight );

    A vsetko funguje tak ako som potreboval, superfaktura si to z tychto vlastnosti objednavky automaticky zoberie.

    Dakujem.

    Thread Starter vbotto

    (@vbotto)

    Dobry den,

    zda sa, ze zaokruhlovanie naozaj funguje tak ako ste popisovali predtym a hmotnost zostane zaokruhlena na max 3 desatinne miesta a tym padom to prejde v poriadku. Co sa tyka toho mojho predchadzajuceho problemu tak sa zda, ze sme si nie celkom dobre rozumeli pri definovani problemu s klientom a preto vzniklo take mensie nedorozumenie.

    Kazdopadne sprevadzkovanie filtru packeta_create_packet je vyborne doplnenie funkcionality, ktore v buducnosti urcite vyuzijeme. Ak by bol nejaky problem dam potom vediet.

    Dakujem.

    vbotto

    (@vbotto)

    Hello,

    I got also problem with generated avif images by Shortpixel, they act as broken images in Chrome Version 96.0.4664.45 (Official Build) (64-bit).

    You can find original picture here => https://2a2.sk/img/1.png and one that is generated by Shortpixel is here => https://2a2.sk/img/1.avif

    As you can see, it is issue only in Chrome, I can view avif in Firefox and edge too.

    Thread Starter vbotto

    (@vbotto)

    Dokonale! Dakujem, ak by bol nejaky problem, tak dam vediet.

    Thread Starter vbotto

    (@vbotto)

    Ano, rozumiem, plugin ktory sme pre zasielkovnu pouzivali predtym tuto hodnotu automaticky zakruhlil, napriklad ak bola objednavka v hodnote 443.80 CZK, tak do zasilkovne sa poslala dobierka na hodnotu 444.00 CZK.
    Vedeli by ste ma nasmerovat ak by som chcel rovnaku funcionalitu dosiahnut aj pri WPify Woo?

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