You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There may be occasions when a store owner might want to permanently or temporarily allow the store to still exist, but have it functionally be closed.
Examples could include:
Too many changes are required in a short timeframe. The store is closed temporarily to avoid undesired orders.
An API or integration is failing or otherwise needs updating. The store is closed to prevent errors and/or data issues.
A payment provider is broken or otherwise needs to be updated/replaced. The store is closed to prevent errors at checkout.
There are plenty more examples, for sure.
Describe the solution you'd like
Add a setting to the Superuser Settings area that is a checkbox. This checkbox will toggle whether the store is open or closed.
When the store is closed a value will be added to the hcc_StoreSettings table.
SettingName: StoreClosed
SettingValue: True
There is already code in the MVC controllers to look for and add the store closed setting to the ViewBag for views to see and work with.
varblnIsStoreClosed= ViewBag["StoreClosed"];// should be boolean
The database and server-side API are all fully aware of this setting. It's a first-class property in the StoreSettings class.
varblnIsStoreClosed= HccApp.CurrentStore.Settings.StoreClosed;// should be boolean
When the store is closed:
All catalog pages will continue to display products and categories.
Prices for products are all hidden.
Cart and Checkout will no longer function.
The REST API will no longer function. All requests should have an HTTP 404 response.
The store administration is still fully functional.
As with any other update, anything facing a customer will be localized, so different languages and text values can be displayed, depending on the desires of the respective store owner.
Describe alternatives you've considered
Updating the database manually, and then customizing all of the viewset cshtml files that visitors can see.
Additional context
There is already underlying infrastructure to allow this to happen without updates to Hotcakes Commerce itself, but it requires direct access to the database and updates to many of the viewset UI files.
If someone wants to do this today, it's already possible but requires some development work.
First, run the query below.
/* CLOSE/OPEN Hotcakes Commerce store online. Instructions: 1. Update the variable below as desired. 2. Execute the script against the site. 3. Restart the site or clear the site cache. */-- Open: False -- Closed: True
DECLARE @IsClosed NVARCHAR(100) = N'True'; -- UPDATE THIS IF YOU NEED TO-- Do NOTHING past this lineSELECT*FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] = N'StoreClosed';
IF NOT EXISTS(SELECT1FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] = N'StoreClosed'AND [StoreId] =1)
BEGININSERT INTO [dbo].[hcc_StoreSettings] (
[StoreId],
[SettingName],
[SettingValue]
)
VALUES (
1,
N'StoreClosed',
@IsClosed
);
END
ELSE
BEGINUPDATE [dbo].[hcc_StoreSettings] SET [SettingValue] = @IsClosed WHERE [SettingName] = N'StoreClosed'AND [StoreId] =1;
END
SELECT*FROM [dbo].[hcc_StoreSettings] WHERE [SettingName] = N'StoreClosed';
Next, update each of the front-facing views to show/hide features and UI as desired using the setting as described previously.
Whenever you open or close the store, the website will need to be restarted to clear the cache and see the change take effect.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem?
Hotcakes Support Request: 8445
There may be occasions when a store owner might want to permanently or temporarily allow the store to still exist, but have it functionally be closed.
Examples could include:
There are plenty more examples, for sure.
Describe the solution you'd like
Add a setting to the Superuser Settings area that is a checkbox. This checkbox will toggle whether the store is open or closed.
When the store is closed a value will be added to the
hcc_StoreSettings
table.StoreClosed
True
There is already code in the MVC controllers to look for and add the store closed setting to the ViewBag for views to see and work with.
The database and server-side API are all fully aware of this setting. It's a first-class property in the
StoreSettings
class.When the store is closed:
As with any other update, anything facing a customer will be localized, so different languages and text values can be displayed, depending on the desires of the respective store owner.
Describe alternatives you've considered
Updating the database manually, and then customizing all of the viewset
cshtml
files that visitors can see.Additional context
There is already underlying infrastructure to allow this to happen without updates to Hotcakes Commerce itself, but it requires direct access to the database and updates to many of the viewset UI files.
If someone wants to do this today, it's already possible but requires some development work.
First, run the query below.
Next, update each of the front-facing views to show/hide features and UI as desired using the setting as described previously.
Whenever you open or close the store, the website will need to be restarted to clear the cache and see the change take effect.
The text was updated successfully, but these errors were encountered: