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.
*/
declare(strict_types=1);
namespace Magento\Catalog\Block\Product\View\Options\Type\Select;
use Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface;
use Magento\Catalog\Block\Product\View\Options\AbstractOptions;
use Magento\Catalog\Model\Product\Option;
/**
* Represent needed logic for checkbox and radio button option types
*/
class Checkable extends AbstractOptions
{
/**
* @var string
*/
protected $_template = 'Magento_Catalog::product/composite/fieldset/options/view/checkable.phtml';
/**
* Returns formated price
*
* @param ProductCustomOptionValuesInterface $value
* @return string
*/
public function formatPrice(ProductCustomOptionValuesInterface $value): string
{
/** @noinspection PhpMethodParametersCountMismatchInspection */
return parent::_formatPrice(
[
'is_percent' => $value->getPriceType() === 'percent',
'pricing_value' => $value->getPrice($value->getPriceType() === 'percent')
]
);
}
/**
* Returns current currency for store
*
* @param ProductCustomOptionValuesInterface $value
* @return float|string
*/
public function getCurrencyByStore(ProductCustomOptionValuesInterface $value)
{
/** @noinspection PhpMethodParametersCountMismatchInspection */
return $this->pricingHelper->currencyByStore(
$value->getPrice(true),
$this->getProduct()->getStore(),
false
);
}
/**
* Returns preconfigured value for given option
*
* @param Option $option
* @return string|array|null
*/
public function getPreconfiguredValue(Option $option)
{
return $this->getProduct()->getPreconfiguredValues()->getData('options/' . $option->getId());
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\Catalog\Block\Product\View\Options\Type\Select;
use Magento\Catalog\Api\Data\ProductCustomOptionValuesInterface;
use Magento\Catalog\Block\Product\View\Options\AbstractOptions;
use Magento\Catalog\Model\Product\Option;
/**
* Represent needed logic for checkbox and radio button option types
*/
class Checkable extends AbstractOptions
{
/**
* @var string
*/
protected $_template = 'Magento_Catalog::product/composite/fieldset/options/view/checkable.phtml';
/**
* Returns formated price
*
* @param ProductCustomOptionValuesInterface $value
* @return string
*/
public function formatPrice(ProductCustomOptionValuesInterface $value): string
{
/** @noinspection PhpMethodParametersCountMismatchInspection */
return parent::_formatPrice(
[
'is_percent' => $value->getPriceType() === 'percent',
'pricing_value' => $value->getPrice($value->getPriceType() === 'percent')
]
);
}
/**
* Returns current currency for store
*
* @param ProductCustomOptionValuesInterface $value
* @return float|string
*/
public function getCurrencyByStore(ProductCustomOptionValuesInterface $value)
{
/** @noinspection PhpMethodParametersCountMismatchInspection */
return $this->pricingHelper->currencyByStore(
$value->getPrice(true),
$this->getProduct()->getStore(),
false
);
}
/**
* Returns preconfigured value for given option
*
* @param Option $option
* @return string|array|null
*/
public function getPreconfiguredValue(Option $option)
{
return $this->getProduct()->getPreconfiguredValues()->getData('options/' . $option->getId());
}
}
Function Calls
None |
Stats
MD5 | 4943f1a6bac8459dd70a67e7db4678c2 |
Eval Count | 0 |
Decode Time | 131 ms |