Hello guys! I need another product creation flux ...
# support
m
Hello guys! I need another product creation flux for my app. Me (admin) will create "base products" and the shopkeeper (another role, another login) will get these base products and add (by some js lib) a image or phrase for the base product, and that variation will be displayed in his own subdomain shop. In case the 'real' product will be that who shopkeeper will create. Imagine that the admin create a white t-shirt product (master product). The shopkeeper will select this base product and, with the customization lib, will join his company logo to t-shirt and this customized t-shirt (variant maybe?) will be available in his store. All the shopkeepers will need to select the master product to start the customization proccess and create their own product variants. The cost of product will be divided. The base product will have a fixed cost and the shopkeeper can adjust the profit on the product. I'm thinking to create a new admin panel for shopkeeper, only with this "product crud", a his orders page and a page to follow up the shipping status for orders of his store for now. Will need to add subdomains by store too. The stock will be infinite for now, all payments will be direct to the admin account and the shipping will be admin (me) responsabilities too Did someone do something like that before? If not, do you know the best way I can do? Thanks!
a
I think this problem is relatively simple. You can enable the shopkeeper role to only CRUD his/her own created
Variant
and then add the
user
reference attribute to the
Variant
model so that we know who owns that
Variant
. However, the downside in this approach is that when Solidus team update it, you won’t be able to use the latest update only for
Variant
model
m
And it's preferable to hide all other admin dashboard stuffs for the shopkeeper role or create a another "admin" (shopkeeper role) panel? In this case of permit they to manage just they created variant, its possible to add images for this variant who will be displayed in his store? Adding a user_id to variant and order I can define the scope to show only the owner orders and products, right? I think it's a good approach
Ah, and I will need to add the profit attribute to Variant, that will be what the shopper will pay
🙌 1
a
If you have the resource to create your own admin panel for the shopkeeper, go for it. That will be the best case. I think the variant already have image attribute so no need to change anything on the model Yes, if you add user_id to variant, you can check as well whether he is eligible to edit that variant since we know if he is the owner of that variant or not
m
Thanks for your help! I will try this way and let you know about the progress. One more doubt, I will need to added another gem to manage multi subdomains? I need that each shopkeeper has his own tenant (To display his Variants)
a
This article might help you about the subdomains: https://blog.appsignal.com/2020/03/04/building-a-rails-app-with-multiple-subdomains.html Anyways, cheers mate. Good luck with your project. ;)
d
@Matheus Kemer I’m interested in the same thing. How’s your progress?
@Matheus Kemer ping