Skip to content

Commit f7773b1

Browse files
committed
MAGETWO-91512: Free Shipping Cart Price Rule not working when UPS shipping method is enabled
1 parent 9fc1ee7 commit f7773b1

File tree

7 files changed

+41
-7
lines changed

7 files changed

+41
-7
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/Indexer/Price/DefaultPrice.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,11 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression)
862862
);
863863
}
864864

865+
/**
866+
* @param string $tableAlias
867+
* @param \Zend_Db_Expr $priceExpression
868+
* @return \Zend_Db_Expr
869+
*/
865870
private function getTierPriceExpressionForTable($tableAlias, \Zend_Db_Expr $priceExpression)
866871
{
867872
return $this->getConnection()->getCheckSql(

app/code/Magento/CatalogInventory/Model/Plugin/PriceIndexUpdater.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function afterSave(Item $subject, Item $result, AbstractModel $model): It
5555

5656
/**
5757
* @param Item $subject
58-
* @param $result
58+
* @param mixed $result
5959
* @param int $websiteId
6060
* @return void
6161
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
@@ -67,7 +67,7 @@ public function afterUpdateSetOutOfStock(Item $subject, $result, int $websiteId)
6767

6868
/**
6969
* @param Item $subject
70-
* @param $result
70+
* @param mixed $result
7171
* @param int $websiteId
7272
* @return void
7373
* @SuppressWarnings(PHPMD.UnusedFormalParameter)

app/code/Magento/Elasticsearch/Elasticsearch5/Model/Adapter/FieldMapper/ProductFieldMapper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ public function __construct(
6969
}
7070

7171
/**
72-
* {@inheritdoc}
72+
* @param string $attributeCode
73+
* @param array $context
74+
* @return string
7375
*/
7476
public function getFieldName($attributeCode, $context = [])
7577
{
@@ -105,7 +107,8 @@ public function getFieldName($attributeCode, $context = [])
105107
}
106108

107109
/**
108-
* {@inheritdoc}
110+
* @param array $context
111+
* @return array
109112
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
110113
*/
111114
public function getAllAttributesTypes($context = [])

app/code/Magento/Elasticsearch/Model/Adapter/FieldMapper/ProductFieldMapper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public function __construct(
4242
}
4343

4444
/**
45-
* {@inheritdoc}
45+
* @param string $attributeCode
46+
* @param array $context
47+
* @return string
4648
*/
4749
public function getFieldName($attributeCode, $context = [])
4850
{
@@ -78,7 +80,8 @@ public function getFieldName($attributeCode, $context = [])
7880
}
7981

8082
/**
81-
* {@inheritdoc}
83+
* @param array $context
84+
* @return array
8285
*/
8386
public function getAllAttributesTypes($context = [])
8487
{

app/code/Magento/Elasticsearch/Test/Unit/Elasticsearch5/Model/Adapter/FieldMapper/ProductFieldMapperTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ public function testGetFieldNameWithoutAttribute()
180180
/**
181181
* @dataProvider attributeProvider
182182
* @param string $attributeCode
183-
*
183+
* @param $inputType
184+
* @param $searchAttributes
185+
* @param $expected
184186
* @return void
185187
*/
186188
public function testGetAllAttributesTypes($attributeCode, $inputType, $searchAttributes, $expected)

dev/tests/integration/testsuite/Magento/Catalog/Model/ProductPriceTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,28 @@ class ProductPriceTest extends \PHPUnit\Framework\TestCase
2929
*/
3030
private $productRepository;
3131

32+
/**
33+
* @return void
34+
*/
3235
protected function setUp()
3336
{
3437
$this->_model = Bootstrap::getObjectManager()->create(Product::class);
3538
$this->productRepository = Bootstrap::getObjectManager()->create(ProductRepositoryInterface::class);
3639
}
3740

41+
/**
42+
* @return void
43+
*/
3844
public function testGetPrice()
3945
{
4046
$this->assertEmpty($this->_model->getPrice());
4147
$this->_model->setPrice(10.0);
4248
$this->assertEquals(10.0, $this->_model->getPrice());
4349
}
4450

51+
/**
52+
* @return void
53+
*/
4554
public function testGetPriceModel()
4655
{
4756
$default = $this->_model->getPriceModel();
@@ -73,6 +82,9 @@ public function testGetFormatedPrice()
7382
$this->assertEquals('<span class="price">$0.00</span>', $this->_model->getFormatedPrice());
7483
}
7584

85+
/**
86+
* @return void
87+
*/
7688
public function testSetGetFinalPrice()
7789
{
7890
$this->assertEquals(0, $this->_model->getFinalPrice());

dev/tests/integration/testsuite/Magento/Ups/Model/CarrierTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@ class CarrierTest extends \PHPUnit\Framework\TestCase
1515
*/
1616
private $carrier;
1717

18+
/**
19+
* @return void
20+
*/
1821
protected function setUp()
1922
{
2023
$this->carrier = Bootstrap::getObjectManager()->create(Carrier::class);
2124
}
2225

26+
/**
27+
* @return void
28+
*/
2329
public function testGetShipAcceptUrl()
2430
{
2531
$this->assertEquals('https://wwwcie.ups.com/ups.app/xml/ShipAccept', $this->carrier->getShipAcceptUrl());
@@ -35,6 +41,9 @@ public function testGetShipAcceptUrlLive()
3541
$this->assertEquals('https://onlinetools.ups.com/ups.app/xml/ShipAccept', $this->carrier->getShipAcceptUrl());
3642
}
3743

44+
/**
45+
* @return void
46+
*/
3847
public function testGetShipConfirmUrl()
3948
{
4049
$this->assertEquals('https://wwwcie.ups.com/ups.app/xml/ShipConfirm', $this->carrier->getShipConfirmUrl());

0 commit comments

Comments
 (0)