Setup redirects for product links after migrating from wordpress to opencart

I am migrating from woocommerce to opencart and I want to keep my SEO. But there is a problem with that because the url patterns of the two platforms differ. For example woocommerce uses site.com/product/my-product and when I move that to opencart it changes to site.com/my-category/my-product or if I enter in the product from other page like the home it just adds the product slug to the url. If there is a link to the product in site.com and I click it it will lead me to site.com/my-product etc. I have many products for which I want redirects, so I can keep my SEO. How can that be done ?