Skip to content

Commit 1523f89

Browse files
[EngCom] Public Pull Requests - 2.3-develop
- merged latest code from mainline branch
2 parents 14386b1 + 73650a0 commit 1523f89

File tree

25 files changed

+484
-156
lines changed

25 files changed

+484
-156
lines changed

app/code/Magento/Catalog/Block/Ui/ProductViewCounter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
/**
2121
* Reports Viewed Products Counter
2222
*
23-
* The main responsilibity of this class is provide necessary data to track viewed products
24-
* by customer on frontend and data to synchornize this tracks with backend
23+
* The main responsibility of this class is provide necessary data to track viewed products
24+
* by customer on frontend and data to synchronize this tracks with backend
2525
*
2626
* @api
2727
* @since 101.1.0
@@ -109,6 +109,8 @@ public function __construct(
109109
*
110110
* @return string {JSON encoded data}
111111
* @since 101.1.0
112+
* @throws \Magento\Framework\Exception\LocalizedException
113+
* @throws \Magento\Framework\Exception\NoSuchEntityException
112114
*/
113115
public function getCurrentProductData()
114116
{

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ public function modifyPrice(IndexTableStructure $priceTable, array $entityIds =
127127
}
128128

129129
/**
130+
* Check if custom options exist.
131+
*
130132
* @param IndexTableStructure $priceTable
131133
* @return bool
132134
* @throws \Exception
@@ -154,6 +156,8 @@ private function checkIfCustomOptionsExist(IndexTableStructure $priceTable): boo
154156
}
155157

156158
/**
159+
* Get connection.
160+
*
157161
* @return \Magento\Framework\DB\Adapter\AdapterInterface
158162
*/
159163
private function getConnection()
@@ -211,7 +215,7 @@ private function getSelectForOptionsWithMultipleValues(string $sourceTable): Sel
211215
} else {
212216
$select->joinLeft(
213217
['otps' => $this->getTable('catalog_product_option_type_price')],
214-
'otps.option_type_id = otpd.option_type_id AND otpd.store_id = cwd.default_store_id',
218+
'otps.option_type_id = otpd.option_type_id AND otps.store_id = cwd.default_store_id',
215219
[]
216220
);
217221

@@ -373,6 +377,8 @@ private function getSelectAggregated(string $sourceTable): Select
373377
}
374378

375379
/**
380+
* Get select for update.
381+
*
376382
* @param string $sourceTable
377383
* @return \Magento\Framework\DB\Select
378384
*/
@@ -402,6 +408,8 @@ private function getSelectForUpdate(string $sourceTable): Select
402408
}
403409

404410
/**
411+
* Get table name.
412+
*
405413
* @param string $tableName
406414
* @return string
407415
*/
@@ -411,6 +419,8 @@ private function getTable(string $tableName): string
411419
}
412420

413421
/**
422+
* Is price scope global.
423+
*
414424
* @return bool
415425
*/
416426
private function isPriceGlobal(): bool

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
/**
1212
* Default Product Type Price Indexer Resource model
13+
*
1314
* For correctly work need define product type id
1415
*
1516
* @api
@@ -208,6 +209,8 @@ public function reindexEntity($entityIds)
208209
}
209210

210211
/**
212+
* Reindex prices.
213+
*
211214
* @param null|int|array $entityIds
212215
* @return \Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\DefaultPrice
213216
*/
@@ -604,7 +607,7 @@ protected function _applyCustomOption()
604607
[]
605608
)->joinLeft(
606609
['otps' => $this->getTable('catalog_product_option_type_price')],
607-
'otps.option_type_id = otpd.option_type_id AND otpd.store_id = cs.store_id',
610+
'otps.option_type_id = otpd.option_type_id AND otps.store_id = cs.store_id',
608611
[]
609612
)->group(
610613
['i.entity_id', 'i.customer_group_id', 'i.website_id', 'o.option_id']
@@ -802,6 +805,8 @@ public function getIdxTable($table = null)
802805
}
803806

804807
/**
808+
* Check if product exists.
809+
*
805810
* @return bool
806811
*/
807812
protected function hasEntity()
@@ -823,6 +828,8 @@ protected function hasEntity()
823828
}
824829

825830
/**
831+
* Get total tier price expression.
832+
*
826833
* @param \Zend_Db_Expr $priceExpression
827834
* @return \Zend_Db_Expr
828835
*/
@@ -863,6 +870,8 @@ private function getTotalTierPriceExpression(\Zend_Db_Expr $priceExpression)
863870
}
864871

