Smile-SA / magento2-module-retailer

14 stars 29 forks source link

Region name is not rendered for retailer #21

Open eugene-shramko opened 5 years ago

eugene-shramko commented 5 years ago

Preconditions

Magento Version: 2.3.1 (Commerce) Retailer Module Version: 1.2.5 (and higher) Store Locator Module Version: 1.3.8 (and higher) Environment: Production mode

Should be reproducible for the recent version of the extensions according to the release notes.

Steps to reproduce

  1. Login to Backend.
  2. Go to Sellers -> Retailers.
  3. Click "Add New Retailer" button.
  4. Add all required data: a. select "Australia" as a country from dropdown any other country can be selected, where the states are defined (means corresponding dropdown is rendered) b. select "Victoria" as a state/region from dropdown
  5. Go to store locator page on Frontend. Check the address data displayed for the new store.

Expected result

Selected state/region is displayed on Frontend in addition to country.

Actual result

Only country is displayed on Frontend.

It looks like the "region" value is not populated in "smile_retailer_address" table for the retailer in the case the state/region is selected from the dropdown in the Backend.

Fdec commented 5 years ago

Hi @eugene-shramko

In fact, state/region is not displayed on Frontend. It's not a bug, it's an oversight but You can purpose a PR.

eugene-shramko commented 5 years ago

Hi @Fdec, Thank you for your attention.

I would disagree with you. As far as I see, custom address formatter is used to get formatted address for all store details templates (see \Smile\Map\Model\AddressFormatter). The region and region ID are a part of custom address interface (see \Smile\Map\Api\Data\AddressInterface). Corresponding address templates have region in the body by default (see vendor/smile/module-map/etc/config.xml). All this means that when correct address data is passed to address formatter, the region is displayed on Frontend.

I assume this is a bug. Please correct me if I am wrong.