Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * Copyright Magento, Inc. All rights reserved. * See COPYING.txt for license ..
Decoded Output download
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Bundle\Model\Plugin;
use Magento\Quote\Model\Quote\Item\ToOrderItem;
use Magento\Sales\Api\Data\OrderItemInterface;
use Magento\Quote\Model\Quote\Item\AbstractItem;
/**
* Plugin for Magento\Quote\Model\Quote\Item\ToOrderItem
*/
class QuoteItem
{
/**
* Add bundle attributes to order data
*
* @param ToOrderItem $subject
* @param OrderItemInterface $orderItem
* @param AbstractItem $item
* @param array $data
* @return OrderItemInterface
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function afterConvert(ToOrderItem $subject, OrderItemInterface $orderItem, AbstractItem $item, $data = [])
{
if ($attributes = $item->getProduct()->getCustomOption('bundle_selection_attributes')) {
$productOptions = $orderItem->getProductOptions();
$productOptions['bundle_selection_attributes'] = $attributes->getValue();
$orderItem->setProductOptions($productOptions);
}
return $orderItem;
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Bundle\Model\Plugin;
use Magento\Quote\Model\Quote\Item\ToOrderItem;
use Magento\Sales\Api\Data\OrderItemInterface;
use Magento\Quote\Model\Quote\Item\AbstractItem;
/**
* Plugin for Magento\Quote\Model\Quote\Item\ToOrderItem
*/
class QuoteItem
{
/**
* Add bundle attributes to order data
*
* @param ToOrderItem $subject
* @param OrderItemInterface $orderItem
* @param AbstractItem $item
* @param array $data
* @return OrderItemInterface
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function afterConvert(ToOrderItem $subject, OrderItemInterface $orderItem, AbstractItem $item, $data = [])
{
if ($attributes = $item->getProduct()->getCustomOption('bundle_selection_attributes')) {
$productOptions = $orderItem->getProductOptions();
$productOptions['bundle_selection_attributes'] = $attributes->getValue();
$orderItem->setProductOptions($productOptions);
}
return $orderItem;
}
}
Function Calls
None |
Stats
MD5 | 4b0dafadf2cede247b0714b99623c0b2 |
Eval Count | 0 |
Decode Time | 117 ms |