Skip to content

Custom event #76

@ChristopherDosin

Description

@ChristopherDosin

We use plugins for customized products. In this case, for example. These are stored separately in the shopping cart and therefore need a changed UUID. In the current version of your plugin, the following position is called in the CartSubscriber and causes a failed UUID check on these positions.

private function checkProductSerial(LineItem $lineItem, Context $context): void
{
if ($lineItem->getType() !== LineItem::PRODUCT_LINE_ITEM_TYPE) {
return;
}

$this->esdCartService->checkProductsWithSerialKey([$lineItem->getId()], $context);
}

We have now solved the customer's problem by excluding these products from the check by performing a UUID check ourselves and catching the exception.

private function checkProductSerial(LineItem $lineItem, Context $context): void
{
if ($lineItem->getType() !== LineItem::PRODUCT_LINE_ITEM_TYPE) {
return;
}

try {
Uuid::fromHexToBytes($lineItem->getId());
} catch (\Exception $e) {
return;
}

$this->esdCartService->checkProductsWithSerialKey([$lineItem->getId()], $context);
}

It would also be conceivable to install an event for which you can register to prevent the examination. Could you please consider something like this for your next plugin version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions