Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeholder committed Mar 1, 2024
1 parent 990bb1e commit 266977f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fieldlayoutelements/PurchasableStockField.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function inputHtml(ElementInterface $element = null, bool $static = false
e.preventDefault();
const slideout = new Craft.Commerce.UpdateInventoryLevelModal($settings);
slideout.on('submit', (e) => {
if(e.response.data.updatedItems[0].availableTotal !== undefined) {
if(e.response.data.updatedItems.length > 0 && e.response.data.updatedItems[0].availableTotal !== undefined) {
$('#' + $updatedValueId).html(e.response.data.updatedItems[0].availableTotal);
}
});
Expand Down

0 comments on commit 266977f

Please sign in to comment.