Moonsoft Software Solutions

In Shopping Cart version, no Add to Cart if result is 0

Started 31 Dec 2014 · 1 reply

  1. moon_1892
    I would like to hide the Add to Cart button is the calculator returns no value.
  2. Moonsoft support
    Hi,
    you would need to hide/show the button using javascript at 'after execution' tab. In order to hide buttons

    CB("").hide();

    for hikashop button, and

    CB("").hide();

    for virtuemart button.

    After that, you can use your condition to show the button only if needed. If you have your price at the code at the variable $price, for ex, you can output it inside a hidden input at the calculator ouput, for ex:

    input type="hidden" id="myresult" value="##price##"

    and add to the javascript tab the condition to show, something like:

    if(CB("#myresult").val()!="0"){

    CB("").show(); //for hika
    CB("").show(); //for virtue

    }


    Please place a ticket at the helpdesk if you need more help with this, we can share there html code which is not allowed at the forum.


    Thanks, regards

Still stuck?

Customers with an active license can open a support ticket.

Log in to open a ticket