ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Hide Price (Call for Price) for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\HidePrice\Plugin\Catalog\Model\Option;
|
||||
|
||||
class Value
|
||||
{
|
||||
/**
|
||||
* @var \Amasty\HidePrice\Helper\Data
|
||||
*/
|
||||
private $helper;
|
||||
|
||||
public function __construct(
|
||||
\Amasty\HidePrice\Helper\Data $helper
|
||||
) {
|
||||
$this->helper = $helper;
|
||||
}
|
||||
|
||||
public function afterGetPrice(
|
||||
$subject,
|
||||
$result
|
||||
) {
|
||||
if ($this->helper->isNeedHideProduct($subject->getOption()->getProduct())
|
||||
&& !$subject->getOption()->getDisableHideprice()
|
||||
) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @author Amasty Team
|
||||
* @copyright Copyright (c) Amasty (https://www.amasty.com)
|
||||
* @package Hide Price (Call for Price) for Magento 2
|
||||
*/
|
||||
|
||||
namespace Amasty\HidePrice\Plugin\Catalog\Model\Product\Option\Type;
|
||||
|
||||
use Magento\Catalog\Model\Product\Option\Type\Select;
|
||||
|
||||
class DisableOptionsHidePriceInQuote
|
||||
{
|
||||
/**
|
||||
* @see Select::getOptionPrice()
|
||||
*
|
||||
* @param Select $subject
|
||||
* @param string $result
|
||||
*
|
||||
* @return void
|
||||
* @throws \Magento\Framework\Exception\LocalizedException
|
||||
*/
|
||||
public function beforeGetOptionPrice(Select $subject, string $result): void
|
||||
{
|
||||
$subject->getOption()->setData('disable_hideprice', true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user