865872
/**
873+
* Get tier price expression for table.
874+
*
866875
* @param string $tableAlias
867876
* @param \Zend_Db_Expr $priceExpression
868877
* @return \Zend_Db_Expr

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/General.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,10 @@ protected function customizeNameListeners(array $meta)
355355
'allowImport' => !$this->locator->getProduct()->getId(),
356356
];
357357

358-
if (!in_array($listener, $textListeners)) {
359-
$importsConfig['elementTmpl'] = 'ui/form/element/input';
358+
if (in_array($listener, $textListeners)) {
359+
$importsConfig['cols'] = 15;
360+
$importsConfig['rows'] = 2;
361+
$importsConfig['elementTmpl'] = 'ui/form/element/textarea';
360362
}
361363

362364
$meta = $this->arrayManager->merge($listenerPath . static::META_CONFIG_PATH, $meta, $importsConfig);

app/code/Magento/Catalog/view/frontend/templates/product/view/addtocart.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<input type="number"
2121
name="qty"
2222
id="qty"
23+
min="0"
2324
value="<?= /* @escapeNotVerified */ $block->getProductDefaultQty() * 1 ?>"
2425
title="<?= /* @escapeNotVerified */ __('Qty') ?>"
2526
class="input-text qty"

app/code/Magento/Catalog/view/frontend/templates/product/view/opengraph/general.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<meta property="og:image" content="<?= $block->escapeUrl($block->getImage($block->getProduct(), 'product_base_image')->getImageUrl()) ?>" />
1515
<meta property="og:description" content="<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>" />
1616
<meta property="og:url" content="<?= $block->escapeUrl($block->getProduct()->getProductUrl()) ?>" />
17-
<?php if ($priceAmount = $block->getProduct()->getFinalPrice()):?>
17+
<?php if ($priceAmount = $block->getProduct()->getPriceInfo()->getPrice(\Magento\Catalog\Pricing\Price\FinalPrice::PRICE_CODE)->getAmount()):?>
1818
<meta property="product:price:amount" content="<?= /* @escapeNotVerified */ $priceAmount ?>"/>
1919
<?= $block->getChildHtml('meta.currency') ?>
2020
<?php endif;?>

app/code/Magento/Checkout/view/frontend/templates/cart/item/configure/updatecart.phtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<input type="number"
2121
name="qty"
2222
id="qty"
23+
min="0"
2324
value=""
2425
title="<?= /* @escapeNotVerified */ __('Qty') ?>"
2526
class="input-text qty"

app/code/Magento/Payment/Model/Method/Cc.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
use Magento\Quote\Model\Quote\Payment;
1111

1212
/**
13+
* Credit Card payment method legacy implementation.
14+
*
1315
* @method \Magento\Quote\Api\Data\PaymentMethodExtensionInterface getExtensionAttributes()
1416
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1517
* @deprecated 100.0.8
@@ -93,6 +95,7 @@ public function __construct(
9395
* @throws \Magento\Framework\Exception\LocalizedException
9496
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
9597
* @SuppressWarnings(PHPMD.NPathComplexity)
98+
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
9699
*/
97100
public function validate()
98101
{
@@ -148,6 +151,22 @@ public function validate()
148151
'JCB' => '/^35(2[8-9][0-9]{12,15}|[3-8][0-9]{13,16})/',
149152
'MI' => '/^(5(0|[6-9])|63|67(?!59|6770|6774))\d*$/',
150153
'MD' => '/^(6759(?!24|38|40|6[3-9]|70|76)|676770|676774)\d*$/',
154+
155+
//Hipercard
156+
'HC' => '/^((606282)|(637095)|(637568)|(637599)|(637609)|(637612))\d*$/',
157+
//Elo
158+
'ELO' => '/^((509091)|(636368)|(636297)|(504175)|(438935)|(40117[8-9])|(45763[1-2])|' .
159+
'(457393)|(431274)|(50990[0-2])|(5099[7-9][0-9])|(50996[4-9])|(509[1-8][0-9][0-9])|' .
160+
'(5090(0[0-2]|0[4-9]|1[2-9]|[24589][0-9]|3[1-9]|6[0-46-9]|7[0-24-9]))|' .
161+
'(5067(0[0-24-8]|1[0-24-9]|2[014-9]|3[0-379]|4[0-9]|5[0-3]|6[0-5]|7[0-8]))|' .
162+
'(6504(0[5-9]|1[0-9]|2[0-9]|3[0-9]))|' .
163+
'(6504(8[5-9]|9[0-9])|6505(0[0-9]|1[0-9]|2[0-9]|3[0-8]))|' .
164+
'(6505(4[1-9]|5[0-9]|6[0-9]|7[0-9]|8[0-9]|9[0-8]))|' .
165+
'(6507(0[0-9]|1[0-8]))|(65072[0-7])|(6509(0[1-9]|1[0-9]|20))|' .
166+
'(6516(5[2-9]|6[0-9]|7[0-9]))|(6550(0[0-9]|1[0-9]))|' .
167+
'(6550(2[1-9]|3[0-9]|4[0-9]|5[0-8])))\d*$/',
168+
//Aura
169+
'AU' => '/^5078\d*$/'
151170
];
152171

