Digital experiences for all disciplines
Forum Replies Created
-
Posted in: We hit Power Elite.
-
Mohammad, that’s perfect – thank you!
Hi,
Your last solution didn’t work. You just added the same script I already had in the js box. And like I said, you didn’t even close the script so the javascript was visible on the front end of my website!
Mohammad,
Strange question. I was hoping you were able to give me the solution to stopping the ajax search automatically for results which will force customers to hit enter instead)
Can you pass this onto Ed?
Thanks
Mohammad,
Thanks for trying, but all you did was add the same script that I had already tried, and you didn’t close the <script> so the js just appeared at the bottom of my site. i’ve since removed it. Any other ideas to stop the ajax auto search?
Thanks,
Jono.
This reply has been marked as private.Jumping onto an old post here. Looking to remove the predictive search as requested above. I’ve pasted the script into the Google Analytics section on General Options but it doesn’t work. Any other suggestions on this topic?
I’ve installed the ‘Search By Product tag’ plugin which works fine ONLY when you hit enter after doing a search, otherwise it says ‘No Results Found’
Thank you 🙂
This reply has been marked as private.That’s great, thank you!
Ah right okay, is it definitely possible to do though if I hired a developer? Will it be a case of editing that same php file or changing more stuff?
Thanks again Kyle, you’re awesome.
Sorry, the file had been previously edited by one of your team and I’ve pasted that edit above. I was hoping you could move the price to below the description on the one I’ve posted above. Php is quite alien to me, otherwise i’ve give it a go at merging the two PHP files.
I also mentioned the ‘Product Category’ bit being moved to above the Title (refer to the attachments above) is this possible?
I hope I’m not being a pain! And thank you so much for your time!
I’ve added the custom CSS and added the php. The price is now in the correct place but it’s removed the Title. I’m also wanting the Product Category to be displayed just above the Title (but without the words ‘product category: ‘)
I imagine the removal of the title has something to do with the fact that php file has already been tweaked. I’ll add the original I was using before below! Thank you so much 🙂
<?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 2.1.0 */ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?> <?php global $post, $product, $catalog_mode; $options = get_option('sf_neighborhood_options'); if (isset($options['enable_pb_product_pages'])) { $enable_pb_product_pages = $options['enable_pb_product_pages']; } else { $enable_pb_product_pages = false; } $product_short_description = sf_get_post_meta($post->ID, 'sf_product_short_description', true); /** * woocommerce_before_single_product hook * * @hooked woocommerce_show_messages - 10 */ do_action( 'woocommerce_before_single_product' ); ?> <div itemscope itemtype="http://schema.org/Product" id="product-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="entry-title" itemprop="name"><?php the_title(); ?></div> <?php /** * woocommerce_show_product_images hook * * @hooked woocommerce_show_product_sale_flash - 10 * @hooked woocommerce_show_product_images - 20 */ do_action( 'woocommerce_before_single_product_summary' ); ?> <div class="summary entry-summary"> <div class="summary-top clearfix"> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <p itemprop="price" class="price"><?php the_title();?> <?php echo ($product->get_price_html()=='Free!')?'£ Enquire':$product->get_price_html(); ?></p> <meta itemprop="priceCurrency" content="<?php echo get_woocommerce_currency(); ?>" /> <?php if (!$catalog_mode) { ?><link itemprop="availability" href="http://schema.org/<?php echo $product->is_in_stock() ? 'InStock' : 'OutOfStock'; ?>" /><?php } ?> </div> <?php if ( comments_open() ) { $count = $wpdb->get_var(" SELECT COUNT(meta_value) FROM $wpdb->commentmeta LEFT JOIN $wpdb->comments ON $wpdb->commentmeta.comment_id = $wpdb->comments.comment_ID WHERE meta_key = 'rating' AND comment_post_ID = $post->ID AND comment_approved = '1' AND meta_value > 0 "); $rating = $wpdb->get_var(" SELECT SUM(meta_value) FROM $wpdb->commentmeta LEFT JOIN $wpdb->comments ON $wpdb->commentmeta.comment_id = $wpdb->comments.comment_ID WHERE meta_key = 'rating' AND comment_post_ID = $post->ID AND comment_approved = '1' "); if ( $count > 0 ) { $average = number_format($rating / $count, 2); $reviews_text = sprintf(_n('%d Review', '%d Reviews', $count, 'swiftframework'), $count); echo '<div class="review-summary"><div class="star-rating" title="'.sprintf(__('Rated %s out of 5', 'woocommerce'), $average).'"><span style="width:'.($average*16).'px"><span class="rating">'.$average.'</span> '.__('out of 5', 'woocommerce').'</span></div><div class="reviews-text">'.$reviews_text.'</div></div>'; } } ?> <?php $has_cat = get_the_terms( $post->ID, 'product_cat' ); ?> <?php if ($has_cat != 0) { ?> <div class="product-navigation"> <div class="nav-previous"><?php previous_post_link( '%link', '<i class="fa-angle-right"></i>', true, '', 'product_cat' ); ?></div> <div class="nav-next"><?php next_post_link( '%link', '<i class="fa-angle-left"></i>', true, '', 'product_cat' ); ?></div> </div> <?php } ?> </div> <?php if ($product_short_description != "") { ?> <div class="product-short"> <?php echo do_shortcode($product_short_description); ?> </div> <?php } else { ?> <div class="product-short"> <?php echo apply_filters( 'woocommerce_short_description', $post->post_excerpt ); ?> </div> <?php } ?> <?php /** * woocommerce_single_product_summary hook * * @hooked woocommerce_template_single_title - 5 * @hooked woocommerce_template_single_price - 10 * @hooked woocommerce_template_single_excerpt - 20 * @hooked woocommerce_template_single_add_to_cart - 30 * @hooked woocommerce_template_single_meta - 40 * @hooked woocommerce_template_single_sharing - 50 */ do_action( 'woocommerce_single_product_summary' ); ?> </div><!-- .summary --> <?php if ($enable_pb_product_pages) { ?> <div id="product-display-area" class="clearfix"> <?php the_content(); ?> </div> <?php } ?> <?php /** * woocommerce_after_single_product_summary hook * * @hooked woocommerce_output_product_data_tabs - 10 * @hooked woocommerce_output_related_products - 20 */ do_action( 'woocommerce_after_single_product_summary' ); ?> </div><!-- #product-<?php the_ID(); ?> --> <?php do_action( 'woocommerce_after_single_product' ); ?>
This reply has been marked as private.Oops sorry, I didn’t see that there was second page to this thread with my question and your answer! Sorry to bother you!
Hi Mohammad, sorry to jump back to an older post but can you remember what you changed in order to display Not for Sale instead of ‘Free!’ – I’d like to know in case I want to change the wording in the future. Thanks 🙂
Perfect!
This reply has been marked as private. -
Posted in: We hit Power Elite.