Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BF-200 remove block classes, switch to view models #112

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 31 additions & 32 deletions Block/Checkout/Minicart.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
use Magento\Catalog\Block\ShortcutInterface;
use Magento\Checkout\Model\Session;
use Magento\Framework\Locale\ResolverInterface;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;
use Magento\Payment\Model\MethodInterface;
use Bread\BreadCheckout\Helper\Data;
use Magento\Framework\Serialize\Serializer\Json;

class Minicart extends Overview implements ShortcutInterface
class Minicart extends Template implements ShortcutInterface
{
const ALIAS_ELEMENT_INDEX = 'alias';

Expand All @@ -28,13 +30,19 @@ class Minicart extends Overview implements ShortcutInterface
/**
* @var Data
*/
private $helperData;
public $helperData;

/**
* @var \Bread\BreadCheckout\Helper\Quote
*/
public $quoteHelper;

public $catalogHelper;

public $customerHelper;

public $serializer;

/**
* Minicart constructor.
*
Expand All @@ -50,45 +58,25 @@ public function __construct(
\Magento\Framework\Json\Helper\Data $jsonHelper,
\Bread\BreadCheckout\Helper\Catalog $catalogHelper,
\Bread\BreadCheckout\Helper\Customer $customerHelper,
\Bread\BreadCheckout\Helper\Data $dataHelper,
\Magento\ConfigurableProduct\Model\Product\Type\ConfigurableFactory $configurableProductFactory,
\Magento\ConfigurableProduct\Block\Product\View\Type\ConfigurableFactory $configurableBlockFactory,
\Bread\BreadCheckout\Helper\Data $helperData,
\Bread\BreadCheckout\Helper\Quote $quoteHelper,
\Magento\Framework\Stdlib\ArrayUtils $arrayUtils,
\Magento\Framework\Json\EncoderInterface $jsonEncoder,
\Magento\ConfigurableProduct\Helper\Data $configurableHelper,
\Magento\Catalog\Helper\Product $catalogProductHelper,
\Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer,
\Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency,
\Magento\ConfigurableProduct\Model\ConfigurableAttributeData $configurableAttributeData,
Session $checkoutSession,
MethodInterface $payment,
Data $helperData,
Json $serializer,
array $data = []
) {
parent::__construct(
$context,
$jsonHelper,
$catalogHelper,
$customerHelper,
$dataHelper,
$configurableProductFactory,
$configurableBlockFactory,
$quoteHelper,
$arrayUtils,
$jsonEncoder,
$configurableHelper,
$catalogProductHelper,
$currentCustomer,
$priceCurrency,
$configurableAttributeData,
$data
);

$this->checkoutSession = $checkoutSession;
$this->payment = $payment;
$this->helperData = $helperData;
$this->quoteHelper = $quoteHelper;
$this->catalogHelper = $catalogHelper;
$this->customerHelper = $customerHelper;
$this->serializer = $serializer;

parent::__construct(
$context,
$data
);
}

/**
Expand Down Expand Up @@ -141,4 +129,15 @@ private function isCartView()
{
return in_array('checkout_cart_index', $this->getLayout()->getUpdate()->getHandles());
}

/**
* Get Extra Button Design CSS
*
* @return mixed
*/
public function getButtonDesign()
{
$design = $this->escapeCss($this->catalogHelper->getCartButtonDesign());
return $design ? $design : $this->catalogHelper->getPDPButtonDesign();
}
}
202 changes: 0 additions & 202 deletions Block/Checkout/Overview.php

This file was deleted.

Loading