bitcart/bitcart

Add theme_settings to stores

MrNaif2018 opened this issue · 0 comments

As we are going to implement theming support in BitcartCC store, see bitcart/bitcart-store#319, we need to extend the API to allow storing css url.
CSS url for the theme is just an url which will be loaded by the frontend.
Ideally in the future we will allow to host css right on the server and use a permanent link to server storage, for that #161 and file storage support should be implemented, but that's for another issue
To add theme_settings, we need a new JSON field for Store model.
https://github.com/bitcartcc/bitcart/blob/712d7ffb829cfee517ffa95c056ab37310870a85/api/models.py#L266-L270
it should be marked as json field for our validators, see how checkout_settings field is implemented and referenced for guide on how to add it
A new scheme should be added, which will only have store_theme_url and admin_theme_url variables (type str)

After that, admin panel should be updated to allow editing new field.
https://github.com/bitcartcc/bitcart-admin/blob/05350eac9daa926649aba3ab4d200b8ebdc0fa22/pages/stores.vue#L31-L41
Add it in a similar way to checkout_settings, with a new icon.