Difficulty Developing ECommerce Webpages / Shopping Basket Functionality

We’re trying to develop a ecommerce webstore which includes cart functionality so multiple products can be ordered at the same time

The intent with this build is that multiple different stores can be setup and use the same build. To achieve this I have a main object “Shopping Cart” which on creation will be related to a single “Storefront”, the “Products” are related to a single “Storefront”. The “Shopping Cart” is the main object of the webpages and by navigating through the “Storefront” object we can display a filtered list of “Products”

The challenge I have now is trying to come up with a way to have a button next to the list of products that will ‘add product to basket’ by re-relating the “Product” record to the main “Shopping Cart” record by creating a new “Cart Item” intermediary record

This is proving tricky as the base object is the “Shopping cart” and to display products on the page we navigate a many to one relationship to “Storefront” then a one to many relationship to the “Products”. To add a product to the basket we then need to create a “Cart Item” record via a one to many relationship from “Product”, and then a many to one relation back to the “Shopping Cart”

Does anyone have any suggestions on how we can achieve this? or perhaps an alternative way to approach this structure of objects / relationships to create a shopping cart sort of mechanic?