Plugin Directory

Changeset 3265668


Ignore:
Timestamp:
04/02/2025 12:53:41 PM (12 months ago)
Author:
expedico
Message:

Improved description in requests to support fulfillment functionality

Location:
expedico
Files:
20 added
4 edited

Legend:

Unmodified
Added
Removed
  • expedico/trunk/ExpedicoAPI.php

    r3111010 r3265668  
    3434                'phone'         => $order->get_billing_phone(),
    3535            ],
    36             'description' => sprintf(__('Order from %1$s no. %2$s', 'expedico'), get_bloginfo('name'), $order->get_order_number()),
     36//          'description' => sprintf(__('Order from %1$s no. %2$s', 'expedico'), get_bloginfo('name'), $order->get_order_number()),
     37            'description' => $this->generate_product_description($order),
    3738//          'weightInKg' => '{weight}',
    3839            'carrierPickupDate' => date('Y-m-d')
     
    151152    }
    152153
     154    private function generate_product_description(\WC_Order $order): string
     155{
     156    $lines = [];
     157
     158    foreach ($order->get_items() as $item) {
     159        $product = $item->get_product();
     160        if (!$product) {
     161            continue;
     162        }
     163
     164        $sku = $product->get_sku() ?: $product->get_name();
     165        $qty = $item->get_quantity();
     166
     167        $lines[] = "{$qty} - {$sku}";
     168    }
     169
     170    return implode(', ', $lines);
     171}
     172
     173
    153174    public function getLabelsPdfString(array $parcelIds): ?string
    154175    {
  • expedico/trunk/expedico.php

    r3263626 r3265668  
    1212 * Plugin Name:         Expedico
    1313 * Description:         Single point for your ecommerce parcel delivery, returns handling and fulfillment service mainly in Eastern Europe.
    14  * Version:             2.0.3
     14 * Version:             2.0.4
    1515 * Author:              Expedico
    1616 * Author URI:          https://expedico.eu
  • expedico/trunk/readme.txt

    r3263626 r3265668  
    22Contributors: Expedico
    33Tags: woocommerce shipping, woocommerce, cross border, delivery
    4 WC tested up to: 8.5
    5 Tested up to: 6.4.2
    6 Stable tag: 2.0.3
     4WC tested up to: 9.7.1
     5Tested up to: 6.7.2
     6Stable tag: 2.0.4
    77Requires PHP: 7.4
    88License: GPLv2
Note: See TracChangeset for help on using the changeset viewer.