get_order_number() ); $date = Helpers::date( $order ); $custName = trim( $order->get_formatted_billing_full_name() ); $shipAddr = $order->get_formatted_shipping_address(); $shipAddr = $shipAddr ? $shipAddr : $order->get_formatted_billing_address(); $postcode = $order->get_shipping_postcode() ?: $order->get_billing_postcode(); $phone = Helpers::recipientPhone( $order ); ?>


get_items() as $item ) : ?> get_product(); $sku = $product && $product->get_sku() ? $product->get_sku() : ''; // Both figures ex-tax, so unit × quantity reconciles with the // ex-tax subtotal below. Unit is the list price before any // line discount; the line total is after it. $unit = (float) $order->get_item_subtotal( $item, false, true ); $lineTot = (float) $order->get_line_total( $item, false, true ); ?>
get_name() ); ?>
get_quantity() ) ); ?>
get_total_discount() > 0 ) : ?> get_shipping_total() > 0 || $order->get_shipping_method() ) : ?>
get_subtotal() ) ); ?>
−get_total_discount() ) ); ?>
get_shipping_method() ) : ?> (get_shipping_method() ); ?>) : get_shipping_total() ) ); ?>
get_total() ) ); ?>
get_customer_note() ) : ?>
get_customer_note() ); ?>
—
get_formatted_shipping_full_name() ); $name = '' !== $name ? $name : trim( $order->get_formatted_billing_full_name() ); $country = $order->get_shipping_country() ?: $order->get_billing_country(); $state = Helpers::stateName( $country, $order->get_shipping_state() ?: $order->get_billing_state() ); $city = $order->get_shipping_city() ?: $order->get_billing_city(); $phone = Helpers::recipientPhone( $order ); $addr1 = $order->get_shipping_address_1() ?: $order->get_billing_address_1(); $addr2 = $order->get_shipping_address_2() ?: $order->get_billing_address_2(); $addr = trim( $addr1 . ( '' !== $addr2 ? '، ' . $addr2 : '' ) ); $postcode = $order->get_shipping_postcode() ?: $order->get_billing_postcode(); $scissors = ''; /** * Filters the footer line on the classic invoice. * * @param string $footer Footer text. */ $footer = (string) apply_filters( 'rahkar_wp_print_invoice_footer', (string) get_bloginfo( 'description' ) ); $currency = __( 'تومان', 'rahkar-toolkit' ); ?>

get_order_number() ) ); ?>
get_items() as $item ) : ?> get_product(); $code = $product ? ( $product->get_sku() ?: (string) $product->get_id() ) : ''; $unitList = (float) $order->get_item_subtotal( $item, false, true ); $unitPaid = (float) $order->get_item_total( $item, false, true ); $lineTot = (float) $order->get_line_total( $item, false, true ); ?>
get_name() ); ?> get_quantity() ) ); ?> $unitPaid ) : ?>
get_shipping_method() ) { echo ' - ' . esc_html( $order->get_shipping_method() ); } echo ':'; ?> get_shipping_total() ) . ' ' . $currency ); ?>
get_payment_method_title() ); ?>
get_total() ) . ' ' . $currency ); ?>
get_order_number() ); $name = trim( $order->get_formatted_shipping_full_name() ); $name = '' !== $name ? $name : trim( $order->get_formatted_billing_full_name() ); $addr = $order->get_formatted_shipping_address(); $addr = $addr ? $addr : $order->get_formatted_billing_address(); $postcode = $order->get_shipping_postcode() ?: $order->get_billing_postcode(); $phone = Helpers::recipientPhone( $order ); $tracking = Helpers::trackingNumber( $order ); ?>

get_order_number(); $orderDate = Helpers::date( $order ); // The print date is when this label is produced, which is what a dispatch // desk cares about. The order's own date stays on the invoice. $printDate = Helpers::date( time(), true ); $isCompact = $heightMm < 90; $classes = 'alabel' . ( $isCompact ? ' alabel--compact' : '' ) . ( $oneCol ? ' alabel--onecol' : '' ); $hasHead = ( $showLogo && '' !== $logo ) || $showOid || ( $showOdate && '' !== $orderDate ); // Without rotation the width is pinned and the height is content-defined, // so a long order flows onto the next label. With rotation the content box // keeps its natural size but is turned inside a swapped-size wrapper that // owns the page break — which is how a printer whose driver refuses to // rotate still produces an upright label. if ( 0 !== $rotate ) { $boxStyle = sprintf( 'position:absolute;top:0;left:0;width:%dmm;height:%dmm;--logo-w:%dmm;overflow:hidden;transform-origin:top left;%s', $widthMm, $heightMm, $logoWmm, 90 === $rotate ? sprintf( 'transform:translateX(%dmm) rotate(90deg)', $heightMm ) : sprintf( 'transform:translateY(%dmm) rotate(-90deg)', $widthMm ) ); $wrapStyle = sprintf( 'position:relative;width:%dmm;height:%dmm;overflow:hidden;page-break-after:always', $heightMm, $widthMm ); } else { $boxStyle = sprintf( 'width:%dmm;--logo-w:%dmm', $widthMm, $logoWmm ); $wrapStyle = ''; } // The address is assembled from its parts rather than taken from // WooCommerce's formatted address, which repeats the name and postcode and // appends the country — each of which appears exactly once here. $name = trim( $order->get_formatted_shipping_full_name() ); $name = '' !== $name ? $name : trim( $order->get_formatted_billing_full_name() ); $country = $order->get_shipping_country() ?: $order->get_billing_country(); $state = Helpers::stateName( $country, $order->get_shipping_state() ?: $order->get_billing_state() ); $city = $order->get_shipping_city() ?: $order->get_billing_city(); $addr1 = $order->get_shipping_address_1() ?: $order->get_billing_address_1(); $addr2 = $order->get_shipping_address_2() ?: $order->get_billing_address_2(); $address = implode( '، ', array_filter( [ $state, $city, $addr1, $addr2 ] ) ); $postcode = $order->get_shipping_postcode() ?: $order->get_billing_postcode(); $phone = Helpers::recipientPhone( $order ); $note = $order->get_customer_note(); ?>

get_items() as $item ) : ?>
get_name() ); ?> get_quantity() ) ); ?>
> */ private static function svgTags(): array { $attrs = [ 'viewbox' => true, 'fill' => true, 'stroke' => true, 'stroke-width' => true, 'stroke-linecap' => true, 'stroke-linejoin' => true, 'aria-hidden' => true, 'cx' => true, 'cy' => true, 'r' => true, 'x1' => true, 'y1' => true, 'x2' => true, 'y2' => true, ]; return [ 'svg' => $attrs, 'circle' => $attrs, 'line' => $attrs, ]; } }