Okay
  Public Ticket #3738891
Hide subscribe button
Open

Comments

  •   selinkocagoncu started the conversation
  •  894
    Zhivko replied

    Hi,

    1) Open your event template with the builder.

    2) Insert "Custom JS" element in the template. You can place it somewhere at the bottom.

    4420775295.png

     

    9616595219.png

    3) Open the Custom JS element settings by clicking on the cogwheel icon.

    8412339803.png

    4) In the JavaScript textarea place the following javascript code:

    (function () {
    
        const userId = STEC_VARIABLES?.current_user?.data?.id;
    
        if (!userId) {
            
            const elementToHide = document.querySelector('.stec-event-share-and-export-subscribe');
    
            if (elementToHide) {
                elementToHide.style.display = 'none';
            }
        }
    
    })();

    5224446060.png

    2116825314.png


    Stachethemes Developer

  •   selinkocagoncu replied privately
  •   selinkocagoncu replied privately
  •   selinkocagoncu replied privately
  •  894
    Zhivko replied

    You can do it via the template builder.

    Open your template.

    Click on the Row Section that wraps the Comments:

    6078385424.png

    Click on the cogwheel button to enter its settings.

    In the Conditions selector add: "Logged-in":

    9945749778.png

     


    Stachethemes Developer

  •  6
    selinkocagoncu replied

    That is perfect! Thank you very much!

  •   selinkocagoncu replied privately
  •  894
    Zhivko replied

    Are you sure it's not old cache on your mobile device?

    The elements share same class name both for desktop and mobile. It doesn't make sense to show on one and be hidden on another.

    Where can I see this issue?


    Stachethemes Developer

  •   selinkocagoncu replied privately
  •  894
    Zhivko replied

    Try different approach. 

    Remove the custom js code I've sent you earlier and instead place two row sections with logged-in and not logged-in conditions. I'm attaching you a video of what I mean.

    Attached files:  Example.mp4


    Stachethemes Developer

  •  6
    selinkocagoncu replied

    It appears to be solved; thank you very much!