Forum Replies Created
-
AuthorPosts
-
GeorgeParticipantGeorgeParticipant
Hi Casey,
Please keep this post open until your team releases a new version with fix. Then we will test and let you know if its completely fixed or not. Thanks, – georgeFebruary 28, 2014 at 9:09 am in reply to: wootickets not upgraded to be compatible with woocommerce v2.1 #110872GeorgeParticipantHi Kelly, thanks for quickly resolving the issues, I monitored it last couple of days and so far its fine.
GeorgeParticipantThough 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.phpfor 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.
GeorgeParticipantI need this feature too.
GeorgeParticipantHi 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. 😀
-
AuthorPosts