Skip to content

Commit e1a766c

Browse files
committed
Fix Oney delivery type
1 parent b2981a6 commit e1a766c

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Event/PayPlugProduct.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use PayPlugModule\Model\PayPlugModuleDeliveryType;
66
use PayPlugModule\PayPlugModule;
7+
use PayPlugOney\PayPlugOney;
78
use Thelia\Core\Translation\Translator;
89
use Thelia\Model\Base\OrderProduct;
910
use Thelia\Model\Base\OrderProductTax;
@@ -50,6 +51,12 @@ public function buildFromOrderProduct(OrderProduct $orderProduct, PayPlugModuleD
5051
);
5152

5253
$deliveryType = $payPlugModuleDeliveryType !== null ? $payPlugModuleDeliveryType->getDeliveryType() : 'carrier';
54+
55+
// For oney payments force the delivery type to 'storepickup'
56+
if (class_exists(PayPlugOney::class) && $orderProduct->getOrder()->getPaymentModuleInstance()->getCode() === PayPlugOney::getModuleCode()) {
57+
$deliveryType = 'storepickup';
58+
}
59+
5360
// Brand can't be find from order product but it's required so set store name as brand or "Unknown"
5461
$this->setBrand($storeName);
5562
$this->setExpectedDeliveryDate(date('Y-m-d'));

0 commit comments

Comments
 (0)