Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
4 Odpovědi
5833 Zobrazení

hello,


is it posible to disable /shop page on other websites?

Avatar
Zrušit
Nejlepší odpověď

Hi Carlo:

You can add a redirect for /shop for that Website. For example, the following redirect gives the visitor a page not found message if they try to access /shop for Website2.


Avatar
Zrušit
Nejlepší odpověď

Is there any other way to enable the shop module for just specific websites? It seems pretty crazy in v17 that this not an option in the system. We have to redirect a load of pages in order to disable it. Surely an option in the code and relevant checking whether or not add to the site map for that website if the box is ticked or vice versa would be sensible?

I guess this could be done as a module if not a planned feature already in the code?


Avatar
Zrušit

I second this. We have multiple websites, only some of which need eCommerce. However if this is solved in a module, it won't be available for us as Odoo Online doesn't support custom modules.

Nejlepší odpověď

Paresh is right, but a minor add on from my side. You need developer mode activated to find the Redirect Section under "Website" > "Configuration" > "Redirects". Also make sure to remove the menu item for shop on the sites where you don't want it to be disabled. For more information about multiple websites in Odoo see: 

https://jortdevreeze.com/blog/odoo-2/a-comprehensive-guide-to-running-multiple-websites-in-odoo-6

Avatar
Zrušit
Nejlepší odpověď

This solution is only redirecting 1 page. For example, the main /shop page, or /blog page. But this is not redirecting all products of the shop, or all the articles from the blog.
About e-commerce, Odoo is generating the sitemap, so all the pages are visibles by default to anyone.
What is the solution ?

Avatar
Zrušit

Use a redirect for all routes in the website_sale controller where: sitemap=True

See: https://github.com/odoo/odoo/blob/15.0/addons/website_sale/controllers/main.py

For example:
URL from: /shop/<model("product.template"):product>

Related Posts Odpovědi Zobrazení Aktivita
4
dub 25
8109
1
srp 23
2178
0
bře 21
2347
0
dub 23
1817
1
led 22
2741