Woocommerce theme messed up on TOR
If you first use woocommerce on clearnet and then attempt to use TOR, then the layout is messed up because woocommerce saved options home and siteurl in database during the install.
This website shows manual steps to edit this those values.
A better idea, is to modify wp-config.php and add:
define('WP_SITEURL', $_SERVER["REQUEST_SCHEME"].'://'.$_SERVER["SERVER_NAME"]);
define('WP_HOME', $_SERVER["REQUEST_SCHEME"]'.'://'.'$_SERVER["SERVER_NAME"]);
We should check $_SERVER['HTTP_X_FORWARDED_PROTO'] instead of REQUEST_SCHEME though.
This has the advantage to make woocommerce works at same time on clearnet and Tor.
We should probably do this automatically in the docker-entrypoint.sh.
@dennisreimann to make this work with Tor adding above config will make the theme work again but the problem is with wordpress unlike most other CMSs it hardcodes the whole URL to images and links. So the full URL is hardcoded in the db linking to images and internal links. So it would still be broken if site get's setup over clearnet but also available over Tor (or the other way around). If you start with Tor and go Tor only you can rewrite all urls with wp cli, wp search-replace 'https://clearnet-domain.tld' 'http://tor-domain.onion'.
If we want a hybrid mode that both work there is more work involved see this tutorial linked on an issue for the plugin itself: https://tech.michaelaltfield.net/2021/02/12/wordpress-multisite-tor-alias/
Maybe we should do a separate plugin for this or try to do it as an option in the BTCPay for WooCommerce plugin.