Skip to content

Commit

Permalink
magento#108: Clear Shopping Cart - Refactor to fix Static Tests faile…
Browse files Browse the repository at this point in the history
…d result
  • Loading branch information
John Carlo Octabio committed Jun 9, 2020
1 parent 2c4ee78 commit 7dad27c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 5 additions & 3 deletions app/code/Magento/Checkout/Block/Cart/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ protected function _construct()
}

/**
* {@inheritdoc}
* @inheritdoc
*
* @since 100.2.0
*/
protected function _prepareLayout()
Expand Down Expand Up @@ -151,7 +152,8 @@ public function getItemsForGrid()
}

/**
* {@inheritdoc}
* @inheritdoc
*
* @since 100.2.0
*/
public function getItems()
Expand Down Expand Up @@ -187,7 +189,7 @@ private function isPagerDisplayedOnPage()
*/
public function isClearShoppingCartEnabled()
{
return (bool) $this->_scopeConfig->getValue(
return (bool)$this->_scopeConfig->getValue(
self::XPATH_CONFIG_ENABLE_CLEAR_SHOPPING_CART,
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class="form form-cart">
<?= $block->getBlockHtml('formkey') ?>
<div class="cart table-wrapper<?= $mergedCells == 2 ? ' detailed' : '' ?>">
<?php if ($block->getPagerHtml()) :?>
<?php if ($block->getPagerHtml()): ?>
<div class="cart-products-toolbar cart-products-toolbar-top toolbar"
data-attribute="cart-products-toolbar-top"><?= $block->getPagerHtml() ?>
</div>
Expand All @@ -38,25 +38,25 @@
<th class="col subtotal" scope="col"><span><?= $block->escapeHtml(__('Subtotal')) ?></span></th>
</tr>
</thead>
<?php foreach ($block->getItems() as $_item) :?>
<?php foreach ($block->getItems() as $_item): ?>
<?= $block->getItemHtml($_item) ?>
<?php endforeach ?>
</table>
<?php if ($block->getPagerHtml()) :?>
<?php if ($block->getPagerHtml()): ?>
<div class="cart-products-toolbar cart-products-toolbar-bottom toolbar"
data-attribute="cart-products-toolbar-bottom"><?= $block->getPagerHtml() ?>
</div>
<?php endif ?>
</div>
<div class="cart main actions">
<?php if ($block->getContinueShoppingUrl()) :?>
<?php if ($block->getContinueShoppingUrl()): ?>
<a class="action continue"
href="<?= $block->escapeUrl($block->getContinueShoppingUrl()) ?>"
title="<?= $block->escapeHtml(__('Continue Shopping')) ?>">
<span><?= $block->escapeHtml(__('Continue Shopping')) ?></span>
</a>
<?php endif; ?>
<?php if ($block->isClearShoppingCartEnabled()) :?>
<?php if ($block->isClearShoppingCartEnabled()): ?>
<button type="button"
name="update_cart_action"
data-cart-empty=""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ define([
* Display confirmation modal for clearing the cart
* @private
*/
_clearCartConfirmation: function() {
_clearCartConfirmation: function () {
var self = this;

confirm({
Expand All @@ -80,7 +80,7 @@ define([
* Prepares the form and submit to clear the cart
* @public
*/
clearCart: function() {
clearCart: function () {
$(this.options.emptyCartButton).attr('name', 'update_cart_action_temp');
$(this.options.updateCartActionContainer)
.attr('name', 'update_cart_action').attr('value', 'empty_cart');
Expand Down

0 comments on commit 7dad27c

Please sign in to comment.