Guest User

Untitled

a guest
Jan 21st, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. /**
  2. * Add all attributes and apply pricing logic to products collection
  3. * to get correct values in different products lists.
  4. * E.g. crosssells, upsells, new products, recently viewed
  5. *
  6. * @param MagentoCatalogModelResourceModelProductCollection $collection
  7. * @return MagentoCatalogModelResourceModelProductCollection
  8. */
  9. protected function _addProductAttributesAndPrices(
  10. MagentoCatalogModelResourceModelProductCollection $collection
  11. ) {
  12. return $collection
  13. ->addMinimalPrice()
  14. ->addFinalPrice()
  15. ->addTaxPercents()
  16. ->addAttributeToSelect($this->_catalogConfig->getProductAttributes())
  17. ->addUrlRewrite();
  18. }
Add Comment
Please, Sign In to add comment