Digital experiences for all disciplines
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Moving some information on the produce page
New Landing › How can we help? › Themeforest Theme Support › Neighborhood › Moving some information on the produce page
- This topic has 8 replies, 2 voices, and was last updated 9 years by Kyle – SUPPORT.
-
Posted in: Neighborhood
-
January 21, 2015 at 12:48 am #142867
Hello! I think this will be the very last request from me on this site!
I’m hoping to move the Price to below the description and then move the text which shows the ‘Product Category’ up to above the Title (And then in the same font as the title without the text saying ‘Product Category’)
I’ve attached a screenshot how it is now and then a mock up of how I’d like it to be.
The product page has already been tweaked a little bit so let me know if you need any php snippets.
Really hoping you guys can help me out on this one!
Attachments:
You must be logged in to view attached files.January 21, 2015 at 12:50 am #142869This reply has been marked as private.January 22, 2015 at 11:27 am #143387Hi
Add this to your custom css:
.woocommerce div.product .summary p.price, .woocommerce-page div.product .summary p.price { float: none; margin-bottom: 50px; }
And if you’re using a child theme, upload this file to childtheme/woocommerce/
https://www.dropbox.com/s/kexq7arplh06plt/content-single-product.php?dl=0
– Kyle
January 22, 2015 at 11:59 am #143402I’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' ); ?>
January 22, 2015 at 12:02 pm #143404Sorry I’m not sure what you mean? Have you previously edited the file, and now my file has overwritten your edit?
If so you’ll just have to make the change in the new file
– Kyle
January 22, 2015 at 12:38 pm #143424Sorry, 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!
January 22, 2015 at 12:47 pm #143428I’ve updated the file in the link, so you’ll need to re download it and add it replace the file. I’ve just added in the title for you
As for the category, I’m afraid that’s more complex and can not be done easily
– Kyle
January 22, 2015 at 1:16 pm #143440That’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.
January 22, 2015 at 1:22 pm #143443The categories are called in a different file, they’ll just have to add some extra php to call it in the position you want to use it
– Kyle
-
Posted in: Neighborhood
You must be logged in and have valid license to reply to this topic.