This topic has 17 replies, 2 voices, and was last updated 8 years, 9 months ago ago by Robert Hall
Hello,
You can show the Short Product Description (http://prntscr.com/9waf4a) under the price.
Also you need to add this code in Global Custom CSS.
.products-grid .product-excerpt {
display: block;
}
Regards,
Robert Hall.
Hi Robert,
Nice to talk with you again !! 🙂
Actually, i would like to add custom field and write product brand name in the red rectangle only and i dont want to show the short description.
Or if you have any professional idea how can make the brands into this red rectangle column easily? I tried to buy bramds plugin but it doesn`t work so far.
Thank you ao much for your support and idea!!
Regards
Keith
You can try to add the following code in \wp-content\themes\woopress\woocommerce\content-product.php file on line 150
<?php
$terms = wp_get_post_terms( $post->ID, 'brand' );
if(count($terms)>0) {
?>
<div class="custom-product-brands">
<?php foreach($terms as $brand) { ?>
<a href="<?php echo get_term_link($brand); ?>">
<?php
echo $brand->name;
?>
</a>
<?php } ?>
</div>
<?php
}
?>
after this code
<?php if (etheme_get_option('product_page_productname')): ?>
<div class="product-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</div>
<?php endif ?>
Please see screenshot how it should be http://prntscr.com/9wbin9
Also we recommended to do it in the Child Theme.
We have already created and included child theme in theme package. You just need to find woopress-child folder in theme package and upload it to /wp-content/themes/ folder of your server.
Please copy content-product.php file into it saving folder structure like:
wp-content/themes/woopress_child/woocommerce/content-product.php and make changes there.
Regards,
Robert Hall.
You are the best of the best!!
So means i just upload content-product.php in child theme and adding the code in child theme. Am i correct?
1 more question, could you please show me which coding that you provided i can modify it if i want to put the brands name at title above or under price in category page in future?
Thank you for you professional support always.
Thanks
Keith
Yes, correct. If you’ll have the problems with adding code in content-product.php file then provide us with FTP credentials in Private Content and we’ll help you to add this code.
To display a brand name below the price you need add our code below the following part of code.
<?php
/**
* woocommerce_after_shop_loop_item_title hook
*
* @hooked woocommerce_template_loop_rating - 5
* @hooked woocommerce_template_loop_price - 10
*/
if (etheme_get_option('product_page_price')) {
do_action( 'woocommerce_after_shop_loop_item_title' );
}
?>
See here: http://prntscr.com/9wcfhc
Regards,
Robert Hall.
Hi Robert,
You are my star!
It would be fantastic if you can upload for me. No need upload the code for “ display brand name below the price”.
And can you also adding code in css to change fonts and color for this brand name column so that i can edit anytime?
Just in case if remove this brand name in category page in the future, i just delete the code in content-product.php at child theme, am i correct?
Thank you so much from my heart!
Regards
Keith
Hi Robert,
You are my star!
It would be fantastic if you can upload for me. No need upload the code for “ display brand name below the price”.
And can you also adding code in css to change fonts and color for this brand name column so that i can edit anytime?
Just in case if remove this brand name in category page in the future, i just delete the code in content-product.php at child theme, am i correct?
Thank you so much from my heart!
Regards
Keith
Hello,
I’ve created the Child Theme and added code above. Also added CSS style for brand name.
.custom-product-brands{
margin-bottom:15px;
font-family:Arial;
font-size: 14px;
}
.custom-product-brands a{
color: red;
}
This isn’t a custom field. The brand name comes from product settings->brands. See screenshot: http://prntscr.com/9xk333
Regards,
Robert Hall.
Hi Robert,
Good Morning!
Thanks for your magic hands to save my life!
From our previous conversation, can the brand name swap with Product Title means display Brand Name in fist column & Product Title is in second column. could you mind show me the code that I can paste into chidl CSS if need change in the future?
And Just in case if remove this brand name in category page in the future, i just delete the code in content-product.php at child theme, am i correct?
Thank you again and have a great day!
Hello,
From our previous conversation, can the brand name swap with Product Title means display Brand Name in fist column & Product Title is in second column. could you mind show me the code that I can paste into chidl CSS if need change in the future?
Do you mean to disaply it like on this screenshot? http://prntscr.com/9xy8s9
And Just in case if remove this brand name in category page in the future, i just delete the code in content-product.php at child theme, am i correct?
Yes, you’re correct.
Regards,
Robert Hall.
Hi Robert,
Thank you for your assit with this matter!
Here is the screenshot and it would be great if can use your magic to write the code for me so I can update into Child CCS easily in the future.
First column: Brand Name
Second Column: Product Name
And could you please make smaller gap between brand name and Product name?
Thanks
Keith
I’ve made changes in the Child Theme files. Please check it.
Regards,
Robert Hall.
Heartful thank you for your help and make it for me.
Is that possible to make the gap thinner between Brand Name and Produt title in Desktop mode only?
Thanks
Keith
Adn also, How can change product name fonts as same as Brand name in category page?
Thank you so much!!
Regards
Keith
Many Thanks Robert!!
Thank you for you hardworking and everytime you setup the code for me to save my time and life.
🙂
You can close the case!!!
Thank always
Keith
You’re welcome and have a good day!
Regards,
Robert Hall.
Tagged: best selling, category page, custom field, themes, woocommerce
The issue related to '‘Add Custom field in Category page’' has been successfully resolved, and the topic is now closed for further responses