VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: kratzi on January 28, 2016, 19:50:54 PM

Title: Specifications if customer is on guest checkout
Post by: kratzi on January 28, 2016, 19:50:54 PM
Hi I am running my test version on J. 3.4.8 VM 3.0.12

I would like to hide some divs or style them differently when a user wants to checkout as guest. So basically only if the customer has already entered a billing or shipping address.

I am trying with this:

<script>
if($(".output-billto span.values").html().length)
    {
    $(".billto-shipto").show();
    }
</script>


in my css I have

.billto-shipto {display:none;}


Unfortunately it is not working even though it works here: http://jsfiddle.net/WPf5f/68/ (http://jsfiddle.net/WPf5f/68/)
Basically if you delete the span it won't show the div. The idea is that if there is no span for email address as the customer did not enter one the whole div should not be shown.

Any idea how I could solve this.
Thank you

kratzi
Title: Re: Specifications if customer is on guest checkout
Post by: kratzi on January 28, 2016, 23:04:04 PM
Here is the solution.

<script>
if(jQuery(".output-billto span.vm2-email").html().length)
    {
    jQuery(".billto-shipto").show();
    }
</script>


Regards