Waiting list button not appearing
-
I have installed the YITH WooCommerce Waiting List plugin, but its not displaying the Add to Waiting List button when i’m logged in and looking at the product.
Does this plugin have a shortcode or php call that I can use to call this button into the template?
Any help would be great.
-
Hi Christopher,
Which version of woocommerce are you using?
“Add to waiting list” button appears only in single product page when it is “out of stock”.
Have you tried with twenty theme? I’m checking it whit twenty Fifteen and I have no trouble.Let me know, regards. π
i’m running 2.3.8 and I have one out of stock product here:
http://83.167.180.132/~meeple/product/the-3-commandments/
I have tested the twenty thirteen theme myself and it displays.. is there something i’ve missed?
I can see that the js file is being called in the header, but nothing else.
Is there a specific area of the woocommerce template where this appears? I might have removed that by accident while making my custom template.
Hi Christopher,
The button appears after ‘out of stock’ label.
I’ve checked your theme and it seems that it have modified or removed this WC standard filter ‘woocommerce_stock_html’.
I suggest you to try to restore filter in wc template file in templates/add-to-cart/single.phpUnfortunately, i’ve not removed that bit of code at all…
This is the content-single-product.php I compiled all the bits of the single product to be able to control some of the various aspects and to force it into columns etc. The client would just love to have this Waiting List plugin as part of the system.
That was the reason why I was wondering if there was a shortcode (like the wishlist plugin, which is awesome btw) so that I could just add it to the template below where I needed it..
Here is the code i’m using:
<?php /** * The template for displaying product content in the single-product.php template * * Override this template by copying it to yourtheme/woocommerce/content-single-product.php * * @author WooThemes * @package WooCommerce/Templates * @version 1.6.4 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } global $post, $woocommerce, $product; $heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Product Description', 'woocommerce' ) ) ); if ( ! $product->is_purchasable() ) { return; } $cat_count = sizeof( get_the_terms( $post->ID, 'product_cat' ) ); $tag_count = sizeof( get_the_terms( $post->ID, 'product_tag' ) ); $rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) ); ?> <?php /** * woocommerce_before_single_product hook * * @hooked wc_print_notices - 10 */ do_action( 'woocommerce_before_single_product' ); if ( post_password_required() ) { echo get_the_password_form(); return; } ?> <div itemscope itemtype="<?php echo woocommerce_get_product_schema(); ?>" id="product-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="images gameimage"> <?php if ( has_post_thumbnail() ) { $image_title = esc_attr( get_the_title( get_post_thumbnail_id() ) ); $image_caption = get_post( get_post_thumbnail_id() )->post_excerpt; $image_link = wp_get_attachment_url( get_post_thumbnail_id() ); $image = get_the_post_thumbnail( $post->ID, apply_filters( 'single_product_large_thumbnail_size', 'shop_single' ), array( 'title' => $image_title, 'alt' => $image_title ) ); $attachment_count = count( $product->get_gallery_attachment_ids() ); if ( $attachment_count > 0 ) { $gallery = '[product-gallery]'; } else { $gallery = ''; } echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<a href="%s" itemprop="image" class="woocommerce-main-image zoom" title="%s" data-rel="prettyPhoto' . $gallery . '">%s</a>', $image_link, $image_caption, $image ), $post->ID ); } else { echo apply_filters( 'woocommerce_single_product_image_html', sprintf( '<img src="%s" alt="%s" />', wc_placeholder_img_src(), __( 'Placeholder', 'woocommerce' ) ), $post->ID ); } ?> <?php do_action( 'woocommerce_product_thumbnails' ); ?> </div> <div class="summary entry-summary description"> <h1 itemprop="name" class="product_title entry-title"><?php the_title(); ?></h1> <?php the_content(); ?> </div><!-- .summary --> <div class="column3 productwidth"> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <div class="containerforprice"> <div style="display:inline-block;width:30%;float:left;margin-top:15px;" class="outofstockprice"><p class="price"><?php echo $product->get_price_html(); ?></p><meta itemprop="price" content="<?php echo $product->get_price(); ?>" /> </div> <div style="display:inline-block;width:68%;"> <?php if ( $product->is_in_stock() ) : ?> <?php do_action( 'woocommerce_before_add_to_cart_form' ); ?> <form class="cart" method="post" enctype='multipart/form-data'> <?php do_action( 'woocommerce_before_add_to_cart_button' ); ?> <?php if ( ! $product->is_sold_individually() ) woocommerce_quantity_input( array( 'min_value' => apply_filters( 'woocommerce_quantity_input_min', 1, $product ), 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->backorders_allowed() ? '' : $product->get_stock_quantity(), $product ) ) ); ?> <input type="hidden" name="add-to-cart" value="<?php echo esc_attr( $product->id ); ?>" /> <button type="submit" class="single_add_to_cart_button button alt"><?php echo $product->single_add_to_cart_text(); ?></button> <?php do_action( 'woocommerce_after_add_to_cart_button' ); ?> </form> <?php do_action( 'woocommerce_after_add_to_cart_form' ); ?> <?php endif; ?> </div> </div> <meta itemprop="priceCurrency" content="<?php echo get_woocommerce_currency(); ?>" /> <link itemprop="availability" href="http://schema.org/<?php echo $product->is_in_stock() ? 'InStock' : 'OutOfStock'; ?>" /> </div> <div class="greybar"><span class="greybartitle">Availability</span><?php // Availability $availability = $product->get_availability(); $availability_html = empty( $availability['availability'] ) ? '' : '<p class="stock ' . esc_attr( $availability['class'] ) . '">' . esc_html( $availability['availability'] ) . '</p>'; echo apply_filters( 'woocommerce_stock_html', $availability_html, $availability['availability'], $product ); ?> </div> <div class="greybar"><span class="greybartitle">Designer</span><p><?php the_field('designer'); ?></p></div> <div class="greybar"><span class="greybartitle">Publisher</span> <ul class="categorylist"><?php $taxonomy = 'product_cat'; // get the term IDs assigned to post. $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); // separator between links $separator = ', '; if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) { $term_ids = implode( ',' , $post_terms ); $terms = wp_list_categories( 'title_li=&child_of=52&taxonomy=' . $taxonomy . '&include=' . $term_ids ); $terms = rtrim( trim( str_replace( '<br />', $separator, $terms ) ), $separator ); // display post categories echo $terms; } ?></ul></div> <div class="greybar"><span class="greybartitle">Genre</span> <ul class="categorylist"><?php $taxonomy = 'product_cat'; // get the term IDs assigned to post. $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); // separator between links $separator = ', '; if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) { $term_ids = implode( ',' , $post_terms ); $terms = wp_list_categories( 'title_li=&child_of=40&taxonomy=' . $taxonomy . '&include=' . $term_ids ); $terms = rtrim( trim( str_replace( '<br />', $separator, $terms ) ), $separator ); // display post categories echo $terms; } ?></ul></div> <div class="greybar"><span class="greybartitle">Published</span> <ul class="categorylist"><?php $taxonomy = 'product_cat'; // get the term IDs assigned to post. $post_terms = wp_get_object_terms( $post->ID, $taxonomy, array( 'fields' => 'ids' ) ); // separator between links $separator = ', '; if ( !empty( $post_terms ) && !is_wp_error( $post_terms ) ) { $term_ids = implode( ',' , $post_terms ); $terms = wp_list_categories( 'title_li=&child_of=63&taxonomy=' . $taxonomy . '&include=' . $term_ids ); $terms = rtrim( trim( str_replace( '<br />', $separator, $terms ) ), $separator ); // display post categories echo $terms; } ?></ul></div> <div class="greybar"><span class="greybartitle">Expansions</span> <?php if( get_field('has_extensions') ) { ?> <?php $post_object = get_field('expansions'); if($post_object) : $post = $post_object; // Overwrite $post setup_postdata( $post ); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <?php // Reset $post so the rest of the page works wp_reset_postdata(); endif; ?> <?php } else { ?> <p>None</p> <?php } ?></div> <div class="greybar"><span class="greybartitle">Cafe Location</span><p><?php the_field('cafe_location'); ?></p></div> <div class="containerforplayers"> <div class="players"><img src="http://83.167.180.132/~meeple/wp-content/uploads/2015/05/players.png"><?php the_field('number_of_players'); ?></div> <div class="age"><img src="http://83.167.180.132/~meeple/wp-content/uploads/2015/05/age.png"><?php the_field('age_from'); ?></div> <div class="time"><img src="http://83.167.180.132/~meeple/wp-content/uploads/2015/05/clock.png"><?php the_field('duration'); ?></div> </div> <div class="product_meta"> <?php do_action( 'woocommerce_product_meta_start' ); ?> <?php if ( wc_product_sku_enabled() && ( $product->get_sku() || $product->is_type( 'variable' ) ) ) : ?> <div class="greybar" style="display:none;"><span class="greybartitle sku_wrapper"><?php _e( 'SKU', 'woocommerce' ); ?></span> <p><span class="sku" itemprop="sku"><?php echo ( $sku = $product->get_sku() ) ? $sku : __( 'N/A', 'woocommerce' ); ?></span></p></div> <?php endif; ?> <div class="greybar" style="display:none;"><span class="greybartitle sku_wrapper">Categories</span><p><?php echo $product->get_categories( ', ', '<span class="posted_in">' . _n( '', '', $cat_count, 'woocommerce' ) . ' ', '.</span>' ); ?></p></div> <?php echo $product->get_tags( ', ', '<span class="tagged_as">' . _n( 'Tag:', 'Tags:', $tag_count, 'woocommerce' ) . ' ', '.</span>' ); ?> <?php do_action( 'woocommerce_product_meta_end' ); ?> </div> <?php echo do_shortcode('[yith_wcwl_add_to_wishlist]'); ?> </div> <br/> <br/> <?php /** * woocommerce_after_single_product_summary hook * * @hooked woocommerce_output_product_data_tabs - 10 * @hooked woocommerce_upsell_display - 15 * @hooked woocommerce_output_related_products - 20 */ do_action( 'woocommerce_after_single_product_summary' ); ?> <meta itemprop="url" content="<?php the_permalink(); ?>" /> </div><!-- #product-<?php the_ID(); ?> --> <?php do_action( 'woocommerce_after_single_product' ); ?>Any ideas?
Hi,
maybe the error is not with this filter ‘woocommerce_stock_html’ but with another one.
For this plugin we use also this action ‘woocommerce_before_main_content’, you can find it in woocommerce/templates/single-product.php. Have you customized or changed this file?Unfortunately for this free version is not possible to use shortcode.
Let me know, regards π
The topic ‘Waiting list button not appearing’ is closed to new replies.