Gergana

Forum Replies Created

Viewing 15 posts - 16 through 30 (of 43 total)
  • Author
    Posts
  • Gergana
    Participant

    Hi Mike,

    I can offer my solution here. It is working for me. It consist only /wootickets/tickets.php override. I am providing you modification:

    <?php
    /**
     * Renders the WooCommerce tickets table/form
     *
     * @version 4.3.2
     *
     * @var bool $global_stock_enabled
     * @var bool $must_login
     */
    global $woocommerce;
    $checkout_url = $woocommerce->cart->get_checkout_url();
    
    $is_there_any_product         = false;
    $is_there_any_product_to_sell = false;
    $unavailability_messaging     = is_callable( array( $this, 'do_not_show_tickets_unavailable_message' ) );
    
    ob_start();
     $start_event_date = tribe_get_start_date( $event_id, true, 'Y-m-d h:i:s' );
    if ( !empty($start_event_date = tribe_get_start_date( $event_id, true, 'Y-m-d h:i:s' ) ) ) {
    
     echo do_shortcode( '[smartcountdown deadline="' .$start_event_date. '" fx_preset="Sliding_text_fade.xml" digits_style="font-family:Lucida Sans Unicode, Lucida Grande, sans-serif;font-weight:bold;" labels_size="19" title_before_down="Време до Началото" widget_style="text-align:center;" mode="countdown" units="days,hours,minutes,seconds"]' );
    }
    
    /**
     * Filter classes on the Cart Form
     *
     * @since  4.3.2
     *
     * @param array $cart_classes
     */
    $cart_classes = (array) apply_filters( 'tribe_events_tickets_woo_cart_class', array( 'cart' ) );
    ?>
    <form action="<?php echo esc_url( $checkout_url ) ?>" class="<?php echo implode( ' ', $cart_classes ); ?>" method="post" enctype='multipart/form-data'>
    	<h2 class="tribe-events-tickets-title" style="text-align: center;"><?php esc_html_e( 'Tickets', 'event-tickets-plus' ) ?></h2>
    <h2 class="tribe-events-tickets-title" style="text-align: center;"><?php esc_html_e( 'За да поръчате своя билет, можете да се обадите на ... или да попълните формата за поръчка по долу.', 'event-tickets-plus' ) ?></h2></ br>
    	<table width="100%" class="tribe-events-tickets">
    		<?php
    		foreach ( $tickets as $ticket ) {
    			/**
    			 * @var Tribe__Tickets__Ticket_Object $ticket
    			 * @var WC_Product $product
    			 */
    			global $product;
    
    			if ( class_exists( 'WC_Product_Simple' ) ) {
    				$product = new WC_Product_Simple( $ticket->ID );
    			} else {
    				$product = new WC_Product( $ticket->ID );
    			}
    
    			if ( $ticket->date_in_range( current_time( 'timestamp' ) ) ) {
    
    				$is_there_any_product = true;
    				$data_product_id = 'data-product-id="' . esc_attr( $ticket->ID ) . '"';
    
    				echo sprintf( '<input type="hidden" name="product_id[]" value="%d">', esc_attr( $ticket->ID ) );
    
    				echo '<tr>';
    
    				/**
    				 * Filter classes on the Price column
    				 *
    				 * @since  4.3.2
    				 *
    				 * @param array $column_classes
    				 */
    				$column_classes = (array) apply_filters( 'tribe_events_tickets_woo_quantity_column_class', array( 'woocommerce' ) );
    				echo '<td class="' . implode( ' ', $column_classes ) . '" ' . $data_product_id . '>';
    
    				if ( $product->is_in_stock() ) {
    					// Max quantity will be left open if backorders allowed, restricted to 1 if the product is
    					// constrained to be sold individually or else set to the available stock quantity
    					$max_quantity = $product->backorders_allowed() ? '' : $product->get_stock_quantity();
    					$max_quantity = $product->is_sold_individually() ? 1 : $max_quantity;
    					$original_stock = $ticket->original_stock();
    
    					// For global stock enabled tickets with a cap, use the cap as the max quantity
    					if ( $global_stock_enabled && Tribe__Tickets__Global_Stock::CAPPED_STOCK_MODE === $ticket->global_stock_mode()) {
    						$max_quantity = $ticket->global_stock_cap();
    						$original_stock = $ticket->global_stock_cap();
    					}
    
    					woocommerce_quantity_input( array(
    						'input_name'  => 'quantity_' . $ticket->ID,
    						'input_value' => 0,
    						'min_value'   => 0,
    						'max_value'   => $must_login ? 0 : $max_quantity, // Currently WC does not support a 'disable' attribute
    					) );
    
    					$is_there_any_product_to_sell = true;
    
    					$remaining = $ticket->remaining();
    
    					if ( $remaining ) {
    						?>
    						<span class="tribe-tickets-remaining">
    							<?php
    							echo sprintf( esc_html__( '%1$s available', 'event-tickets-plus' ),
    								'<span class="available-stock" ' . $data_product_id . '>' . esc_html( $remaining ) . '</span>'
    							);
    							?>
    						</span>
    						<?php
    					}
    
    					do_action( 'wootickets_tickets_after_quantity_input', $ticket, $product );
    				} else {
    					echo '<span class="tickets_nostock">' . esc_html__( 'Out of stock!', 'event-tickets-plus' ) . '</span>';
    				}
    				echo '</td>';
    
    				echo '<td class="tickets_name">';
    				echo $ticket->name;
    				echo '</td>';
    
    				echo '<td class="tickets_price">';
    				echo $this->get_price_html( $product );
    				echo '</td>';
    
    				echo '<td class="tickets_description">';
    				echo $ticket->description;
                                 // print the sales end date if it's defined
    // if ( !empty($ticket->end_date) ) echo '<br>Цената важи до: ' . $ticket->end_date;
    
    $ticketenddate = $ticket->end_date;
    if ( !empty($ticket->end_date) ) {
    echo do_shortcode( '[smartcountdown deadline="' .$ticketenddate. '" fx_preset="Sliding_text_fade.xml" digits_size="12" labels_size="13" title_before_down="Цената важи до" mode="countdown" units="days,hours,minutes,seconds"]' );
     }
    				echo '</td>';
    
    				echo '</tr>';
    
    				if ( class_exists( 'Tribe__Tickets_Plus__Attendees_List' ) && ! Tribe__Tickets_Plus__Attendees_List::is_hidden_on( get_the_ID() ) ) {
    					echo '<tr class="tribe-tickets-attendees-list-optout">' . '<td colspan="4">' .
    						 '<input type="checkbox" name="optout_' . $ticket->ID . '" id="tribe-tickets-attendees-list-optout-woo">' .
    						 '<label for="tribe-tickets-attendees-list-optout-woo">' . esc_html__( 'Don\'t list me on the public attendee list', 'event-tickets' ) . '</label>' . '</td>' .
    						 '</tr>';
    				}
    
    				include Tribe__Tickets_Plus__Main::instance()->get_template_hierarchy( 'meta.php' );
    			}
    		}
    
    		if ( $is_there_any_product_to_sell ) {
    			?>
    			<tr>
    				<td colspan="4" class="woocommerce add-to-cart">
    					<?php if ( $must_login ): ?>
    						<?php include Tribe__Tickets_Plus__Main::instance()->get_template_hierarchy( 'login-to-purchase' ); ?>
    					<?php else: ?>
    						<button type="submit" name="wootickets_process" value="1"
    							class="button alt"><?php esc_html_e( 'Add to cart', 'event-tickets-plus' );?></button>
    					<?php endif; ?>
    				</td>
    			</tr>
    			<?php
    		} ?>
    	</table>
    </form>
    
    <?php
    $content = ob_get_clean();
    if ( $is_there_any_product ) {
    	echo $content;
    
    	// @todo remove safeguard in 4.3 or later
    	if ( $unavailability_messaging ) {
    		// If we have rendered tickets there is generally no need to display a 'tickets unavailable' message
    		// for this post
    		$this->do_not_show_tickets_unavailable_message();
    	}
    } else {
    	// @todo remove safeguard in 4.3 or later
    	if ( $unavailability_messaging ) {
    		$unavailability_message = $this->get_tickets_unavailable_message( $tickets );
    
    		// if there isn't an unavailability message, bail
    		if ( ! $unavailability_message ) {
    			return;
    		}
    	}
    }

    The important stuffs here are:

    on line 11
    $checkout_url = $woocommerce->cart->get_checkout_url();

    and on line 33
    <form action="<?php echo esc_url( $checkout_url ) ?>" class="<?php echo implode( ' ', $cart_classes ); ?>" method="post" enctype='multipart/form-data'>

    The other customizations are for implementing the Smart Countdown FX into the ticket’s (showing the enddate of the ticket and the start date of the event.

    ###
    Hope this helps!

    Gergana
    Participant

    Hi Mike,

    I want to ask you what how you have succeeded to enter the collection of the attendee data into the checkout page(If I understood you correctly) in this paragraph

    Checkout Attendee Info
    This is where I currently collect my attendee info in my hacked solution on my live site. It works 100% of the time, because at this stage the user is locked into the purchase in their cart.

    #At this moment I made a template customization to skip the “Cart” page because there is no need of it(even it makes more harder for the people to buy the tickets – 60% of the clients leave the site after jumping into the cart).

    But I am interested how you have succeded to include the attendee fields into the checkout.

    in reply to: how to use shortcode with php? #1190841
    Gergana
    Participant

    Hi Devon,

    It can be done by using the wordpress function do_shortcode. I am providing you an example of how I’ve implemented a “Smart Countdown FX”s shortcode into the single_event.php.

    <?php
    $start_event_date_event = tribe_get_start_date( $event_id, true, 'Y-m-d h:i:s' );
    if ( !empty($start_event_date_event = tribe_get_start_date( $event_id, true, 'Y-m-d h:i:s' ) ) ) {
    
     echo do_shortcode( '[smartcountdown deadline="' .$start_event_date_event. '" fx_preset="Sliding_text_fade.xml" digits_style="font-family:Lucida Sans Unicode, Lucida Grande, sans-serif;font-weight:bold;" labels_size="19" title_before_down="Време до Началото" widget_style="text-align:center;" mode="countdown" units="days,hours,minutes,seconds"]' );
    }
    ?>

    It is working with me.

    • This reply was modified 9 years, 5 months ago by Gergana. Reason: inputing it into code
    in reply to: Admin printed tickets #1188995
    Gergana
    Participant

    I can add here one plugin created by Brook which is helping me in printing the tickets (one by one) and ship them to the clients. This is done before to send them, because they first should pay them. Hope this will help you. But it isn’t working as a bulk printing.

    Need to have the ticket before the completion of the order

    Gergana
    Participant

    Thank you George,

    I have modified and it was in big use of my implementation.

    in reply to: Printer Tickets #1185889
    Gergana
    Participant

    I can add here something which Brook wrote for one of specifics which we need.

    You can check it here:

    Need to have the ticket before the completion of the order

    This way you can have the ticket also before the order is completed. You can view it and afterwards print it if it’s needed. We are using it when a hard copy is shipped to address. For example Cash on Delivery is choosed as way of the payment.
    Hope this will help here.

    in reply to: Display Event Description on Ticket #1181820
    Gergana
    Participant

    If you need to customize something inside the ticket which is sent to the customer or participant you can check this thread https://theeventscalendar.com/support/forums/topic/how-to-show-the-ticket-sales-end-date-into-the-event/#dl_post-1160097

    ###There I’ve asked how can I make a customization(The end date of the event to be shown in the ticket)

    If you want to make this change you have to do it in child theme just to be sure your changes will stay even after update of the plugin. To edit the ticket you should create a folder /tribe-events/tickets/ and copy there the email.php from the plugin dir and edit it in the new location.

    in reply to: How to show the ticket sales end date into the event. #1160097
    Gergana
    Participant

    Hi Nico

    Correct. I have attached the ticket. I am trying to include the end date of the Event itself there in the hand written text inside the snapshot. : )
    Thank you!

    in reply to: How to show the ticket sales end date into the event. #1159948
    Gergana
    Participant

    Thanks Nico,

    This is working great! It is absolutely what I need.

    I am trying now to understand the logic how to include also the end date of the event inside the ticket itself, but it is without success. Could you please give me directions or if you know how to include this to share it with me.
    Thank you in advance!

    in reply to: Display users phone number in attendees list? #1159436
    Gergana
    Participant

    Hello Warren,

    You can check the knowledgebase for this request.

    Add Phone Numbers to the Attendee Report

    #For me is working perfectly. You should paste it into your theme/child-theme function.php file.

    in reply to: How to reset the summary inside the Attendee List? #1158987
    Gergana
    Participant

    Hi Geoff B.

    This works great!. Thank you very much for your effort : ). Give thanks also to Brook from me and all the involved people in this. You’re great!

    in reply to: How to reset the summary inside the Attendee List? #1157456
    Gergana
    Participant

    This reply is private.

    in reply to: How to reset the summary inside the Attendee List? #1157454
    Gergana
    Participant

    Hi Geoff B.

    We are using Woocommerce as ecommerce platform. TEC, ET and ET+

    I have done the steps which are given in the other thread. I have deleted the _tribe_proggressive_ticket_current_number row as it was suggested by you.

    You need to find and locate the post_id of your event (as defined in the wp_posts Database table).
    With that in hand run a search by post_id in the wp_postmeta table
    You should find a row that says _tribe_progressive_ticket_current_number (this is the one that you should edit to reset the count)

    To reset it, you can simply delete the row attached to that post_id.

    But after deleting the item there isn’t any change. I am providing a snapshots of the post id 35 which I am testing on it.(It is with already deleted row.) In the next post will provide the system information.
    Thank you in advance

    in reply to: How to show the ticket sales end date into the event. #1157159
    Gergana
    Participant

    Hi,
    Is there an update of this topic. Thank you in advance!

    in reply to: How to show the ticket sales end date into the event. #1156211
    Gergana
    Participant

    Hi Nico,

    I missunderstood your question. We are using Woocommerce for e-commerce plugin.

Viewing 15 posts - 16 through 30 (of 43 total)