parent
commit
da3d83a833
4 ha cambiato i file con 34 aggiunte e 7 eliminazioni
  1. +4
    -0
      .idea/deployment.xml
  2. +8
    -0
      .idea/sshConfigs.xml
  3. +14
    -0
      .idea/webServers.xml
  4. +8
    -7
      AtlDiscountExtension-main/src/Subscriber/StateMachineTransitionSubscriber.php

+ 4
- 0
.idea/deployment.xml Vedi File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" serverName="Diäko" remoteFilesAllowedToDisappearOnAutoupload="false" />
</project>

+ 8
- 0
.idea/sshConfigs.xml Vedi File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SshConfigs">
<configs>
<sshConfig host="212.72.167.170" id="aac72a36-8230-43df-a5f0-d2ce3e9d4086" keyPath="$USER_HOME$/Desktop/Projekte/id_rsa_nk_spawntree.ppk" port="2342" nameFormat="DESCRIPTIVE" username="spawntree" useOpenSSHConfig="true" />
</configs>
</component>
</project>

+ 14
- 0
.idea/webServers.xml Vedi File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="WebServers">
<option name="servers">
<webServer id="312db2b1-c865-41fb-95c0-f610a09469fe" name="Diäko" url="http://212.72.167.170">
<fileTransfer accessType="SFTP" host="212.72.167.170" port="2342" sshConfigId="aac72a36-8230-43df-a5f0-d2ce3e9d4086" sshConfig="spawntree@212.72.167.170:2342 key" keyPair="true">
<advancedOptions>
<advancedOptions dataProtectionLevel="Private" keepAliveTimeout="0" passiveMode="true" shareSSLContext="true" />
</advancedOptions>
</fileTransfer>
</webServer>
</option>
</component>
</project>

+ 8
- 7
AtlDiscountExtension-main/src/Subscriber/StateMachineTransitionSubscriber.php Vedi File

@@ -77,7 +77,7 @@ class StateMachineTransitionSubscriber implements EventSubscriberInterface
$orderId = $event->getEntityId();
$order = $this->getOrder($orderId, $event);
$salesChannelId = $order->getSalesChannelId();
// In case no order could be found - return
if (empty($order)) {
return;
@@ -85,14 +85,14 @@ class StateMachineTransitionSubscriber implements EventSubscriberInterface

$minAmountDiscountableLineItems = $this->systemConfigService->get('AtlDiscountExtension.config.minAmountDiscountableLineItems', $salesChannelId);
$amountDiscountableLineItems = $this->getAmountDiscountableLineItems($order->getLineItems(), $minAmountDiscountableLineItems, $salesChannelId, $event);
// In case it is not enough - return
if ($amountDiscountableLineItems < $minAmountDiscountableLineItems) {
return;
}
$customer = $order->getOrderCustomer()->getCustomer();
// Tag the customer and trace last order date in 'spwn_repeat_discount' table
$this->tagCustomer($customer, $salesChannelId, $event);
}
@@ -133,11 +133,13 @@ class StateMachineTransitionSubscriber implements EventSubscriberInterface
if ($customFieldName === '') {
return 0;
}
$amountDiscountableLineItems = 0;
foreach($lineItems as $lineItem) {
if (empty($lineItem->getPayload()['customFields'])) {
continue;
}
$customFields = $lineItem->getPayload()['customFields'];

// Checks if the custom field exists and is set to true
if (!empty($customFields[$customFieldName]) && $customFields[$customFieldName] === true) {
$amountDiscountableLineItems += $lineItem->getQuantity();
@@ -148,7 +150,6 @@ class StateMachineTransitionSubscriber implements EventSubscriberInterface
break;
}
}

return $amountDiscountableLineItems;
}



Caricamento…
Annulla
Salva