No Comments

Product Detail Collection – Magento 2.0.1

Magento2 REST api - Customizing a Bundle
Multiple store views with multiple domains / Siteground

In product detail page, I need to collect 10 related products and 10 up sell products details(name,image,price,description,…..) without using widget. After getting these details I can customize my page as I want. Before that I was using objectManager to collect 10 products, and get some info then show in my template. But I don’t know how to get related/upsell product related to current product detail page.

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$productCollection = $objectManager->create('MagentoCatalogModelResourceModelProductCollectionFactory');
$collection = $productCollection->create()->setPageSize(10)->addAttributeToSelect('*')->load();
foreach ($collection as $product){ echo 'Name  =  '.$product->getName().'<br>'; }
  1. where could I find list of all available methods to get product details like $product->getName();
  2. suggest any article or hints to collect related/upsell products in product detail page

Related Posts

  • Get Latest/Most Sell Product Image Without Using Widget – Magento 2.0.1 (0)
    I have crated one theme and module, theme extends to blank theme, module have five blocks.I am trying First block render the latest product image(only one),the remaining blocks render most sell product. Before that I have achieved this using widget catalog product list (from Admin […]
  • magento load product by id with limit thing (1)
    i wrote a code to get product list by id below is my code : $category_id = $_GET['category_id']; $catagory_model = Mage::getModel('catalog/category')->load($category_id); $collection = […]
  • Magento 2 – Add reviews list in theme template (1)
    I need to show a list of latest reviews on magento 2 homepage. I did it this way <?php $objectManager = MagentoFrameworkAppObjectManager::getInstance(); $reviewCollection = $objectManager->create('MagentoReviewModelResourceModelReviewCollectionFactory'); $collection = […]
  • Cross-sell product is not showing in the product detail page (3)
    In product detail page the following code is written to display the cross-sell product which are set from the admin side.. <?php echo $this->getChildHtml('crosssell'); ?> But it is not showing anything although there are cross sell products present in the admin side and the […]
  • Cross-sell product is not showing in the product detail page (3)
    In product detail page the following code is written to display the cross-sell product which are set from the admin side.. <?php echo $this->getChildHtml('crosssell'); ?> But it is not showing anything although there are cross sell products present in the admin side and the […]
  • How to add an often used attribute to the collection loaded on category page, related products, cart page etc (1)
    If you have a custom attribute that you use everywhere, on category page, on product page, in related items, on cart page, on checkout etc., how do you add it to the collection that gets loaded by default? For example in related items (product/list/items.phtml), if I […]
  • Where is setDoNotUseCategoryId() declared and what does it mean? (2)
    While getting related products, cross sells and upsells and collections, the function setDoNotUseCategoryId() is used. Where is it declared and can you explain the usage? foreach ($this->_itemCollection as $product) { // var_dump($product);exit; […]
  • magento custom product listing page (0)
    i want to override listing page of magento , i have custom case say a category has 10 product then i want to show 20(10*2) product where 2 is some multiplier mean same product will show two times with different price. i was able to do so after modifying some function but got stuck […]
  • Different product prices for existing customers (1)
    Our website sells the same products in two different areas of the site, Buyer side and Existing Customer Side. If we add a product "Product_1" = 100€ and are running a 10% discount, We want to show users on the Buyer Side 90€ AND our existing customers 100€ Is that at all […]
  • Display Unit of Measure Pricing alongside base price (0)
    Is there a way to calculate and display a products price for each unit of measure. For example, we sell safety glasses in boxes of 10 ... but if a customer is comparing the price to a site that sells them individually, it would be good to show the "per goggle" price alongside the box […]
Magento2 REST api - Customizing a Bundle
Multiple store views with multiple domains / Siteground

Be the first to post a comment.

Add a comment