Read More
Read More
Menu Close

    How to get country collection in magento2

    To get country collection according to store, you need to add following code in your file:


    getCountries() : is the main function, which you need to call to get collection.

    _countryCollectionFactory: is a collection factory of countries.

    getCountryCollection(): In this function we get the country collection by country factory according to store.

    Searching for an experienced
    Magento 2 Company ?
    Read More

    getTopDestinations(): in this function we get different countries collection from system/config, you can change according to your need.

    . . .
    Discuss on Helpdesk

    Leave a Comment

    Your email address will not be published. Required fields are marked*

    Be the first to comment.

    Back to Top