WCFM FooEvents Seating Issue
-
Seating is not working in WCFM.
Kindly share a code that would switch to seating when Show seating in Checkout option is enabled.
Also I need a code that would turn Events option on by default and hide it.
Thanks
-
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
Ok, we are debugging this.
Thank You.
Can you please provide a code for this “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.”?Can you please show me a screenshot which fields do you want to hide?
Between, are you able to implement this function for WooCommerce default product editor?
Here are the things I need.
When enable seating is checked:
1. Show items in encircled in Screenshot 1
2. Change ‘WoocommerceEventsType’ to ‘seating’ as shown in Screenshot 2
3. Fooevents seating only allows single day events, so change event options to single day.OK, so as I understand you want to auto-select “seating” here – https://drive.google.com/file/d/1Cn86CadCPEzKq7JCQqUB3GQs2rt8beD5/view when “Enable Seating” checked at here – https://drive.google.com/file/d/1WNzk3BVzQ1NQziEHAmgFk0Nsd6HjzGKp/view
Please confirm.
Yes. Exactly.
Also seating option allows single day events only on fooevents. So when seating is selected, multiple days option should change to single day.A better option would be to add seating option as shown in here: https://drive.google.com/file/d/1Q0sJcrn1LT6NBL6FSKbpQj-cgm_z732R/view?usp=sharing
When seating option is selected, rest of the options should change accordingly.
OK, I am looking into this.
Thank You.
I have customized the plugin for my needs so I cannot update it.
I’d really appreciate if you could send me this in code so I can implement it without updating the plugin.HI @wick377 any news about this?
How you handling this issue?I got the options and the problem is just on Checkout no?
Yeah actually I did find a workaround.
WCFM isn’t compatible with FooEvents Seating and WCFM Team hasn’t responded but there is a way to fix the issue.
You will need to create a custom options field with Single day, Multi day and Seating options.
Then you can modify php or use javascript to set the value of WoocommerceEvntsType to seating etc and set fields to be shown accordingly.
btw WCFM doesn’t really work well with external plugins and new issues will pop up with every update. its better not to waste time on this
- The topic ‘WCFM FooEvents Seating Issue’ is closed to new replies.