Skip to content

Commit f5be490

Browse files
authored
Merge pull request #4037 from magento-tsg-csl3/2.3-develop-pr20
[TSG-CSL3] For 2.3 (pr20)
2 parents 810780b + 75621a2 commit f5be490

File tree

40 files changed

+1221
-222
lines changed

40 files changed

+1221
-222
lines changed

app/code/Magento/Braintree/Test/Mftf/Test/BraintreeCreditCardOnCheckoutTest.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@
8787
<waitForPageLoad stepKey="waitForPageLoad10"/>
8888
<click selector="{{BraintreeConfigurationPaymentSection.paymentMethod}}" stepKey="SelectBraintreePaymentMethod1"/>
8989
<waitForPageLoad stepKey="waitForPageLoad11"/>
90-
<click selector="{{CheckoutPaymentSection.shippingAndBillingAddressSame}}" stepKey="UncheckCheckBox"/>
91-
92-
<click selector="{{CheckoutShippingSection.updateAddress}}" stepKey="clickToUpdate"/>
93-
<waitForPageLoad stepKey="waitForPageLoad12"/>
9490
<!--Place order-->
9591
<click selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="PlaceOrder1"/>
9692
<waitForPageLoad stepKey="waitForPageLoad13"/>

app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle/Option.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
namespace Magento\Bundle\Block\Catalog\Product\View\Type\Bundle;
88

9+
use Magento\Catalog\Model\Product;
10+
911
/**
1012
* Bundle option renderer
1113
* @api
@@ -169,7 +171,7 @@ protected function assignSelection(\Magento\Bundle\Model\Option $option, $select
169171
{
170172
if (is_array($selectionId)) {
171173
$this->_selectedOptions = $selectionId;
172-
} else if ($selectionId && $option->getSelectionById($selectionId)) {
174+
} elseif ($selectionId && $option->getSelectionById($selectionId)) {
173175
$this->_selectedOptions = $selectionId;
174176
} elseif (!$option->getRequired()) {
175177
$this->_selectedOptions = 'None';
@@ -179,7 +181,7 @@ protected function assignSelection(\Magento\Bundle\Model\Option $option, $select
179181
/**
180182
* Define if selection is selected
181183
*
182-
* @param \Magento\Catalog\Model\Product $selection
184+
* @param Product $selection
183185
* @return bool
184186
*/
185187
public function isSelected($selection)
@@ -219,7 +221,7 @@ protected function _getSelectedQty()
219221
/**
220222
* Get product model
221223
*
222-
* @return \Magento\Catalog\Model\Product
224+
* @return Product
223225
*/
224226
public function getProduct()
225227
{
@@ -232,7 +234,7 @@ public function getProduct()
232234
/**
233235
* Get bundle option price title.
234236
*
235-
* @param \Magento\Catalog\Model\Product $selection
237+
* @param Product $selection
236238
* @param bool $includeContainer
237239
* @return string
238240
*/
@@ -254,7 +256,7 @@ public function getSelectionQtyTitlePrice($selection, $includeContainer = true)
254256
/**
255257
* Get price for selection product
256258
*
257-
* @param \Magento\Catalog\Model\Product $selection
259+
* @param Product $selection
258260
* @return int|float
259261
*/
260262
public function getSelectionPrice($selection)
@@ -277,7 +279,7 @@ public function getSelectionPrice($selection)
277279
/**
278280
* Get title price for selection product
279281
*
280-
* @param \Magento\Catalog\Model\Product $selection
282+
* @param Product $selection
281283
* @param bool $includeContainer
282284
* @return string
283285
*/
@@ -299,7 +301,7 @@ public function getSelectionTitlePrice($selection, $includeContainer = true)
299301
*/
300302
public function setValidationContainer($elementId, $containerId)
301303
{
302-
return;
304+
return '';
303305
}
304306

305307
/**
@@ -318,7 +320,7 @@ public function setOption(\Magento\Bundle\Model\Option $option)
318320
/**
319321
* Format price string
320322
*
321-
* @param \Magento\Catalog\Model\Product $selection
323+
* @param Product $selection
322324
* @param bool $includeContainer
323325
* @return string
324326
*/
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
declare(strict_types=1);
7+
8+
namespace Magento\Bundle\Block\DataProviders;
9+
10+
use Magento\Catalog\Model\Product;
11+
use Magento\Catalog\Pricing\Price\TierPrice;
12+
use Magento\Framework\Pricing\Render;
13+
use Magento\Framework\View\Element\Block\ArgumentInterface;
14+
use Magento\Framework\View\LayoutInterface;
15+
16+
/**
17+
* Provides additional data for bundle options
18+
*/
19+
class OptionPriceRenderer implements ArgumentInterface
20+
{
21+
/**
22+
* Parent layout of the block
23+
*
24+
* @var LayoutInterface
25+
*/
26+
private $layout;
27+
28+
/**
29+
* @param LayoutInterface $layout
30+
*/
31+
public function __construct(LayoutInterface $layout)
32+
{
33+
$this->layout = $layout;
34+
}
35+
36+
/**
37+
* Format tier price string
38+
*
39+
* @param Product $selection
40+
* @param array $arguments
41+
* @return string
42+
*/
43+
public function renderTierPrice(Product $selection, array $arguments = []): string
44+
{
45+
if (!array_key_exists('zone', $arguments)) {
46+
$arguments['zone'] = Render::ZONE_ITEM_OPTION;
47+
}
48+
49+
$priceHtml = '';
50+
51+
/** @var Render $priceRender */
52+
$priceRender = $this->layout->getBlock('product.price.render.default');
53+
if ($priceRender !== false) {
54+
$priceHtml = $priceRender->render(
55+
TierPrice::PRICE_CODE,
56+
$selection,
57+
$arguments
58+
);
59+
}
60+
61+
return $priceHtml;
62+
}
63+
}

0 commit comments

Comments
 (0)