File tree Expand file tree Collapse file tree 14 files changed +517
-38
lines changed
Block/Adminhtml/Product/Edit/Tab
Downloadable/Block/Customer/Products
framework/Magento/TestFramework
testsuite/Magento/Checkout/Block/Cart/Item
lib/internal/Magento/Framework/View/Template/Html Expand file tree Collapse file tree 14 files changed +517
-38
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Catalog \Block \Adminhtml \Product \Edit \Tab ;
7
7
8
+ use Magento \Framework \Api \SimpleDataObjectConverter ;
9
+
8
10
/**
9
11
* Product inventory data
10
12
*/
@@ -133,7 +135,7 @@ public function getFieldValue($field)
133
135
{
134
136
$ stockItem = $ this ->getStockItem ();
135
137
if ($ stockItem ->getItemId ()) {
136
- $ method = 'get ' . \ Magento \ Framework \ Api \ SimpleDataObjectConverter::snakeCaseToUpperCamelCase ($ field );
138
+ $ method = 'get ' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase ($ field );
137
139
if (method_exists ($ stockItem , $ method )) {
138
140
return $ stockItem ->{$ method }();
139
141
}
@@ -149,7 +151,7 @@ public function getConfigFieldValue($field)
149
151
{
150
152
$ stockItem = $ this ->getStockItem ();
151
153
if ($ stockItem ->getItemId ()) {
152
- $ method = 'getUseConfig ' . \ Magento \ Framework \ Api \ SimpleDataObjectConverter::snakeCaseToUpperCamelCase (
154
+ $ method = 'getUseConfig ' . SimpleDataObjectConverter::snakeCaseToUpperCamelCase (
153
155
$ field
154
156
);
155
157
if (method_exists ($ stockItem , $ method )) {
Original file line number Diff line number Diff line change 50
50
class="select" disabled="disabled">
51
51
<option value="1"><?php echo __ ('Yes ' ) ?> </option>
52
52
<option
53
- value="0"<?php if ($ block ->getConfigFieldValue ('manage_stock ' ) == 0 ): ?> selected="selected"<?php endif ; ?> ><?php echo __ ('No ' ) ?> </option>
53
+ value="0"<?php if ($ block ->getFieldValue ('manage_stock ' ) == 0 ): ?> selected="selected"<?php endif ; ?> ><?php echo __ ('No ' ) ?> </option>
54
54
</select>
55
55
</div>
56
56
<div class="field choice">
Original file line number Diff line number Diff line change 24
24
<div class="control">
25
25
<select id="inventory_manage_stock" name="<?php echo $ block ->getFieldSuffix () ?> [stock_data][manage_stock]" <?php echo $ _readonly ;?> >
26
26
<option value="1"><?php echo __ ('Yes ' ) ?> </option>
27
- <option value="0"<?php if ($ block ->getConfigFieldValue ('manage_stock ' ) == 0 ): ?> selected="selected"<?php endif ; ?> ><?php echo __ ('No ' ) ?> </option>
27
+ <option value="0"<?php if ($ block ->getFieldValue ('manage_stock ' ) == 0 ): ?> selected="selected"<?php endif ; ?> ><?php echo __ ('No ' ) ?> </option>
28
28
</select>
29
29
<input type="hidden" id="inventory_manage_stock_default" value="<?php echo $ block ->getDefaultConfigValue ('manage_stock ' ); ?> ">
30
30
<?php $ _checked = ($ block ->getFieldValue ('use_config_manage_stock ' ) || $ block ->IsNew ()) ? 'checked="checked" ' : '' ?>
Original file line number Diff line number Diff line change 25
25
<ul data-mage-init='{"menu":[]}'>
26
26
<% if (data.items.length) { %>
27
27
<% _.each(data.items, function(value){ %>
28
- <li <%- data.optionData(value) %>><a href="#"><%- value.label %></a></li>
28
+ <li <%= data.optionData(value) %>><a href="#"><%- value.label %></a></li>
29
29
<% }); %>
30
30
<% } else { %><span class="mage-suggest-no-records"><%- data.noRecordsText %></span><% } %>
31
31
</ul>
50
50
data: {'template_id': data.id}
51
51
});
52
52
});
53
-
53
+
54
54
$suggest.mage('suggest', <?php echo $ this ->helper ('Magento\Framework\Json\Helper\Data ' )->jsonEncode ($ block ->getSelectorOptions ())?> )
55
55
.on('suggestselect', function (e, ui) {
56
56
$(this).val('');
Original file line number Diff line number Diff line change @@ -106,24 +106,22 @@ protected function _prepareLayout()
106
106
if ($ addressId = $ this ->getRequest ()->getParam ('id ' )) {
107
107
try {
108
108
$ this ->_address = $ this ->_addressRepository ->getById ($ addressId );
109
+ if ($ this ->_address ->getCustomerId () != $ this ->_customerSession ->getCustomerId ()) {
110
+ $ this ->_address = null ;
111
+ }
109
112
} catch (NoSuchEntityException $ e ) {
110
113
$ this ->_address = null ;
111
114
}
112
115
}
113
116
114
117
if ($ this ->_address === null || !$ this ->_address ->getId ()) {
115
118
$ this ->_address = $ this ->addressDataFactory ->create ();
116
- $ this ->_address ->setPrefix (
117
- $ this ->getCustomer ()->getPrefix ()
118
- )->setFirstname (
119
- $ this ->getCustomer ()->getFirstname ()
120
- )->setMiddlename (
121
- $ this ->getCustomer ()->getMiddlename ()
122
- )->setLastname (
123
- $ this ->getCustomer ()->getLastname ()
124
- )->setSuffix (
125
- $ this ->getCustomer ()->getSuffix ()
126
- );
119
+ $ customer = $ this ->getCustomer ();
120
+ $ this ->_address ->setPrefix ($ customer ->getPrefix ());
121
+ $ this ->_address ->setFirstname ($ customer ->getFirstname ());
122
+ $ this ->_address ->setMiddlename ($ customer ->getMiddlename ());
123
+ $ this ->_address ->setLastname ($ customer ->getLastname ());
124
+ $ this ->_address ->setSuffix ($ customer ->getSuffix ());
127
125
}
128
126
129
127
$ this ->pageConfig ->getTitle ()->set ($ this ->getTitle ());
You can’t perform that action at this time.
0 commit comments