if( tribe_is_event() || is_single(2338) ) { } but it doesn’t seem to look at the ID so, I wasn’t sure if this was even possible?
Thanks!
]]>When testing, I see that this is because of a conflict with the Pre-Orders For WooCommerce plugin: if I disable that plugin, the error message disappears and I can visually see the editor and the results of the changes I’m making in the left side fields of the Kadence Email Designer plugin.
This is the error message from the log and underneath that a cause for the error, based on a reply from a WooCommerce forum member:
Uncaught Error: Call to a member function get_meta() on bool in /home/website199/domains/ourwebsite.com/public_html/wp-content/plugins/pre-orders-for-woocommerce/src/Checkout.php:67 CONTEXT: {“error”:{“type”:1,”file”:”\/home\/website199\/domains\/ourwebsite.com\/public_html\/wp-content\/plugins\/pre-orders-for-woocommerce\/src\/Checkout.php”,”line”:67},”backtrace” “”,”#0 \/home\/website199\/domains\/ourwebsite.com\/public_html\/wp-includes\/class-wp-hook.php(324): Woocommerce_Preorders\Checkout->setPreroderStatus()”,”#1 \/home\/website199\/domains\/ourwebsite.com\/public_html\/wp-includes\/plugin.php(205): WP_Hook->apply_filters()”,”#2 \/home\/website199\/domains\/ourwebsite.com\/public_html\/wp-content\/plugins\/woocommerce\/includes\/class-wc-order.php(323): apply_filters()”,”#3 \/home\/website199\/domains\/ourwebsite.com\/public_html\/wp-content\/plugins\/woocommerce\/includes\/class-wc-order.php(300): WC_Order->maybe_set_date_paid()”,”#4 \/home\/website199\/domains\/ourwebsite.com\/public_html\/wp-content\/plugins\/woocommerce\/includes\/abstracts\/abstract-wc-data.php(801): WC_Order->set_status()”,”#5 \/home\/website199\/domains\/ourwebsite.com\/public_html\/wp-content\/plugins\/kadence-woocommerce-email-designer\/includes\/class-kadence-woomail-p”]}
Cause:
The error message you see, Uncaught Error: Call to a member function get_meta() on bool, indicates that a method (get_meta) is being called on a boolean value instead of an object. This is done in the Checkout.php file of the pre-orders-for-woocommerce plugin.
Based on this error, how can I solve this error, so that both Pre-Order and Kadence Email Customizer plugins work?
]]>Is there a way to check if membership account is expired? I’m looking for conditional statement similar to this:
<?php if (SwpmMemberUtils::is_member_logged_in()) { ?>
Can you assist?
]]>IF(AND(fieldname2 == 'C276', fieldname3 == '.250', fieldname4 == '26,063'), ".035"," ")
I would like to include another IF statement in this equation for when fieldname4 = another value. The singular equation would be:
IF(AND(fieldname2 == 'C276', fieldname3 == '.250', fieldname4 == '38,044'), ".049","”)
This does not work:
IF(AND(fieldname2 == 'C276', fieldname3 == '.250', fieldname4 == '26,063'), ".035","");
IF(AND(fieldname2 == 'C276', fieldname3 == '.250', fieldname4 == '38,044'), ".049","”);
Is there a specific way to write these two statements to have them both work?
Thanks so much!
]]>I am looking to create a custom function for woocommerce. The desired scenario is to be able to empty & skip the checkout cart, to go direct to checkout, only if the product belongs to a specific product category. I have done so using the following add_filters
add_filter('woocommerce_add_to_cart_redirect', 'cus_skip_cart_redirect_checkout', 1000);
add_filter('woocommerce_add_to_cart_validation', 'cus_clear_cart_before_adding');
Initially, this was working fine for all products, using the following functions:
function cus_skip_cart_redirect_checkout($url) {
return wc_get_checkout_url();
}
function cus_clear_cart_before_adding($cart_item_data) {
global $woocommerce;
$woocommerce->cart->empty_cart();
return true;
}
However, the functions broke when I tried to include an if statement to make these functions run only if a product in a specific product category was selected:
function cus_skip_cart_redirect_checkout($url) {
global $product_category;
$id = $product_category->get_id();
if(get_id() == 59) {
global $woocommerce;
$cus_redirect_url_checkout = $woocommerce->cart->wc_get_checkout_url();
return $cus_redirect_url_checkout;
}
}
function cus_clear_cart_before_adding($cart_item_data) {
if(get_the_id() == 59) {
global $woocommerce;
$woocommerce->cart->empty_cart();
return true;
}
}
Please advise on how to improve this if statement in this function. Thank you!
]]>This happens in both the local and live environment. WordPress and all plugins are up to date. I use the latest Firefox browser.
Screenshot of a duplication: https://codebird.ca/duplicate.JPG
This is becoming increasingly frustrating as my forms are fairly long and editing fields is pretty tedious, I’m having to go back and fix conditionals almost every time I make any kind of edit.
]]>Is there a method that lets me take the page ID’s under the ‘if’ statement and put them somewhere else to manage and then refer to by a shorter name in a template. So then I can reuse a simpler word, such as I put into the 2nd code section below as ‘group 1’.
<?php
if ( is_page([1172,1170,1269,1271,1273])) {
the_field(‘exotic’, ‘option’);
?>
<?php
if ( is_page([group 1])) {
the_field(‘exotic’, ‘option’);
?>
The reason is this same set of page ID’s will be repeated throughout in my template file to do different stuff, display custom fields mostly. And the list of page ID’s is going to be much larger.
thanks!
]]>Hello everyone,
I’m at the final stage of my website, but I need to add a fee if a Backorder product is selected. I already have some products showing up as Backorder already for testing purposes.
If the product is added as a Backorder, I would like to add a fee to the total.
So when the user goes to View Cart, it’ll show an extra fee for backorder, and on the checkout page it’ll show the summary with the Backorder Fee and total.
I attached a screenshot Mockup I did in Photoshop to show you what I mean.
Thank you for anyones help on this. I’m literally stuck.
Warm regards,
Mike