Okay
  Public Ticket #3533788
How to hide stock tickets in events?
Closed

Comments

  •  1
    lord909 started the conversation


    Hi! I want to hide stock tickets in events.

    I have searched the documentation, but I cannot find the option to hide the stock in tickets.

    I use WooCommerce Products and I activated:

    - Stock Quantity in product (Ticket STEC option)

    - WooCommerce Inventory in product

    - In WooCommerce settings: Show Inventory Quantity Desactivated.


    Additional question: Can I control the inventory of the tickets only with the woocommerce inventory option?

  •  877
    Zhivko replied

    Hi,

    Just don't enable Manage stock:

    6072589401.png
    4255133520.png

    ---

    It's fine to use the WooCommerce's default stock quantity manager given the event is not repeated.



    Stachethemes Developer

  •  1
    lord909 replied

    Thank you Zhivko. 

    I have marked the event as you have shown in the screenshot, in the ticket part.
    However, we need to control the number of entries, so I need WooCommerce stock management.
    In WooCommerce settings I have marked that the quantity is not visible.
    Any css code to disable the field or just tell me the part of the code so I can disable it?


  •  877
    Zhivko replied

    Well, the fastest way is via css:

    .stec-event-product-available-quantity { display: none !important; }

    Stachethemes Developer

  •  1
    lord909 replied

    WoW! Great support. 

    I will give you 5 stars in the next review.
    Taking advantage of... Individual events show the top part without space. (attached image)
    I think it's because of my theme template. But I can't edit it since the event returns an empty result: /stec_event.
    Do you know the CSS so that I can lower the top of the event by about 30px?


    Attached files:  arriba menu espai buit.png

  •  877
    Zhivko replied

    This should work:

    .stec-single-page { margin-top: 30px; }

    Stachethemes Developer

  •  1
    lord909 replied

    It works! 

    Thank you very much

  •  1
    lord909 replied

    Last question:

    Is there any way in the event, that when they click add to cart after placing the ticket units it jumps to the cart directly?


  •  877
    Zhivko replied

    Yes, it can be done via a hook.

    Place the code below in your theme or child-theme functions.php file:

    add_action('wp_footer', function () {
    ?>
        <script>
            window.stecOnAddToCart = function() {
                if (STEC_VARIABLES.wc_cart_url) {
                    window.location.href = STEC_VARIABLES.wc_cart_url;
                }
            }
        </script>
    <?php
    });
    

    Stachethemes Developer