File tree Expand file tree Collapse file tree 6 files changed +18
-8
lines changed
Block/Adminhtml/Product/Edit/Tab
Downloadable/Block/Customer/Products Expand file tree Collapse file tree 6 files changed +18
-8
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 @@ -99,7 +99,7 @@ protected function _prepareLayout()
99
99
'downloadable.customer.products.pager '
100
100
)->setCollection (
101
101
$ this ->getItems ()
102
- );
102
+ )-> setPath ( ' downloadable/customer/products ' ) ;
103
103
$ this ->setChild ('pager ' , $ pager );
104
104
$ this ->getItems ()->load ();
105
105
foreach ($ this ->getItems () as $ item ) {
Original file line number Diff line number Diff line change @@ -446,7 +446,15 @@ public function getPagerUrl($params = [])
446
446
$ urlParams ['_fragment ' ] = $ this ->getFragment ();
447
447
$ urlParams ['_query ' ] = $ params ;
448
448
449
- return $ this ->getUrl ('*/*/* ' , $ urlParams );
449
+ return $ this ->getUrl ($ this ->getPath (), $ urlParams );
450
+ }
451
+
452
+ /**
453
+ * @return string
454
+ */
455
+ protected function getPath ()
456
+ {
457
+ return $ this ->_getData ('path ' ) ?: '*/*/* ' ;
450
458
}
451
459
452
460
/**
You can’t perform that action at this time.
0 commit comments