how to create additional button on single product page

To achieve something like this you should change the woocommerce_after_shop_loop_item hook, which is where the add to cart button is added. To replace it with custom behavior, first, you remove the button, then add your custom button in its place. add_action( ‘init’, ‘remove_add_to_cart_button’ ); function remove_add_to_cart_button() { remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 10 ); } add_action( ‘woocommerce_after_shop_loop_item’, … Read more

FacetWP – conditionally display facet labels

Your code seems identical to FacetWP’s. The only variable I can think of is code placement. You might not be placing the code where it belongs (functions.php or a plugin). A quick fix would be adding their code to your theme’s functions.php: function fwp_add_facet_labels() { ?> <script> (function($) { $(document).on(‘facetwp-loaded’, function() { $(‘.facetwp-facet’).each(function() { var … Read more

What is the diferences between pure WordPress theme and Woocommerce theme? [closed]

There are no “WooCommerce themes”, only WordPress themes that eventually offer CSS styling for WooCommerce pages and layout elements, and, maybe, customize them by overwriting the WooCommerce templates. This is a good place to start: https://docs.woocommerce.com/documentation/plugins/woocommerce/woocommerce-codex/theming/ Also, take a look at the “official” WooCommerce theme right from the creators: https://woocommerce.com/storefront/ Apart from these, the internet … Read more

Show add to cart button and quantity field when no price is entered [closed]

Have you looked at the following? https://wordpress.stackexchange.com/a/104783/77202 From the answer above the following will always set the price to default to 0 when creating/updating a product function wpa104760_default_price( $post_id, $post ) { if ( isset( $_POST[‘_regular_price’] ) && trim( $_POST[‘_regular_price’] ) == ” ) { update_post_meta( $post_id, ‘_regular_price’, ‘0’ ); } } add_action( ‘woocommerce_process_product_meta’, ‘wpa104760_default_price’ … Read more

How to query woocommerce product by pricing? [closed]

$args = array( ‘post_type’ => ‘product’, ‘posts_per_page’ => 10, ‘orderby’ => ‘meta_value_num’, ‘meta_key’ => ‘_price’, ‘order’ => ‘asc’ ); $loop = new WP_Query( $args ); echo ‘<form id=”checkme”>’; while ( $loop->have_posts() ) : $loop->the_post(); global $product; echo ‘<div>’; echo ‘ <input type=”radio” name=”products” value=”‘.get_the_title().'” >’; echo ‘<label>’ . woocommerce_get_product_thumbnail().’ ‘.get_the_title().'</label>’; echo ‘</div>’; /* echo ‘<br … Read more

Woocommerce Slow Queries

Yep, three things. A) You have bot or an a**hole webscraper crawling your site and making a ton of bunk checkout caches. You need to invest in a web application firewall like Sucuri or Wordfence (use the paid version, not the free one in either case). If you don’t do this, you are going to … Read more