Okay
  Public Ticket #3562091
Free download
Closed

Comments

  • Curtis started the conversation

    Is there a way to offer free downloads with the mp3 audio player in exchange for their name and email address. I’m trying to build an email list by offering something 

  •  1,114
    Max replied

    Hi,

    its possible by using Elementor Pro's form, but its requires custom javascript.

    Here is an example we did: Go to https://templates.sonaar.io/audience/ then scrolldown to the Free Beats section: https://drops.sonaar.io/i/aKbCfv

    1) When people click on download, it popups an Elementor Form.

    2) When people submit their email, the popup is automatically closed and the download button is now active for people who submitted their email.

    This require custom Javascript place in the Elementor Popup.

    <script>
    function srp_setFormRequired() {
        // "freebeats_widget" represents your player ID. (https://drops.sonaar.io/i/lzi9LZ)
        const playerId = "freebeats_widget";
        // "1396" represents your elementor template popup ID. (https://drops.sonaar.io/i/evBekl)
        const popupElementor_Id = 1396;
        $ = jQuery;
        const player = $('#' + playerId);
        if( JSON.parse(localStorage.getItem("elementor")) === null || (JSON.parse(localStorage.getItem("elementor")) !== null && JSON.parse(localStorage.getItem("elementor"))['popup_' + popupElementor_Id + '_disable'] !== true)){
        // Get the 'open_selector' value from the popup settings
            player.find('*').css('pointer-events', 'none');
        }
        const myForm = $('[data-elementor-id="' + popupElementor_Id + '"] .elementor-form');
        if( 
            typeof myForm.parents('[data-elementor-type="popup"]').data('elementor-settings') != 'undefined' &&  
            typeof myForm.parents('[data-elementor-type="popup"]').data('elementor-settings').open_selector != 'undefined' &&  
            myForm.parents('[data-elementor-type="popup"]').data('elementor-settings').open_selector == '#' + playerId
        ){
            myForm.on('submit_success', function() {
                player.find('*').css('pointer-events', 'initial');
            });
        }
    }
    srp_setFormRequired();
    </script>
    

    If you need help customizing it and make it working on your site, we do offer a customization service available here: https://sonaar.io/service/website-customization-service/

    Thanks,


    Max from the Sonaar.io Crew