WooCommerce apply shipping rates based on price
Try this plugin Advanced Flat Rate Shipping Method WooCommerce. Hope this helps.
Try this plugin Advanced Flat Rate Shipping Method WooCommerce. Hope this helps.
add_filter(‘body_class’, ‘SE_314220_custom_outofstock_class’); function SE_314220_custom_outofstock_class ($classes) { global $post; if($post->post_type !=”product”) return $classes; $product = wc_get_product( $post->ID ); if($product->get_stock_quantity() ==0) $classes[] = ‘OUT-OF-STOCK’; return $classes; }
Use this: function your_function() { if ( is_front_page() ) { $output = … } else{ $output = … } return $output; } p.s. It’s not needed to use is_home(). Whoever needs the technical details, see is_front_page and is_home
You can use product attributes. You can configure them in the back-end, and then add something like this to your template: <?php $sizes = $product->get_attribute( ‘size’ ); $sizes = explode(“, “,$sizes); ?> <?php if($sizes[0]!=”){ // if product sizes are available ?> <span class=”product-size-label”>Choose your size:</span> <select class=”product-size”> <?php foreach($sizes as $size){ ?> <option><?php echo $size; … Read more
You already have the right “action”, which is woocommerce_after_cart_contents. But when I tried the markup you used: function quality_certificates(){ echo ‘<tr>TEST</tr>’; } this was the visual output: (I actually initially tested with the Twenty Seventeen theme; sorry about that. But this one is tested with Storefront) Then I started thinking that the problem might be … Read more
WooCommerce Email template already has access to $order variable. You simply need to add it to shortcode atts, like this do_shortcode(‘[sample_test name=”additional_gift_msg” order_id=’ . $order->get_id() . ‘]’); Then in the shortcode callback: function th_email_shortcode_handler( $atts ) { // get the $order_id $order_id = $atts[‘order_id’]; // create the order object if needed $order = new WC_Order( … Read more
If you are interested in a way to avoid the uncertainty (as Google will most likely never document what they’ll do in such a case, and it could change anytime, or depend on additional signals etc.): Give both Product items the same URI as ID. This conveys to consumers that both of the Product items … Read more
Anyone who knows the absolute path of a file can find it. There are several possibilities, two simple ideas to set up: Generate a random name for each file Generate a temporary link for each download In both cases, I guess a plugin already exists.
Create/copy an override template file in your-theme/woocommerce/order/order-details-thankyou.php In functions.php add this block of code: function woocommerce_order_details_table_thankyou( $order_id ) { if ( ! $order_id ) { return; } wc_get_template( ‘order/order-details-thankyou.php’, array( ‘order_id’ => $order_id, ) ); } remove_action( ‘woocommerce_thankyou’, ‘woocommerce_order_details_table’, 10 ); add_action( ‘woocommerce_thankyou’, ‘woocommerce_order_details_table_thankyou’, 10 ); This is perfectly fine way to unhook the default … Read more
You can use either get_variation_prices( $for_display = false ) method or get_variation_regular_price( $min_or_max = ‘min’, $for_display = false ) Something like this: global $product; var_dump( $product->get_variation_prices() ); https://github.com/woocommerce/woocommerce/blob/master/includes/class-wc-product-variable.php#L97 /** * Get the min or max variation regular price. * * @param string $min_or_max Min or max price. * @param boolean $for_display If true, prices will … Read more