Dynamic Pricing for Tickets

Home Forums Ticket Products Event Tickets Plus Dynamic Pricing for Tickets

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #47057
    Patrick
    Participant

    May I know is there a way to set different prices for one type of ticket based on the chosen amount?

    Thanks!

    #47124
    Barry
    Member

    Possibly yes – but this would be something you’d have to handle through WooCommerce (whether by discounts or some other means), it’s not something the WooTickets facilitates by itself.

    You can link to the WooCommerce product editor from each ticket by following the Edit in WooCommerce link 🙂

    #47127
    Patrick
    Participant

    Thanks Barry – I have tried to change it to a Variable product but to no avail. It seems that the only way to do it is via a paid plugin – Dynamic Pricing

    #47229
    George
    Participant

    Hi I am having similar problem, I want to use variable ticket, and I followed the “woocommerce edit link” on event edit screen under “ticket” meta box, and even though I have set variable product its listing only the simple product, and then I reviewed your code and I believe your code is not dynamic, its kind of hard coded to show only simple ticket (added on event page, under ticket metabox), so please have a look and fix it. I can work on that, but I don’t want to loose the leverage of receiving updates. 😀

    #47259
    Patrick
    Participant

    Hi @George,
    Thanks for the precious info – do you mind sharing the code with me? 🙂

    #48169
    Barry
    Member

    We’ll leave this open for a few more days – however after that I’ll close this thread (it could be worth seeking help on a WooCommerce specific forum for this sort of question).

    #48188
    George
    Participant

    Though my code mod* is specific to my needs, but you can still understand whats lacking in original code,
    if ( class_exists( ‘WC_Product_Simple’ ) ) {
    $product = new WC_Product_Simple( $ticket->ID );
    } else {
    $product = new WC_Product( $ticket->ID );
    }
    should be replaced with
    $product = get_product($ticket->ID);

    and replace
    echo “”;
    if ( $product->is_in_stock() ) {
    woocommerce_quantity_input( array( ‘input_name’ => ‘quantity_’ . $ticket->ID, ‘input_value’ => 0, ‘min_value’ => 0, ‘max_value’ => $product->backorders_allowed() ? ” : $product->get_stock_quantity(), ) ); $is_there_any_product_to_sell = true;
    } else {
    echo “” . esc_html__( ‘Out of stock!’, ‘tribe-wootickets’ ) . “”;
    }
    echo “”;

    with this (hack way but you can improvise and improve it),
    echo “”;
    remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_title’, 5);
    remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10);
    remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_excerpt’, 20);
    //remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30);
    remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_meta’, 40);
    remove_action(‘woocommerce_single_product_summary’, ‘woocommerce_template_single_sharing’, 50);
    echo do_action(‘woocommerce_single_product_summary’);
    echo “”;

    also if you would like to modify
    single-product/add-to-cart/simple.php
    single-product/add-to-cart/variable.php

    for specifically on events ticket area (not standard product or shop pages),
    I have modified these files and put them under
    my-theme/events/woocommerce/*
    by using this
    global $woocommerce;

    add_filter(‘woocommerce_locate_template’, ‘tickets_locate_template’, 10, 3);

    function tickets_locate_template($template, $template_name, $template_path) {
    switch ($template_name) {
    case ‘single-product/add-to-cart/simple.php’:
    case ‘single-product/add-to-cart/variable.php’:
    $template = get_template_directory() . ‘/events/woocommerce/’ . $template_name;
    break;
    }
    return $template;
    }
    specifically on this template of wootickets (named tickets.php under views folder)

    Hope it helps, and @barry its not woocommerce related issue it relates your wootickets (its forcing single product on tickets, if follow woocommerce standards it should work without creating its own product loop (aka tickets in this case))

    If still confused ping and I will try to make it clear.

    #48191
    Patrick
    Participant

    Thanks George – you are the man!

    #48225
    Barry
    Member

    Good stuff – and props to George there. I’ll go ahead and close this thread since it seems we’re all sorted here.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Dynamic Pricing for Tickets’ is closed to new replies.