diff --git a/src/Factory/Consignment/ConsignmentFactory.php b/src/Factory/Consignment/ConsignmentFactory.php index 7c30e852..5c0f652f 100644 --- a/src/Factory/Consignment/ConsignmentFactory.php +++ b/src/Factory/Consignment/ConsignmentFactory.php @@ -271,6 +271,7 @@ private function setRecipient(): void ->setFullStreet($this->orderData['full_street']) ->setPostalCode($this->orderData['postcode']) ->setCity($this->orderData['city']) + ->setRegion($this->orderData['state_name']) ->setEmail($this->getEmailConfiguration()) ->setPhone($this->getPhoneConfiguration()) ->setSaveRecipientAddress(false); @@ -392,10 +393,6 @@ private function setCustomItems(): void $description = $product['product_name']; $itemValue = Tools::ps_round($product['unit_price_tax_incl'] * 100); - if (strlen($description) > Constant::ITEM_DESCRIPTION_MAX_LENGTH) { - $description = substr_replace($description, '...', Constant::ITEM_DESCRIPTION_MAX_LENGTH - 3); - } - $this->consignment->addItem( (new MyParcelCustomsItem()) ->setDescription($description) diff --git a/src/Model/OrderLabel.php b/src/Model/OrderLabel.php index 1d99b44d..f8dea557 100644 --- a/src/Model/OrderLabel.php +++ b/src/Model/OrderLabel.php @@ -314,8 +314,9 @@ public static function getDataForLabelsCreate(array $orderIds) orders.id_order AS id, orders.reference, country.iso_code, - CONCAT(address.firstname, " ",address.lastname) as person, - CONCAT(address.address1, " ", address.address2) as full_street, + state.name AS state_name, + CONCAT(address.firstname, " ",address.lastname) AS person, + CONCAT(address.address1, " ", address.address2) AS full_street, address.postcode, address.city, customer.email, @@ -331,6 +332,7 @@ public static function getDataForLabelsCreate(array $orderIds) $qb->innerJoin('address', 'address', 'orders.id_address_delivery = address.id_address'); $qb->innerJoin('country', 'country', 'country.id_country = address.id_country'); $qb->innerJoin('customer', 'customer', 'orders.id_customer = customer.id_customer'); + $qb->leftJoin('state', 'state', 'state.id_state = address.id_state'); $qb->leftJoin(Table::TABLE_DELIVERY_SETTINGS, 'delivery_settings', 'orders.id_cart = delivery_settings.id_cart'); $qb->where('id_order IN (' . implode(',', $orderIds) . ') ');