1

I read somewhere that if all product has same position it will sort by product id, but I don't think its sorting by Id.

Here are a few screenshots I am sharing which I am sorting by position problem is that every time I click on position it will show any new type of sorting.

enter image description here

enter image description here

enter image description here

enter image description here

also, I created a product carousel for the same category collection, with position sorting and showing the first product which I don't know why it's come first.

Here is my code for collection:

public function setSlider() 
{
     $getCategory = $this->_scopeConfig->getValue('Carousel_Section/Carousel_'.$id.'/Carousel_Six_field', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
     $category = $this->factory->create()->load($getCategory);
     $ProductFilterCollection = $category->getProductCollection()->addAttributeToSelect('price',true)->setFlag('has_stock_status_filter', true)->setPageSize($getLimit)->addAttributeToSelect('*')->setOrder('position', 'asc');
}  

Everything is working fine, just curious about how position sorting works if every product has the same position?

5

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.