magento-lts
magento-lts copied to clipboard
New feature: Highlight popular countries in country select
Description (*)
This PR backports a feature from Magento 2 (in a nicer way with option groups) that allows to configure countries that will be shown on top of the country list ("popular countries").
Also the code duplication for Mage_Checkout_Block_Onepage_Abstract::getCountryHtmlSelect() and Mage_Directory_Block_Data::getCountryHtmlSelect() is removed.
In addition a new event directory_get_top_countries is added, that allows to customize the logic (e.g. to determine top countries automatically from quotes/orders).
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Repeat the following tests 1.-5. for country dropdown in
- cart estimate shipping
- checkout billing
- checkout shipping
- customer account address edit
- customer account register
- Disable config cache
- Without any configuration the country dropdown looks the same as before
- Configure one top country in System > Configuration > General > Countries Options > Top Countries and verify the country dropdown
- Configure multiple top countries in System > Configuration > General > Countries Options > Top Countries and verify the country dropdown
- Enable config cache, assure options are cached by reloading page multiple times and repeat steps 2-4
- Verify product attribute
country_of_manufactureuses non-sorted country list in backend - Verify product attribute
country_of_manufacturecan be displayed correctly on product detail page - In checkout select "Ship to different address", then in shipping form select "Use Billing Address" and change country value -> "Use Billing Address" should be unchecked then
Questions or comments
Contribution checklist (*)
- [x] Pull request has a meaningful description of its purpose
- [x] All commits are accompanied by meaningful commit messages
- [x] All automated tests passed successfully (all builds are green)
- [x] Add yourself to contributors list
Please re-check ... cache-key DIRECTORY_COUNTRY_SELECT_STORE_ is used at several places ... (not tested nothing, just an idea)
Please re-check ... cache-key
DIRECTORY_COUNTRY_SELECT_STORE_is used at several places ... (not tested nothing, just an idea)
@SuSiSonnenschein111 thanks for your feedback (although it could have been a little bit more detailed).
By "several places" you mean Mage_Catalog_Model_Product_Attribute_Source_Countryofmanufacture?
But I agree, the result before sorting should be cached, I've pushed the change and extended the testing scenarios.
Moreover probably Mage_Catalog_Model_Product_Attribute_Source_Countryofmanufacture::getAllOptions() and Mage_Directory_Block_Data::getCountryHtmlSelect() should also be refactored further to remove the code duplication..
@kiatng cs ... :P