Home › Forums › Basel support forum › Adding SKU under product description and grid view
Adding SKU under product description and grid view
- This topic has 7 replies, 2 voices, and was last updated 7 years, 8 months ago by
Eric Watson.
-
AuthorPosts
-
August 19, 2017 at 11:36 pm #17834
AllawiTParticipantHi there!
#1 I’m trying to add the sku code underneath the item title and short description in the whole shop. I have found this code, but it is adding it at the wrong spot. I would like it right underneath the product description in list view. How can I do this?
#2 Also one more question is that I would like to add the products short description underneath the product title in grid view as well the the SKU code.
#3 last question is that I would like to stop the hover underneath the product title to display the options of add to cart, but rather always have it there. How can I do this?function vise_varenummer_katalogsiden() {
global $product;
if ( $product->get_sku() ) {
echo ‘<div class=”product-meta”>Varenummer: ‘ . $product->get_sku() . ‘</div>’;
}
}
add_action( ‘woocommerce_after_shop_loop_item_title’, ‘vise_varenummer_katalogsiden’, 9 );Attachments:
You must be logged in to view attached files.August 20, 2017 at 12:53 pm #17846
Eric WatsonParticipant1-2) Sorry, but your request is related to additional code customization of the theme. But we can’t help you since it is out of theme support scope according to Envato Policy https://themeforest.net/page/item_support_policy
3) You can select another type of hover in the Dashboard -> Theme Settings -> Shop -> Hover on product
Kind Regards
XTemos StudioAugust 20, 2017 at 2:54 pm #17849
AllawiTParticipantHi thank you for your replay! I really appreciate it, and so far you guys have been angles when it comes to answering questions. This is my last question and it will make me a really happy customer if you can just point me in the right direction, at least? a link or an article.
I have manged to customize the whole website to exactly what I want, thanks to you guys! So thanks a million.
Again if you can please can point of the right direction, if not I totally understand.August 21, 2017 at 6:05 am #17867
Eric WatsonParticipantHello,
Try to add the following code snippet to the functions.php file in the child theme.
function vise_varenummer_katalogsiden() { global $product; if ( $product->get_sku() ) { echo '<div class="product-meta">Varenummer: ' . $product->get_sku() . '</div>'; echo '<div class="grid-desc">'; woocommerce_template_single_excerpt(); echo '</div>'; } } add_action( 'woocommerce_shop_loop_item_title', 'vise_varenummer_katalogsiden', 20 );
Try to add the following code snippet to the Custom CSS area in Theme Settings.
.product-list-item .grid-desc{ display: none; } .product-list-info{ display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-box-pack: start; -webkit-justify-content: flex-start; -ms-flex-pack: start; justify-content: flex-start; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; } .product-list-info .product-meta{ -webkit-box-ordinal-group: 2; -webkit-order: 1; -ms-flex-order: 1; order: 1; }
Kind Regards
XTemos StudioAugust 21, 2017 at 1:06 pm #17890
AllawiTParticipantThank you so much! That works perfectly, the only thing is that in grid view the SKU comes before the short description. Can I swap the order of them?
August 21, 2017 at 2:03 pm #17892
Eric WatsonParticipantTry to add the following code snippet to the Custom CSS area in Theme Settings.
.product-grid-item{ display: -webkit-box; display: -webkit-flex; display: -ms-flexbox; display: flex; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; -ms-flex-direction: column; flex-direction: column; -webkit-box-pack: start; -webkit-justify-content: flex-start; -ms-flex-pack: start; justify-content: flex-start; } .product-grid-item .product-meta{ -webkit-box-ordinal-group: 2; -webkit-order: 1; -ms-flex-order: 1; order: 1; } .product-grid-item .btn-add{ -webkit-box-ordinal-group: 3; -webkit-order: 2; -ms-flex-order: 2; order: 2; }
Kind Regards
XTemos StudioAugust 22, 2017 at 2:30 pm #17923
AllawiTParticipantThank you very much!
August 22, 2017 at 2:31 pm #17924
Eric WatsonParticipantYou are welcome, we are always happy to help you, write us when you have any difficulties or issues with our theme.
And we would be glad if you will rate our theme with 5 stars on Theme Forest in case you are satisfied with our theme and customer service http://themeforest.net/downloads
Thank you in advance 🙂
-
AuthorPosts
- You must be logged in to create new topics. Login / Register