Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
5071 Widoki

Hello all, i would like to insert a simple button in my home page that does the following action:

If a non logged guest click the button -> display login page

If a logged customer click the button -> display shop page


To do so i edited the HTML of my page inserting the following:

Into a <div>: <button type="button" class="btn btn-success btn-lg" onlick="myFunction()">START</button>


On the top, into the main <t>:


<t name="Homepage" priority="29" t-name="website.homepage">  <---- this is the main <t> where I inserted the code

<script>

    function myFunction(){

        alert("1");

        if <?php if ( is_user_logged_in() ) {window.location="/page/product_brands" } else {window.location="/web/login"} ?>

   }

</script>


This not works. Please note the "alert()" as first istruction in my function to check whether or not the function itself is called, this is NEVER called.

Any help? Thank you

Awatar
Odrzuć
Najlepsza odpowiedź

Here are some links that may be useful for you friend:

http://openerp-web-v7.readthedocs.org/en/latest/module.html

http://odoo-80.readthedocs.org/en/latest/howtos/website.html

https://www.odoo.com/documentation/8.0/index.html

https://doc.odoo.com/trunk/training/

Regards.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sie 22
13931
2
paź 18
5116
2
lut 18
34704
3
paź 24
2678
0
mar 24
1499