Add Additional “Checkout” button next to “Add to cart” button in woocommerce product page

You dont need to modify your template files for this, instead you can use the WooCommerce hook woocommerce_after_add_to_cart_button. This hook will add content after the “Add to cart” button. If the customer clicks on this button, the product should get added to the cart, and the customer should be send to the checkout page, right?! … Read more

WooCommerce Template overriding not working with woocommerce.php

It’s a custom theme, so first of all you should check if WooCommerce support is declared in the functions.php. WooCommerce can be integrated with the theme by using woocommerce_content() (woocommerce.php file) or by template overrides, but in both cases the declaration of support in the theme is required. function wpse319485_add_woocommerce_support() { add_theme_support( ‘woocommerce’ ); } … Read more

WooCommerce add_to_cart() with custom price [closed]

Currently there is no straight way to add custom price to product which is added through function $woocommerce->cart->add_to_cart (Documentation) but we have a bypass way that i explain in code below global $woocommerce; $custom_price = 1000; // Cart item data to send & save in order $cart_item_data = array(‘custom_price’ => $custom_price); // woocommerce function to … Read more

WooCommerce – Show orders for a specific product ? [closed]

Eric based on your code I wrote to meet my needs, for those who want to follow: Eric com base em seu código eu escrevi o para atender as minhas necessidades, para quem quiser segue abaixo: <?php global $wpdb; $produto_id = 22777; // ID do produto $consulta = “SELECT order_id FROM {$wpdb->prefix}woocommerce_order_itemmeta woim LEFT JOIN … Read more