Support

Home Forums Event Espresso Premium Prerequisite Adult Ticket

Prerequisite Adult Ticket

Posted: February 20, 2019 at 8:15 am


Mike

February 20, 2019 at 8:15 am

We’re on EE3 and trying to use your suggestion from the topic “Prerequisite Adult Ticket before Child Ticket Purchase” to enforce a full price adult ticket before adding discounted additional adult tickets or children tickets and that part is working fine. However, while the script automatically adds 1 full price adult ticket to the cart, the cart total at the bottom is initially blank. I tried adding

<?php do_action( 'action_hook_espresso_shopping_cart_after_total' ); ?>

after the jscript snippet but that just rendered the total as “0.00” instead of blank. How can I get the initial total to reflect that a full price adult ticket is already in the cart?


Tony

  • Support Staff

February 22, 2019 at 6:48 am

Hi Mike,

Can you link me to a page I can view this on, please?


Mike

February 22, 2019 at 8:11 am

This reply has been marked as private.


Tony

  • Support Staff

February 26, 2019 at 3:48 am

The quickest option is to just us Javascript to click the Refresh Total button after the above change, so add:

$("#event_espresso_refresh_total").click();

To the script after you’ve set the dropdown to one and removed option 5.

Something like:

<script>jQuery(document).ready(function($){
    $("select[name='price_id[1947][2251]'] option[value='0']").remove(); 
    // removes the 0 option for the adult ticket
    $("select[name='price_id[1947][2252]'] option[value='5']").remove(); 
    // removes the 5 option for the child ticket
    $("#event_espresso_refresh_total").click();
    // refresh cart total
});
</script>

The support post ‘Prerequisite Adult Ticket’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso