1

What is the difference between?

$address->getAllNonNominalItems()

And

$address->getAllVisibleItems()

Please anyone can help me on this?

1
  • getItems(): returns array of items from loaded order item collection
  • getAllItems(): returns array of all items that are not marked as deleted
  • getAllVisibleItems(): returns array of all items that are not marked as deleted and do not have a parent item
  • getAllNonNominalItems() : returns array of all non-nominal items

==========================================================================

Nominal Item : After recurring profile is enabled for a particular product, then that product becomes a nominal item.

Nominal items have the following qualities.

  • Nominal items are not added to regular totals (taxes, subtotal, and grand total).
  • Gift cards, store credit, and reward points are not applied to nominal items.
  • Subtotal, tax, shipping, and other nominal charges are separately calculated for a nominal item.
  • All nominal totals are summed into the nominal grand total.
  • Payment methods available for nominal products are limited to PayPal Express Checkout only.
  • The list of available shipping methods during the shopping cart checkout is restricted to the fixed only (Fixed, Table Rates, and Free).
0

As per this file getAllNonNominalItems() is no longer available in magento 2.X to use.

vendor/magento/magento2-base/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php 

And getAllVisibleItems() will return all product which doesn't have any parent product. It returns a product with one condition check if(!$item->getParentItemId()) so product which don't have parent Id will be return by this method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.