Product categories don’t appear as option to build menu
On the Menus page, click the Screen Options tab at top right. Then tick the boxes for products and product categories. That will make them available to be added to your menus.
On the Menus page, click the Screen Options tab at top right. Then tick the boxes for products and product categories. That will make them available to be added to your menus.
You can create a product object using the following function: $product = wc_get_product( $post_id ); And after that you will be able to access to all product’s data. All available methods can be found here, but the ones you need are: $product->get_regular_price(); $product->get_sale_price(); $product->get_price();
You need to create a new loop for that. Here’s the code I use for displaying products from a specific category on the home page: <ul class=”products”> <?php $args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 1, ‘product_cat’ => ‘shoes’, ‘orderby’ => ‘rand’ ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : … Read more
Core and plugin files should never be edited directly, as any updates could overwrite your changes. If you look in WooCommerce source at the get_price_html method, there are a number of filters available to modify the output of the function. See add_filter in Codex for more info on adding filters to apply_filters calls. From get_price_html … Read more
The code you have provided is incomplete. Not sure if that is the only code you are using to achieve what you want. So, besides first code block which you have provided, bellow I am adding all rest of the code which is required to show the new field on backend in ‘Order Details’ box … Read more
If you look at woocommerce/templates/content-single-product.php you’ll see that the product summary is constructed using hooks with different priorities. Here’s the relevant section: <?php /** * woocommerce_single_product_summary hook * * @hooked woocommerce_template_single_title – 5 * @hooked woocommerce_template_single_rating – 10 * @hooked woocommerce_template_single_price – 10 * @hooked woocommerce_template_single_excerpt – 20 * @hooked woocommerce_template_single_add_to_cart – 30 * @hooked … Read more
luckily woocommerce has many hooks, this removes prices and buttons: remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’ ); remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 ); remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 ); remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 ); you can dig into content-product.php and content-single-product.php if you need to remove more stuff. I can imagine there’s more than just the prices/buttons you want to … Read more
You can get the WooCommerce my-account URL as below <a href=”https://wordpress.stackexchange.com/questions/213612/<?php echo get_permalink( get_option(“woocommerce_myaccount_page_id’) ); ?>” title=”<?php _e(‘My Account’,”); ?>”><?php _e(‘My Account’,”); ?></a> Now you can insert this in completed order mail template too. <h2> <a href=”https://wordpress.stackexchange.com/questions/213612/<?php echo get_permalink( get_option(“woocommerce_myaccount_page_id’) ); ?>” title=”<?php _e(‘My Account’,”); ?>”>Go to your account page for review</a> </h2> <a href=”http://animax.cf/product/happy-ninja/#reviews”> … Read more
On a hunt for the same I took a little dive into the JS source files. Woocommerce Javascript events Woocommerce Checkout JS events $( document.body ).trigger( ‘init_checkout’ ); $( document.body ).trigger( ‘payment_method_selected’ ); $( document.body ).trigger( ‘update_checkout’ ); $( document.body ).trigger( ‘updated_checkout’ ); $( document.body ).trigger( ‘checkout_error’ ); $( document.body ).trigger( ‘applied_coupon_in_checkout’ ); $( document.body … Read more
Deleting images using plugin: You can use this plugin, it will search your database and look if image is inserted into any post (in content, as featured image, in any custom field, anywhere…) or as background… If image is not used anywhere it will give you option to delete it. You will get list of … Read more