Closed mcdado closed 1 year ago
Ok, but pay attention to the fact that a country not only can be set as "inactive" but also "disabled" on a store, which IIRC removes it from the joining table.
I double checked, and if it is of any use to you, here's why I'll keep using my modified version:
We have two shops in a multishop environment, for two geographical markets. Multishop is a bit of a mess in PrestaShop, since some tables like product_shop
have additional information per shop, while country_shop
is a simple joining table where disassociating a country from a shop deletes it from that joining table. Setting a country as inactive changes the boolean flag on the country
table, but that's something that lives for all shop.
Let's say I have shop A with Italy and shop B with France: they both have to be active, but they are each associated with either one of the two shops.
Country::getCountries()
adds a join statement Shop::addSqlAssociation('country', 'c')
that links tables country
and country_shop
. It does not return countries that are not associated with the current shop.
You are absolutely right! thanks for the commit 👍
Country::getCountries()
doesn't return disabled countries in the shop, and makes them unselectable. This changes allows for that.