motou / magento2-store-locator-stockists-extension

Stockists store locator extension for magento2 using google maps
MIT License
67 stars 44 forks source link

Unable to disable store #24

Closed nikolaybaychenko closed 6 years ago

nikolaybaychenko commented 6 years ago

Preconditions

  1. Ubuntu + apache2 + mysql + php7
  2. Magento 2.1.10

Steps to reproduce

  1. Create new store in stockists (set it's coordinates, city and country)
  2. Disable the store using stockists module on the backend
  3. Go to stockists page on the frontend and try to find the store by searching it's city

Expected result

  1. The store should not be found (because it's disabled)

Actual result

  1. The store is found

After some digging, I noticed that store successfully disables on the backend, at least status in database changes from 1 to 0. However, it gets all stores (enabled and disabled) in function getStoresForFrontend() in Block\Stockists despite the fact that there is a filter for status: ->addFieldToFilter('status', Stores::STATUS_ENABLED).