`market` Liquid variable doesn't give the correct ID when it's a B2B company location based market

Short description of issue

market Liquid variable doesn’t give the correct ID when it’s a B2B company location based market

Link to Shopify Store

Reproduction steps

  • I have created a new market called Company that includes the Snowdevil company location (this is all default test data on a test store).
  • I have implemented a market based customisation on the theme where the menu links are below the title instead of on the side
  • When I access the website logged in as a B2B customer in an appropriate location that is part of the market, I can see that the customisation is applied. Therefore the theme knows that I am in the company location based market but the liquid variable still gives me the marketId of the geographical location I am in.

Additional info

The market ID not being the company location based one means that we are unable to provide our customers with functionality where they can customise our product based on the market because the fact that we’re in the company location market is not being passed down to us.

What type of topic is this

Bug report

Upload screenshot(s) of issue