Wondering if anyone knows the correct function hook to move the description on brand pages created with the official Brands Plugin.
http://www.woothemes.com/products/brands/
The function below works perfectly on product archive pages, but has no effect on brand archive pages.
//Move Product Category Description to Genesis after header
remove_action( 'woocommerce_archive_description', 'woocommerce_taxonomy_archive_description', 10 );
add_action( 'genesis_after_header', 'woocommerce_taxonomy_archive_description', 100 );
I've searched for hours but can't find the correct actions.
Guidance would be much appreciated.
Try this
add_action( 'woocommerce_before_main_content', 'woocommerce_taxonomy_archive_description', 1, 5 );
Related
I'm trying to move the title of my products on top (on top of the image) but i'm not sure how to do it... I want the title to be uptop on the product page not the archive page.
I've spent a long time researching about how to do it but nothing seems to work...
Is there a hook to move it ? Maybe change the layout on the product_page.php ?
For better understanding the product template see the default content-single-product.php - https://gist.github.com/dompascal/7825580 and use this visual map - https://www.businessbloomer.com/woocommerce-visual-hook-guide-single-product-page/
In your functions.php file in your active theme add the following:
Solution #1
//First remove default title
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
//Second add your title in thumbnail section - Keep in mind that title will be below the image bcs of the way this hook works
add_action( 'woocommerce_product_thumbnails', 'woocommerce_template_single_title', 5 );
Solution #2
Another way is to place title above all (depends on your design)
//First remove default title
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
//Second add title
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_template_single_title', 5 );
Solution #3
Override woocommerce templates in your theme. There is alot of examples but this is a good starting point - https://woocommerce.com/document/template-structure/
This solution will provide the best output of your template BUT will require more maintance in future.
If you use theme that override those templates or hooks then you need to work with the theme hooks. But this is specific per theme.
First solution didnt worked but it might be related to my theme.
Second solution worked like a charm even tho i changed the hook :)
To answer my question : How to move the title on top of the product :
//First remove default title
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 );
//Second add title
add_action( 'woocommerce_before_single_product', 'woocommerce_template_single_title', 5 );
Disable add to cart option When I purchased product.
I'm using "Martfury - WooCommerce Marketplace WordPress Theme".
This problem is only for variable product. simple product is fine.
Please check this link below and find attachment. please help anyone..
https://daisysell.com/product/2021-new-fashion-lady-oversize-rimless-square-bee-sunglasses/
These hook will help you out
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
add this in functions.php
for more details refer
https://quadlayers.com/remove-add-to-cart-button-in-woocommerce/
Good morning. I need to move the prices contained in the cards above the titles in the main shop pages and consequently the category too. I mean not the single page where you see the product itself, but the /shop page where all the products are listed. i don't really know the hook to use and priority to set. Thank you for your help.
It depends on your theme, but if everything is by default, this is the code you need:
add_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
Code goes in functions.php file of your active theme/child theme. Tested and works.
Good evening.
Please help me!
I have a website and moved from cards products form the number of and variations in the category. I did it using code, which is placed in the theme file functions.php:
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10);
add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_add_to_cart', 10);
However, when I select 2 or more number of same product and click "add to cart", the number of the selected product appears in all forms of other products.
Here is screenshot and a link to my test site:
screenshot
http://xarod.tk/shop/
I also put code:
<div class="abe"><?woocommerce_template_single_add_to_cart(); ?></div>
in the file woocommerce/templates/content-product.php, but got the same thing.
What needs to be done is that the featured image would only appear in the catalog view, but not in a single product view. So basically if an image is set as a featured image it should not be shown as the main image in product page and in should be excluded from thumbnails as well.
I have been looking ofr solution for a long time and tried different many approaches but nothing seems to help:
I have been adding the following to the functions.php:
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_thumbnails', 20 );
as well as all of the solutions in here: Remove featured image from showing on product display page
Theme is Mr. Tailor
Any help or suggestion is much appreciated.
I was searching for this solution like you, and found that your code is almost functioning. Only had to change the number on the second line from 20 to 3, and it's working.
So the code is:
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_images', 20 );
add_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_thumbnails', 3 );
This will remove featured image in the product page and replaces it with the first thumbnail.