153172
$ccNumAndTypeMatches = isset(
@@ -189,6 +208,8 @@ public function validate()
189208
}
190209

191210
/**
211+
* Check if verification should be used.
212+
*
192213
* @return bool
193214
* @api
194215
*/
@@ -202,6 +223,8 @@ public function hasVerification()
202223
}
203224

204225
/**
226+
* Get list of credit cards verification reg exp.
227+
*
205228
* @return array
206229
* @api
207230
*/
@@ -226,6 +249,8 @@ public function getVerificationRegEx()
226249
}
227250

228251
/**
252+
* Validate expiration date
253+
*
229254
* @param string $expYear
230255
* @param string $expMonth
231256
* @return bool
@@ -276,6 +301,8 @@ public function assignData(\Magento\Framework\DataObject $data)
276301
}
277302

278303
/**
304+
* Get code for "other" credit cards.
305+
*
279306
* @param string $type
280307
* @return bool
281308
* @api

app/code/Magento/Payment/etc/payment.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,14 @@
4141
<type id="MD" order="100">
4242
<label>Maestro Domestic</label>
4343
</type>
44+
<type id="HC" order="110">
45+
<label>Hipercard</label>
46+
</type>
47+
<type id="ELO" order="120">
48+
<label>Elo</label>
49+
</type>
50+
<type id="AU" order="130">
51+
<label>Aura</label>
52+
</type>
4453
</credit_cards>
4554
</payment>
Loading
Loading
Loading

app/code/Magento/Payment/view/base/web/js/model/credit-card-validation/credit-card-number-validator/credit-card-type.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,48 @@ define([
110110
name: 'CVC',
111111
size: 3
112112
}
113+
},
114+
{
115+
title: 'Hipercard',
116+
type: 'HC',
117+
pattern: '^((606282)|(637095)|(637568)|(637599)|(637609)|(637612))\\d*$',
118+
gaps: [4, 8, 12],
119+
lengths: [13, 16],
120+
code: {
121+
name: 'CVC',
122+
size: 3
123+
}
124+
},
125+
{
126+
title: 'Elo',
127+
type: 'ELO',
128+
pattern: '^((509091)|(636368)|(636297)|(504175)|(438935)|(40117[8-9])|(45763[1-2])|' +
129+
'(457393)|(431274)|(50990[0-2])|(5099[7-9][0-9])|(50996[4-9])|(509[1-8][0-9][0-9])|' +
130+
'(5090(0[0-2]|0[4-9]|1[2-9]|[24589][0-9]|3[1-9]|6[0-46-9]|7[0-24-9]))|' +
131+
'(5067(0[0-24-8]|1[0-24-9]|2[014-9]|3[0-379]|4[0-9]|5[0-3]|6[0-5]|7[0-8]))|' +
132+
'(6504(0[5-9]|1[0-9]|2[0-9]|3[0-9]))|' +
133+
'(6504(8[5-9]|9[0-9])|6505(0[0-9]|1[0-9]|2[0-9]|3[0-8]))|' +
134+
'(6505(4[1-9]|5[0-9]|6[0-9]|7[0-9]|8[0-9]|9[0-8]))|' +
135+
'(6507(0[0-9]|1[0-8]))|(65072[0-7])|(6509(0[1-9]|1[0-9]|20))|' +
136+
'(6516(5[2-9]|6[0-9]|7[0-9]))|(6550(0[0-9]|1[0-9]))|' +
137+
'(6550(2[1-9]|3[0-9]|4[0-9]|5[0-8])))\\d*$',
138+
gaps: [4, 8, 12],
139+
lengths: [16],
140+
code: {
141+
name: 'CVC',
142+
size: 3
143+
}
144+
},
145+
{
146+
title: 'Aura',
147+
type: 'AU',
148+
pattern: '^5078\\d*$',
149+
gaps: [4, 8, 12],
150+
lengths: [19],
151+
code: {
152+
name: 'CVC',
153+
size: 3
154+
}
113155
}
114156
];
115157

app/code/Magento/Sales/Model/Order.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1311,12 +1311,12 @@ public function getTrackingNumbers()
13111311
* Retrieve shipping method
13121312
*
13131313
* @param bool $asObject return carrier code and shipping method data as object
1314-
* @return string|\Magento\Framework\DataObject
1314+
* @return string|null|\Magento\Framework\DataObject
13151315
*/
13161316
public function getShippingMethod($asObject = false)
13171317
{
13181318
$shippingMethod = parent::getShippingMethod();
1319-
if (!$asObject) {
1319+
if (!$asObject || !$shippingMethod) {
13201320
return $shippingMethod;
13211321
} else {
13221322
list($carrierCode, $method) = explode('_', $shippingMethod, 2);

0 commit comments

Comments
 (0)