WCFM FooEvents Seating Issue
-
Seating option does not appear during Checkout.
I found that even if seating is configured in WCFM, event type is not changed to seating.
I have tried modifying wcfmu-view-wc-fooevents-products-manage.php but I couldn’t get it to work.
I have modified the seating options a little:<?php if ( WCFMu_Dependencies::wcfm_wc_fooevents_seating() ) { ?> <div class="fooevents_seating_wrap"> <div class="wcfm-clearfix"></div><br /> <div class="options_group"> <h2><?php _e( 'Seating', 'woocommerce-events' ); ?></h2> <div class="wcfm-clearfix"></div><br /> <div class="options_group"> <p class="form-field"> <span class="wcfm_title checkbox_title"><strong><?php _e('Enable Seating Option', 'woocommerce-events'); ?></strong></span> <input type="checkbox" class="wcfm-checkbox" name="WooCommerceEventsViewSeatingOption" value="on" <?php echo (empty($WooCommerceEventsType) || $WooCommerceEventsType == 'seating')? 'CHECKED' : ''; ?>> </p> </div> <div class="wcfm-clearfix"></div><br /> <div class="options_group"> <p class="form-field"> <span class="wcfm_title checkbox_title"><strong><?php _e('Display "View seating chart" option on checkout page?:', 'woocommerce-events'); ?></strong> <?php printf( '<span class="img_tip wcfmfa fa-question" data-tip="%s"></span>', __('Selecting this will display a - View seating chart - link on the checkout page. If you enable this option, please make sure that you have set up a seating chart under the "Seating" tab.', 'woocommerce-events') ); ?> </span> <input type="checkbox" class="wcfm-checkbox" name="WooCommerceEventsViewSeatingChart" value="on" <?php echo (empty($WooCommerceEventsViewSeatingChart) || $WooCommerceEventsViewSeatingChart == 'on')? 'CHECKED' : ''; ?>> </p> </div> <div class="wcfm-clearfix"></div> <table id="fooevents_seating_options_table" cellpadding="0" cellspacing="0"> <thead> <tr> <th><?php _e( 'Area Name (e.g. Row 1, Table 1, etc.)', 'woocommerce-events'); ?></th> <th><?php _e( 'Available Seats / Spaces', 'woocommerce-events'); ?></th> <th><?php _e( 'Variation', 'woocommerce-events'); ?></th> <th></th> </tr> </thead> <tbody> <?php foreach($fooevents_seating_options as $option_key => $option) : ?> <?php $option_ids = array_keys($option); ?> <?php $option_values = array_values($option); ?> <?php $x = 0; $num_option_ids = count($option_ids); $num_option_values = count($option_values); ?> <?php if($num_option_ids == $num_option_values): ?> <tr id="<?php echo $option_key; ?>"> <td><input type="text" id="<?php echo $option_ids[0]; ?>" name="<?php echo $option_ids[0]; ?>" class="fooevents_seating_row_name" value="<?php echo $option_values[0]; ?>" autocomplete="off" maxlength="70"/></td> <td> <input type="number" min="1" max="50" id="<?php echo $option_ids[1]; ?>" name="<?php echo $option_ids[1]; ?>" class="fooevents_seating_number_seats" value="<?php echo ($option_values[1]); ?>" > </td> <td> <select id="<?php echo $option_ids[2]; ?>" name="<?php echo $option_ids[2]; ?>" class="fooevents_seating_variations"> <?php echo '<option value="default"'; echo ($option_values[2] == "default")? ' SELECTED' : ''; echo '>Default</option>'; $handle = new WC_Product_Variable($product_id); $variations1 = $handle->get_children(); foreach ($variations1 as $value) { $single_variation=new WC_Product_Variation($value); // if (!empty($single_variation->get_price())) { echo '<option value="'.$value.'"'; echo ($option_values[2] == $value)? ' SELECTED' : ''; echo '>'.implode(" / ", $single_variation->get_variation_attributes()).' - '.get_woocommerce_currency_symbol().$single_variation->get_price().'</option>'; // } } ?> </select> </td> <td><a href="#" class="fooevents_seating_remove" class="fooevents_seating_remove">[X]</a></td> </tr> <?php endif; ?> <?php endforeach; ?> </tbody> </table> </div> </div> <div id="fooevents_seating_dialog" title="Seating Chart"> </div> <div id="fooevents_seating_info"> <p><a href="#" id="fooevents_seating_new_field" class='button button-primary'>+ New row</a><a id="fooevents_seating_chart" class='button button-primary'>View seating chart</a></p> </div> <input type="hidden" id="fooevents_seating_options_serialized" name="fooevents_seating_options_serialized" value="<?php echo $fooevents_seating_options_serialized; ?>" autocomplete="off" /> <input type="hidden" id="fooevents_seats_unavailable_serialized" name="fooevents_seats_unavailable_serialized" value="<?php echo get_post_meta($product_id, 'fooevents_seats_unavailable_serialized', true); ?>" autocomplete="off" /> <div id="fooevents_variations" style="display:none"> <?php $handle=new WC_Product_Variable($product_id); $variations1=$handle->get_children(); echo '<option value="default">Default</option>'; foreach ($variations1 as $value) { $single_variation = new WC_Product_Variation($value); // if (!empty($single_variation->get_price())) { echo '<option value="'.$value.'">'.implode(" / ", $single_variation->get_variation_attributes()).' - '.get_woocommerce_currency_symbol().$single_variation->get_price().'</option>'; // } } ?> </div> <?php } ?>
I have added another field named, enable seating option. Kindly provide me code to hide other fields in seating if box is unchecked.
If box is checked, change WooCommerceEventsType to seating.I’d really appreciate the help
- The topic ‘WCFM FooEvents Seating Issue’ is closed to new replies.