I have a small problem: I would like to know if I can remove the summary on the order summary page, from Woocommerce to save space?
Thank you very much.
Jonathan.
Try placing below woocommerce hook in functions.php file of your theme.
remove_action( 'woocommerce_checkout_order_review', 'woocommerce_order_review', 10 );
Related
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.
I'm using the shortcode
[product_category category="jacuzzis" columns="3"]
to show some amazon affiliate products on my website. The issue is that I don't want the user going to the product page under my domain but instead going to the amazon affiliate link.
In order to do that I'm trying first eliminating the link on the products. I'm using this code
remove_action( 'woocommerce_before_shop_loop_item', 'woocommerce_template_loop_product_link_open', 10 );
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_product_link_close', 10 );
It should remove the open link tag and the close link tag, but the link is still working after adding the snippet.
Does anyone know why?
You could use woocommerce_after_add_to_cart_quantity hook to add your custom button with ACF field. and just remove 'buy' button with CSS or another hook.
I'm using an already purchased wordpress theme. The rating tab is located under "woocommerce_output_product_data_tabs". I already know how to unset it from the output tabs but I don't know how to add it in "woocommerce_after_single_product_summary". Did you do something similar to this?
Firstly, create a Child Theme so that your modifications do not get overridden when any Theme Updates are released.
Head into your functions.php, in your Parent Theme, and locate the function entry for your Ratings Tab. Copy this coding into the functions.php file, within your Child Theme.
Within the add_action entry, you will need to change the code as follows:
add_action('woocommerce_after_single_product_summary', 'THIS_NEEDS_TO_BE_THE_SAME_AS_THE_FUNCTION_NAME');
Hope this helps.
Try This
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10, 2 );
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_rating', 10 );
function woocommerce_template_single_rating( $woocommerce_template_single_title, $int ) {
// make action magic happen here...
};
I would like to modify the products sorting on the shop page to product categories filter where the user can select the browse the products of categories from there.
I am a rookie in programming. I checked the WooCommerce directory to find the .php file I should work on. I got some clue it is in archive-product.php but I don't see the code which display the sorting dropdown.
Can anyone give me some clue to achieve this ? Or is there any workaround ? Thanks.
I added this in functions.php :
// remove default sorting dropdown
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
// now add the new dropdown
add_action( 'woocommerce_before_shop_loop', 'add_product_category_dropdown' );
function add_product_category_dropdown(){
print '<span class="woocommerce-ordering">'; // So it takes the same position as the default dropdown
the_widget( 'WC_Widget_Product_Categories', 'dropdown=1' );
print '</span>';
}
The reason you wouldn't see the code is that majority of what is generated by Woocommerce is handled by actions and hooks. In easier terms this means Woocommerce creates functions that spits out content and assigns them to different areas of the website.(For more information on Woocommerce actions and hooks, read here - https://docs.woothemes.com/document/introduction-to-hooks-actions-and-filters/ )
I'd recommend using the plugin below. It does exactly what you seem to be asking for and you can avoid having to play in parts you might not be comfortable with yet.
https://wordpress.org/plugins/yith-woocommerce-ajax-navigation/
Most awesome thing is that it's not one of those plugins that force you to get premium to actually get the desired effect.
I just found the solution few days ago. I use the function of WooCommerce product categories widget on the shop page.
This line of code will output the dropdown of product categories:
<?php the_widget( 'WC_Widget_Product_Categories', 'dropdown=1' ); ?>
I've hunted everywhere to figure out how to move the Product Short Description from the right side of the picture on a Single Product page of Woocommerce into the tabs. I just can't find it anywhere!
Can someone please help me accomplish that.
Just remove the woocommerce_template_single_excerpt callback from the woocommerce_single_product_summary action:
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_excerpt', 20 );
...and add it directly to a custom tabs.php template:
woocommerce_template_single_excerpt();
Read more about overriding templates in the docs.