Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter silvermatthew

    (@silvermatthew)

    Woocommerce smart coupon just came out with version 4.6.0. It seemed to have solved the issue. So I will go ahead and marked this ticket as resolved. Thanks for the reply.
    Matthew.

    Thread Starter silvermatthew

    (@silvermatthew)

    Wow that was quick. Thank you, that is all I needed to know.

    Thread Starter silvermatthew

    (@silvermatthew)

    Thanks

    Thread Starter silvermatthew

    (@silvermatthew)

    Now that I look more closely, it also has to do also with the way he set up his shortcode for [testimonial].
    I will look more into this and if I figure this out I will mark this as solved. However if someone knows of a way to set up a template that can achieve the desire results I would still like to know.
    Thanks you for your help.

    Thread Starter silvermatthew

    (@silvermatthew)

    I did just that. the problem that I am running into is that the [hidden_content] short code will hide text if you go like this
    [hidden_content_disclaimer button_text=”I agree to the disclaimer”] some random texts goes here…
    [/hidden_content_disclaimer]
    But when I place the short code [testimonials] in between the hidden_content like this
    [hidden_content]

    [testimonials]

    [/hidden_content]
    The testimonials shortcode still executes. All though the users have not click the agreement link. The disclaimer is there but so are all the testimonies. I will past the code for the the hidden content as well as the disclaimer if you think it will help.

    /*———————————————————————————–*/

    /* Show hidden content after user accepts disclaimer */

    /*———————————————————————————–*/

    function slh_hidden_content_disclaimer($atts, $content) {

    extract(shortcode_atts(array(

    ‘href’ => ‘#’,

    ‘button_text’ => ‘I agree to the disclaimer’

    ), $atts));

    $output = “<div id=’content-disclaimer-button’>”.do_shortcode($content);

    $output .= “<p>“.$button_text.”</p></div>”;

    return $output;

    }

    add_shortcode(‘hidden_content_disclaimer’,’slh_hidden_content_disclaimer’);

    /*———————————————————————————–*/

    /* Hide content until user accepts disclaimer */

    /*———————————————————————————–*/

    function slh_hidden_content($atts, $content) {

    extract(shortcode_atts(array(

    ‘div_class’ => ‘content-unapproved’,

    ‘button_text’ => ‘I agree to the disclaimer’

    ), $atts));

    ?>

    <style type=”text/css”>

    .content-unapproved {

    display: none;

    }

    </style>

    <script type=”text/javascript”>

    var double_click = false;

    jQuery(document).ready(function($) {

    //console.log(‘ready to go!’);

    $(“#approve-disclaimer”).on(‘click’, function(e){

    e.preventDefault;

    e.stopImmediatePropagation;

    e.stopPropagation;

    $(‘link[rel=”icon”]’).attr(‘href’,’http://smattmyers.com/missing-logo.png&#8217;);

    $(‘link[rel=”shortcut icon”]’).attr(‘href’,’http://smattmyers.com/missing-logo.png&#8217;);

    var nav = $(“#nav”);

    var new_nav = $(“#new-nav”);

    var c = $(“.content-unapproved”);

    c.show(‘fast’);

    $(“#content-disclaimer-button”).hide(‘fast’);

    $(“#content”).css({

    ‘background’: “white”,

    ‘width’: “100%”,

    ‘height’: “auto”,

    ‘position’: “absolute”,

    ‘z-index’: 999,

    ‘border’: “15px solid gray”,

    ‘padding’: 20,

    ‘top’: -290,

    ‘left’:-20

    });

    var url = (getCookie(‘lastLocation’) ? getCookie(‘lastLocation’): ‘http://www.silverliningherbs.com&#8217;);

    var return_button = “Return to Silver Lining Herbs “;

    new_nav.append(return_button);

    new_nav.css({‘margin-top’:’44px’});

    setTimeout(function(){double_click = true;},1000);

    $(“#theBody”).css({‘background-image’:’none’});

    $(“.bg-shadow.group”).css({‘background’:’none’,’background-image’:’none’});

    });

    $(document).on(‘click’, ‘a’, function(e) {

    if (double_click) {

    alert(‘You are now returning to the Silver Lining Herbs website’);

    }

    });

    });

    </script>

    <?php

    $output = “<div id=’hidden-content’ class=’content-unapproved’><div id=’new-nav’></div>”;

    $output .= do_shortcode($content);

    $output .= “</div>”;

    return $output;

    }

    add_shortcode(‘hidden_content’,’slh_hidden_content’);

    If someone could help me figure out why it is not hidden the shortcode [testimonial] then I will go that route.
    Thanks for your help.

Viewing 5 replies - 1 through 5 (of 5 total)