Skip to content

Commit

Permalink
Merge branch '2.4-develop' of https://github.com/mage-os/mirror-magento2
Browse files Browse the repository at this point in the history
 into 2.4-develop
  • Loading branch information
mage-os-ci committed Feb 18, 2025
2 parents 9af15f7 + 2b17d9b commit 7067cda
Show file tree
Hide file tree
Showing 49 changed files with 1,227 additions and 838 deletions.
3 changes: 3 additions & 0 deletions app/code/Magento/Catalog/Helper/Product/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,19 @@ public function initProductLayout(ResultPage $resultPage, $product, $params = nu
if ($params && $params->getBeforeHandles()) {
foreach ($params->getBeforeHandles() as $handle) {
$resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], $handle, false);
$resultPage->addPageLayoutHandles(['attribute_set' => $product->getAttributeSetId()], $handle, false);
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle);
}
}

$resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], null, false);
$resultPage->addPageLayoutHandles(['attribute_set' => $product->getAttributeSetId()], null, false);
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku]);

if ($params && $params->getAfterHandles()) {
foreach ($params->getAfterHandles() as $handle) {
$resultPage->addPageLayoutHandles(['type' => $product->getTypeId()], $handle, false);
$resultPage->addPageLayoutHandles(['attribute_set' => $product->getAttributeSetId()], $handle, false);
$resultPage->addPageLayoutHandles(['id' => $product->getId(), 'sku' => $urlSafeSku], $handle);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2014 Adobe
* All Rights Reserved.
*/

namespace Magento\CatalogInventory\Model;
Expand Down Expand Up @@ -159,7 +159,7 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQ
if (!$stockItem->getIsInStock()) {
$result->setHasError(true)
->setErrorCode('out_stock')
->setMessage(__('This product is out of stock.'))
->setMessage(__('Product %name is out of stock.', ['name' => $stockItem->getProductName()]))
->setQuoteMessage(__('Some of the products are out of stock.'))
->setQuoteMessageIndex('stock');
$result->setItemUseOldQty(true);
Expand Down
1 change: 1 addition & 0 deletions app/code/Magento/CatalogInventory/i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,4 @@ Stock,Stock
"Only %s of %s available","Only %s of %s available"
"Not enough items for sale","Not enough items for sale"
"The requested qty. is not available","The requested qty. is not available"
"Product %name is out of stock.","Product %name is out of stock."
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2024 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

Expand Down Expand Up @@ -62,7 +62,6 @@ protected function setUp(): void
* Test After Deploy method of plugin
*
* @return void
* @doesNotPerformAssertions
*/
public function testAfterDeploy(): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2023 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

Expand Down Expand Up @@ -433,8 +433,6 @@ public function testBeforeCreateAccount(
): void {
if ($willThrowException) {
$this->expectException(AuthorizationException::class);
} else {
$this->expectNotToPerformAssertions();
}
$this->authorizationMock
->expects($this->once())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2023 Adobe
* All Rights Reserved.
*/
declare(strict_types=1);

Expand Down Expand Up @@ -86,7 +86,6 @@ public function testBeforePublishMass(
[$customer, 'Password1', '']
];
$this->authorizationMock
->expects($this->once())
->method('isAllowed')
->with('Magento_Customer::manage')
->willReturn($isAllowed);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,60 +1,67 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2017 Adobe
* All Rights Reserved.
*/

/** @var \Magento\Customer\Block\Address\Book $block */
/** @var \Magento\Framework\Escaper $escaper */
?>
<div class="block block-addresses-default">
<div class="block-title"><strong><?= $block->escapeHtml(__('Default Addresses')) ?></strong></div>
<div class="block-title"><strong><?= $escaper->escapeHtml(__('Default Addresses')) ?></strong></div>
<div class="block-content">
<?php if ($_pAddsses = $block->getDefaultBilling()) : ?>
<?php if ($defaultBillingAddress = $block->getDefaultBilling()): ?>
<div class="box box-address-billing">
<strong class="box-title">
<span><?= $block->escapeHtml(__('Default Billing Address')) ?></span>
<span><?= $escaper->escapeHtml(__('Default Billing Address')) ?></span>
</strong>
<div class="box-content">
<address>
<?= $block->getAddressHtml($block->getAddressById($_pAddsses)) ?>
<?= $block->getAddressHtml($block->getAddressById($defaultBillingAddress)) ?>
</address>
</div>
<div class="box-actions">
<a class="action edit" href="<?= $block->escapeUrl($block->getAddressEditUrl($_pAddsses)) ?>">
<span><?= $block->escapeHtml(__('Change Billing Address')) ?></span>
<a class="action edit"
href="<?= $escaper->escapeUrl($block->getAddressEditUrl($defaultBillingAddress)) ?>">
<span><?= $escaper->escapeHtml(__('Change Billing Address')) ?></span>
</a>
</div>
</div>
<?php else : ?>
<?php else: ?>
<div class="box box-billing-address">
<strong class="box-title"><span><?= $block->escapeHtml(__('Default Billing Address')) ?></span></strong>
<strong class="box-title">
<span><?= $escaper->escapeHtml(__('Default Billing Address')) ?></span>
</strong>
<div class="box-content">
<p><?= $block->escapeHtml(__('You have no default billing address in your address book.')) ?></p>
<p><?= $escaper->escapeHtml(__('You have no default billing address in your address book.')) ?></p>
</div>
</div>
<?php endif ?>

<?php if ($_pAddsses = $block->getDefaultShipping()) : ?>
<?php if ($defaultShippingAddress = $block->getDefaultShipping()): ?>
<div class="box box-address-shipping">
<strong class="box-title">
<span><?= $block->escapeHtml(__('Default Shipping Address')) ?></span>
<span><?= $escaper->escapeHtml(__('Default Shipping Address')) ?></span>
</strong>
<div class="box-content">
<address>
<?= $block->getAddressHtml($block->getAddressById($_pAddsses)) ?>
<?= $block->getAddressHtml($block->getAddressById($defaultShippingAddress)) ?>
</address>
</div>
<div class="box-actions">
<a class="action edit" href="<?= $block->escapeUrl($block->getAddressEditUrl($_pAddsses)) ?>">
<span><?= $block->escapeHtml(__('Change Shipping Address')) ?></span>
<a class="action edit"
href="<?= $escaper->escapeUrl($block->getAddressEditUrl($defaultShippingAddress)) ?>">
<span><?= $escaper->escapeHtml(__('Change Shipping Address')) ?></span>
</a>
</div>
</div>
<?php else : ?>
<?php else: ?>
<div class="box box-shipping-address">
<strong class="box-title"><span><?= $block->escapeHtml(__('Default Shipping Address')) ?></span></strong>
<strong class="box-title">
<span><?= $escaper->escapeHtml(__('Default Shipping Address')) ?></span>
</strong>
<div class="box-content">
<p><?= $block->escapeHtml(__('You have no default shipping address in your address book.')) ?></p>
<p><?= $escaper->escapeHtml(__('You have no default shipping address in your address book.')) ?></p>
</div>
</div>
<?php endif ?>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,79 +1,112 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2017 Adobe
* All Rights Reserved.
*/

/** @var \Magento\Customer\Block\Address\Grid $block */
/** @var \Magento\Framework\Escaper $escaper */
$customerAddressView = $block->getData('customer_address');
?>

<div class="block block-addresses-list">
<div class="block-title"><strong><?= $block->escapeHtml(__('Additional Address Entries')) ?></strong></div>
<div class="block-title"><strong><?= $escaper->escapeHtml(__('Additional Address Entries')) ?></strong></div>
<div class="block-content">
<?php if ($_pAddsses = $block->getAdditionalAddresses()) : ?>

<?php if ($additionalAddresses = $block->getAdditionalAddresses()): ?>
<div class="table-wrapper additional-addresses">
<table class="data table table-additional-addresses-items history" id="additional-addresses-table">
<caption class="table-caption"><?= $block->escapeHtml(__('Additional addresses')) ?></caption>
<caption class="table-caption"><?= $escaper->escapeHtml(__('Additional addresses')) ?></caption>
<thead>
<tr>
<th scope="col" class="col firstname"><?= $block->escapeHtml(__('First Name')) ?></th>
<th scope="col" class="col lastname"><?= $block->escapeHtml(__('Last Name')) ?></th>
<th scope="col" class="col streetaddress"><?= $block->escapeHtml(__('Street Address')) ?></th>
<th scope="col" class="col city"><?= $block->escapeHtml(__('City')) ?></th>
<th scope="col" class="col country"><?= $block->escapeHtml(__('Country')) ?></th>
<th scope="col" class="col state"><?= $block->escapeHtml(__('State')) ?></th>
<th scope="col" class="col zip"><?= $block->escapeHtml(__('Zip/Postal Code')) ?></th>
<th scope="col" class="col phone"><?= $block->escapeHtml(__('Phone')) ?></th>
<th scope="col" class="col firstname"><?= $escaper->escapeHtml(__('First Name')) ?></th>
<th scope="col" class="col lastname"><?= $escaper->escapeHtml(__('Last Name')) ?></th>
<th scope="col" class="col streetaddress"><?= $escaper->escapeHtml(__('Street Address')) ?></th>
<th scope="col" class="col city"><?= $escaper->escapeHtml(__('City')) ?></th>
<th scope="col" class="col country"><?= $escaper->escapeHtml(__('Country')) ?></th>
<th scope="col" class="col state"><?= $escaper->escapeHtml(__('State')) ?></th>
<th scope="col" class="col zip"><?= $escaper->escapeHtml(__('Zip/Postal Code')) ?></th>
<th scope="col" class="col phone"><?= $escaper->escapeHtml(__('Phone')) ?></th>
<th scope="col" class="col actions"> </th>
</tr>
</thead>
<tbody>
<?php foreach ($_pAddsses as $address) : ?>
<?php foreach ($additionalAddresses as $address): ?>
<tr>
<td data-th="<?= $block->escapeHtml(__('First Name')) ?>" class="col firstname"><?= $block->escapeHtml($address->getFirstname()) ?></td>
<td data-th="<?= $block->escapeHtml(__('Last Name')) ?>" class="col lastname"><?= $block->escapeHtml($address->getLastname()) ?></td>
<td data-th="<?= $block->escapeHtml(__('Street Address')) ?>" class="col streetaddress"><?= $block->escapeHtml($block->getStreetAddress($address)) ?></td>
<td data-th="<?= $block->escapeHtml(__('City')) ?>" class="col city"><?= $block->escapeHtml($address->getCity()) ?></td>
<td data-th="<?= $block->escapeHtml(__('Country')) ?>" class="col country"><?= $block->escapeHtml($block->getCountryByCode($address->getCountryId())) ?></td>
<td data-th="<?= $block->escapeHtml(__('State')) ?>" class="col state"><?= $block->escapeHtml($address->getRegion()->getRegion()) ?></td>
<td data-th="<?= $block->escapeHtml(__('Zip/Postal Code')) ?>" class="col zip"><?= $block->escapeHtml($address->getPostcode()) ?></td>
<td data-th="<?= $block->escapeHtml(__('Phone')) ?>" class="col phone"><?= $block->escapeHtml($address->getTelephone()) ?></td>
<td data-th="<?= $block->escapeHtml(__('Actions')) ?>" class="col actions">
<a class="action edit" href="<?= $block->escapeUrl($block->getUrl('customer/address/edit', ['id' => $address->getId()])) ?>"><span><?= $block->escapeHtml(__('Edit')) ?></span></a>
<a class="action delete" href="#" role="delete-address" data-address="<?= $block->escapeHtmlAttr($address->getId()) ?>"><span><?= $block->escapeHtml(__('Delete')) ?></span></a>
<td data-th="<?= $escaper->escapeHtml(__('First Name')) ?>" class="col firstname">
<?= $escaper->escapeHtml($address->getFirstname()) ?>
</td>
<td data-th="<?= $escaper->escapeHtml(__('Last Name')) ?>" class="col lastname">
<?= $escaper->escapeHtml($address->getLastname()) ?>
</td>
<td data-th="<?= $escaper->escapeHtml(__('Street Address')) ?>" class="col streetaddress">
<?= $escaper->escapeHtml($block->getStreetAddress($address)) ?>
</td>
<td data-th="<?= $escaper->escapeHtml(__('City')) ?>" class="col city">
<?= $escaper->escapeHtml($address->getCity()) ?>
</td>
<td data-th="<?= $escaper->escapeHtml(__('Country')) ?>" class="col country">
<?= $escaper->escapeHtml($block->getCountryByCode($address->getCountryId())) ?>
</td>
<td data-th="<?= $escaper->escapeHtml(__('State')) ?>" class="col state">
<?= $escaper->escapeHtml($address->getRegion()->getRegion()) ?>
</td>
<td data-th="<?= $escaper->escapeHtml(__('Zip/Postal Code')) ?>" class="col zip">
<?= $escaper->escapeHtml($address->getPostcode()) ?>
</td>
<td data-th="<?= $escaper->escapeHtml(__('Phone')) ?>" class="col phone">
<?= $escaper->escapeHtml($address->getTelephone()) ?>
</td>
<td data-th="<?= $escaper->escapeHtml(__('Actions')) ?>" class="col actions">
<a class="action edit" href="
<?= $escaper->escapeUrl(
$block->getUrl('customer/address/edit', ['id' => $address->getId()])
) ?>">
<span><?= $escaper->escapeHtml(__('Edit')) ?></span>
</a>
<a class="action delete"
href="#" role="delete-address"
data-address="<?= $escaper->escapeHtmlAttr($address->getId()) ?>">
<span><?= $escaper->escapeHtml(__('Delete')) ?></span>
</a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php if ($block->getChildHtml('pager')) : ?>
<?php if ($block->getChildHtml('pager')): ?>
<div class="customer-addresses-toolbar toolbar bottom"><?= $block->getChildHtml('pager') ?></div>
<?php endif ?>
<?php else : ?>
<p class="empty"><?= $block->escapeHtml(__('You have no other address entries in your address book.')) ?></p>
<?php else: ?>
<p class="empty">
<?= $escaper->escapeHtml(__('You have no other address entries in your address book.')) ?>
</p>
<?php endif ?>
</div>
</div>

<div class="actions-toolbar">
<div class="primary">
<button type="button" role="add-address" title="<?= $block->escapeHtmlAttr(__('Add New Address')) ?>" class="action primary add"><span><?= $block->escapeHtml(__('Add New Address')) ?></span></button>
<button type="button" role="add-address" title="<?= $escaper->escapeHtmlAttr(__('Add New Address')) ?>"
class="action primary add">
<span><?= $escaper->escapeHtml(__('Add New Address')) ?></span>
</button>
</div>
<div class="secondary">
<a class="action back" href="<?= $block->escapeUrl($block->getUrl('customer/account')) ?>"><span><?= $block->escapeHtml(__('Back')) ?></span></a>
<a class="action back"
href="<?= $escaper->escapeUrl($block->getUrl('customer/account')) ?>">
<span><?= $escaper->escapeHtml(__('Back')) ?></span>
</a>
</div>
</div>
<script type="text/x-magento-init">
{
".page-main": {
"address": {
"deleteAddress": "td a[role='delete-address']",
"deleteUrlPrefix": "<?= $block->escapeJs($block->escapeUrl($block->getDeleteUrl())) ?>id/",
"deleteUrlPrefix": "<?= $escaper->escapeJs($escaper->escapeUrl($block->getDeleteUrl())) ?>id/",
"addAddress": "button[role='add-address']",
"addAddressLocation": "<?= $block->escapeJs($block->escapeUrl($block->getAddAddressUrl())) ?>"
"addAddressLocation": "<?= $escaper->escapeJs($escaper->escapeUrl($block->getAddAddressUrl())) ?>"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
* Copyright 2015 Adobe
* All Rights Reserved.
*/

/**
Expand Down Expand Up @@ -95,7 +95,10 @@ define([
parameters['force_new_section_timestamp'] = forceNewSectionTimestamp;

return $.getJSON(options.sectionLoadUrl, parameters).fail(function (jqXHR) {
throw new Error(jqXHR);
// don't throw error if the request is cancelled or blocked
if (jqXHR.status !== 0) {
throw new Error(jqXHR);
}
});
}
};
Expand Down
Loading

0 comments on commit 7067cda

Please sign in to comment.