Is there a way to hook or call a custom woocomerce template that is not part of the default templates of woocommerce?

You could consider using the good ol’ get_template_part( string $slug, string $name = null, array $args = array() function, which is a native WP function. Especially now as it supports the third parameter for passing data to the template file (since WP 5.5). Create a function (in your (child) theme functions.php file) that wraps around … Read more

New field on checkout is shown but it’s not saved on the order details [closed]

As far as I remember you need to manually save your custom fields values via woocommerce_checkout_update_order_meta hook. Try add_action( ‘woocommerce_checkout_update_order_meta’, ‘custom_checkout_fields_update_order_meta’ ); function custom_checkout_fields_update_order_meta( $order_id ) { update_post_meta( $order_id, ‘billing_colonia’, sanitize_text_field( $_POST[‘billing_colonia’] ) ); update_post_meta( $order_id, ‘shipping_colonia’, sanitize_text_field( $_POST[‘shipping_colonia’] ) ); }

Is it possible to update the total price on the checkout page in woocommerce from a custom field

Well, you can use a WooCommerce hook( woocommerce_before_calculate_totals ) I will give an example so that it may be easier to understand what you believe. As far as you know , I think you problem will be fixed function calculate_embossing_fee( $cart_object ) { if( !WC()->session->__isset( “reload_checkout” )) { /* Gift wrap price */ $additionalPrice = … Read more

How can I get all the woocommerce api orders [closed]

By default, that API endpoint is paged and the amount per_page is set to 10. You can see all the defaults for that endpoint here https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-orders If this endpoint works like WP_Query then you’ll need to set the per_page parameter to -1. Otherwise you’ll need to make multiple requests, incrementing the page number each time … Read more

Replace Woocommerce “add to cart” to be “Download” button [closed]

hook into the woocommerce hook is_purchasable add_filter(“woocommerce_is_purchasable”, function($product, $isPurchasable) { if(!$isPurchasable) return $isPurchasable; $productId = $product->get_id(); $user = wp_get_current_user(); if($user->exists() && $productId == 769) { $userId = $user->ID; $userEmail = $user->user_email; if(wc_customer_bought_product($userEmail, $userId, $productId)) { //block the purchase so the user sees read more instead of add to cart $isPurchasable = false; } } return … Read more

Is there a way to get plugins and themes not built for multisite to work on a network subsite?

Most plugins and themes don’t need to do anything special to be multisite compatible. Themes especially. So just because a theme or plugin doesn’t say it’s Multisite compatible doesn’t mean it isn’t. Sometimes plugins don’t behave well if you Network Activate them, but the workaround for that is often just to activate them on individual … Read more