Closed mattwigham closed 10 years ago
Sorry, I mean it's redirecting back to your "actual" store, not the preview store. Meaning if you're using a completely different theme in your real store, previewing Snakebit's empty cart page will redirect you back to that other theme. It looks like this is because you're using ../
instead of /
.
setTimeout(function() {
document.location.href = '../';
}, 1500);
However, even updating the href will probably still cause problems in the admin, so you may need to do what a few of our themes do and check if it's in the preview area and don't redirect if so. Ex:
if(!(/\/admin\/design/.test(top.location.pathname))) {
setTimeout(function() {
document.location.href = '../';
}, 1500);
}
For reference, typically the theme will set inPreview
as a variable, and use that as needed to optimize things for the preview area. Ex: https://github.com/bigcartel-themes/luna/blob/master/source/javascripts/store.js#L8
Thanks for the detailed examples! This should be resolved.
This intentional, although I can see how it might be confusing if viewing through the admin interface.