ever-co / ever-demand

Ever® Demand™ - Open Commerce Platform - https://everdemand.co
https://everdemand.co
GNU Affero General Public License v3.0
1.72k stars 461 forks source link

Merchant: Carriers not showing #1301

Open YavorGrancharov opened 4 years ago

YavorGrancharov commented 4 years ago
  1. How it works now:
    • use specific carriers dropdown in Admin manage store has optoins from we can choose only when there are shared carriers otherwise it is empty dropdown
    • if there are shared carriers and use specific carriers set to true and none selected, in database hasRestrictedCarriers property is set to true
    • if there are shared carriers and use specific carriers set to true and some or all selected, in database hasRestrictedCarriers property is set to true and carriersIds array is populated with selected carrires ids
    • in all of the above cases carrires are available in Add Carrier popup on Merchant and certain or all of them can be added to the Merchant, in this case the usedCarriersIds property in database is populated with carriers ids and for now those are the carriers that are visible on Merchant
    • on Merchant in track carriers page we count all active carrires plus total carrires added from the Add Carrier popup
  2. What I think should be improved:
    • on Merchant to show carriers selected with use specific carriers functionality and/or carriers that already took work. In first case to populate carriersIds arrary and from second one to populate usedCariersIds array plus those added from Add Carrier popup form.
  3. Any suggestions are welcome?

Issue is connected with this PR https://github.com/ever-co/ever/pull/1253

YavorGrancharov commented 4 years ago

What I did already is to show all active carriers on Merchant if "Use specific carriers" option is set to false on Admin -> Store -> Manage Store panel otherwise show carriers that Merchant set form "Use specific carriers" dropdown options. What I found out is that when on Merchant we see all active carriers because "Use specific carriers" option is set to false, if we decide to add more carriers form Add Carriers option on Merchant -> Carriers page, this automaticaly sets "Use specific carriers" option to true without selecting those same carriers from "Use specific carriers" dropdown option which makes all carriers on Merchant to disappear! If I scrol on "Use specific carriers" dropdwon and select manually those same carriers added from Merchant then they appear in Mechant -> Carries page. Another thing is that added carriers from "Add Carriers" option on Merchant are added both in "usedCarrierersIds" and in "carriersIds" arrays. @evereq One way to solve this is when I choose to add more carriers from "Add Carriers" on Merchant to show them with all other active carriers and not to set "Use specific carriers" option to true, another way would be to somehow manage to select automaticaly those carriers added from Merchant to "Use specific carriers" dropdwon on Admin -> Manage store panel!?