robinjoshua
Forum Replies Created
-
That’s the least I could do. ??
It works, thank you Yordan!
One additional question. Do you also know how to add a sort functionality? So that I can sort the orders from latest invoice dates to older ones?
You are the man! Thank you.
Forum: Plugins
In reply to: [WooCommerce] Echo product name WooCommerceWhoops. The code is here:
<?php
// a function to check if the cart has product from organge and it’s sub category id
function cart_has_product_with_orange_cats() {
//Check to see if user has product in cart
global $woocommerce;//assigns a default negative value
$product_in_cart = false;// start of the loop that fetches the cart items
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {$_product = $values[‘data’];
$terms = get_the_terms( $_product->id, ‘product_cat’ );// second level loop search, in case some items have several categories
if($terms){
foreach ($terms as $term) {
$_categoryid = $term->term_id;
if (( $_categoryid === 40 )) {
//category is in cart!
$product_in_cart = true;
}
}
}
}return $product_in_cart;
}add_action( ‘woocommerce_before_checkout_form’ , ‘orange_product_notices’ );
add_action(‘woocommerce_before_cart_table’,’orange_product_notices’);function orange_product_notices() {
global $woocommerce;
if(cart_has_product_with_orange_cats()){
wc_print_notice( “There is a product in your shoppingcart that can’t be delivered.
The product that can’t be delivered is:
“, $notice_type = ‘notice’ );}
}
?>Forum: Plugins
In reply to: [WooCommerce] WooCommerce shipping methods filterForum: Plugins
In reply to: [WooCommerce] WooCommerce shipping methods filter@khusbu padalia
I’ve found something with package rates filter (see below), however that did not work. When i add this in my functions.php the site crashes, and i don’t know why. I’ve checked with a code checker and there were no errors in the php code itself.
What i want is:
I have two shipping methods:
1. flat_rate
2. Local_pickupSome products are too heavy and therefore can only be picked up.
Thanks for the help
add_filter( ‘woocommerce_package_rates’, ‘custom_shipping_methods’ , 10, 2 );
function custom_shipping_methods( $rates, $package ){
if ( cart_has_product_with_orange_cats() ) {
foreach($rates as $key => $method){
if( $key == ‘local_delivery’ || $key == ‘local_pickup’){
continue;
}
unset($rates[$key]);
}
// remove the rate you want
}
// return the available methods without the one you unset.
return $rates;
}?Forum: Fixing WordPress
In reply to: WooCommerce shipping methods filterO I’m sorry! I will try there.
Thanks
Forum: Fixing WordPress
In reply to: Echo product name WooCommerceSo in the notice i want:
There is a product in your shoppingcart that can’t be delivered. The product that can’t be delivered is:
Title of product 1 (which cant be send)
Title of product 2 (which cant be send)
etc.Thanks!
Forum: Plugins
In reply to: [WooCommerce] Order-received page displays 'empty cart'I’ve tried two different plugins from mollie but they both are not working. I’ve sent then an email but they have not responded yet.
Forum: Plugins
In reply to: [WooCommerce] Order-received page displays 'empty cart'I am using the same payment gateway, that’s why I need the solution.
Forum: Plugins
In reply to: [WooCommerce] Order-received page displays 'empty cart'Alexander please share your solution, I am facing the same problem.
Forum: Plugins
In reply to: [WooCommerce] Blank checkout page instead of order received pageYou can download it here for free:
https://www.ads-software.com/plugins/mollie-payments-for-woocommerce/Forum: Plugins
In reply to: [WooCommerce] Blank checkout page instead of order received pageSo what am I supposed to do?
ThanksForum: Plugins
In reply to: [WooCommerce] Blank checkout page instead of order received pageI am using a woocommerce plugin from mollie. (Mollie.com)