How do I add a Shipping method to the saleschannel via the repository pattern

Hello,

I am making a shipping method plugin for the company I work for. We have an api that checks available shipping methods. The shipping method chosen by the customer needs to be added to the shopware database so that the shipping costs can be calculated.

 

Currently, I’m able to create shipping methods and add them to the database. They also show up in the backend, but they don’t show up in the sales channel. I can select them via the sales channel settings, and then they show up in the frontend.

 

Does anyone know how you can add the shipping method directly to sales channel?

 

Thanks in advance,

Koen

 

EDIT:  typo