dunkoh
Forum Replies Created
-
Forum: Plugins
In reply to: [Age Gate] error in order sidebar meta box with HPOS enabledI was thinking the same thing – probably doesn’t need to be there. Thanks!
Forum: Plugins
In reply to: [Age Gate] error in order sidebar meta box with HPOS enabledActually I’m still seeing this in the error log.
Forum: Plugins
In reply to: [Age Gate] error in order sidebar meta box with HPOS enabledI’m no longer getting this error – it is likely that another action or filter was clobbering the object before it got to your code. This is no longer an issue at this time.
Ok so I got more info, there was not a redirect – but what was happening when they click our action button on the order list in admin, it loads a URL from our site to create and download a PDF but to the user it appears to stay on the order list.
What was happening was that new URL path came up white screen with only the box or button at the top asking for a review, and it didn’t get to our code to download the pdf. So the prompt for a review code was hooking in somehow.
Still now sure how it just fixed itself.
Also seeing this in error logs
PHP Fatal error: Uncaught Error: Call to a member function get_status() on string in /wp-content/plugins/activecampaign-for-woocommerce/includes/orders/class-activecampaign-for-woocommerce-new-order-sync-job.php:203\n
Stack trace:\n#0 /wp-includes/class-wp-hook.php(308): Activecampaign_For_Woocommerce_New_Order_Sync_Job->execute()\n
#1 /wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(”, Array)\n
#2 /wp-includes/plugin.php(565): WP_Hook->do_action(Array)\n
#3 /wp-cron.php(188): do_action_ref_array(‘activecampaign_…’, Array)\n
#4 {main}\n thrown in /wp-content/plugins/activecampaign-for-woocommerce/includes/orders/class-activecampaign-for-woocommerce-new-order-sync-job.php on line 203,
referer: /wp-cron.php?doing_wp_cron=xxxxxxxx
Forum: Plugins
In reply to: [WooCommerce] Analytics svgs have no max widthwe are having the issue as well. Running WC version 7.1.0
You might want to scrub that user email in your content above.
We are having similar issues as you, after initial plugin install, some things were not right, webhooks missing, etc. So removed plugin at suggestion of AC support and set all back up again, and now can’t get through a small percentage of historical sync until it gets stuck because of errors.
Forum: Plugins
In reply to: [WooCommerce] In Cart, hide “Shipping to …” when local pickup selected@heathervh since you are adding the code in functions.php you need to remove the word “public” before any function names. Essentially search for any use of the word “public” in my code snippet and remove just that word.
Forum: Plugins
In reply to: [WooCommerce] In Cart, hide “Shipping to …” when local pickup selectedyou’ll want to add the echo’s right after this line where the value of $chosen_shipping is set
function remove_shipping_to_cart_local() { // part 1: check on page load and hide if local pickup $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0];
Forum: Plugins
In reply to: [WooCommerce] In Cart, hide “Shipping to …” when local pickup selectedyou could echo it to screen
echo '<pre>'; echo print_r($chosen_shipping, true); echo '</pre>';
Forum: Plugins
In reply to: [WooCommerce] In Cart, hide “Shipping to …” when local pickup selectedso in your case using the Code Snippets plugin, after the function, you would call the action like this:
add_action( 'woocommerce_after_cart', 'remove_shipping_to_cart_local' );
If you wanted to see the value of the $chosen_shipping variable, you could do this after it – and then check it in the error log:
error_log(print_r($chosen_shipping,true));
the value of that on cart page load is what you’d probably want to use in this line instead of ‘local_pickup’ as long as it is related to the local pickup plugin you’re using.
if ( 0 === strpos( $chosen_shipping, 'local_pickup' ) ) {
Forum: Plugins
In reply to: [WooCommerce] In Cart, hide “Shipping to …” when local pickup selected@richterworks the difference here is that you are using a product that is pickup only I think, instead of where my usage is based on the user’s location triggering the pickup only. What determines the “Party Boards are for in-store pickup only. Please choose your pickup time at checkout.” notice to show? maybe you can get a value from whatever does that and trigger the jQuery changes then?
Also – are you hooking onto the action in either your functions.php or in a custom plugin?
I am using a custom plugin so I have this:
$this->loader->add_action( 'woocommerce_after_cart', $public_class, 'remove_shipping_to_cart_local' );
if you are putting the code into functions.php you’ll have to call it something like this:
add_action( 'woocommerce_after_cart', 'remove_shipping_to_cart_local' );
If you have the code running on cart load, what is the value of $chosen_shipping after it gets defined in these two lines?
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]
Forum: Plugins
In reply to: [WooCommerce] In Cart, hide “Shipping to …” when local pickup selecteddang it! those $ instead of jQuery trip me up every time because I copy stuff over from another project that uses $
Now I need to go check my custom plugin to see if it’s working right on page load!
Glad you got it going. I have a similar function that does this same thing but unchecked the “ship to other address” checkbox if local pickup is the only option available.
Forum: Plugins
In reply to: [WooCommerce] In Cart, hide “Shipping to …” when local pickup selected@pablopaul depending on what you’re using for local pickup, I recommend on dev or local dev, debugging to see what is coming through in this code by writing output to error log or something. You’ll have to them modify that if statement to account for your local pickup
$chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]; if ( 0 === strpos( $chosen_shipping, 'local_pickup' ) ) {
That is the code that runs on initial cart page load.
- This reply was modified 4 years, 2 months ago by dunkoh.
Forum: Plugins
In reply to: [WooCommerce] In Cart, hide “Shipping to …” when local pickup selectedHere’s something I implemented this morning – you’ll need to inspect your html in the cart if you’re using a different local pickup plugin than we are to see what it is called in the cart session or input name
I’m hooking onto the woocommerce_after_cart action
/** * Hide the "shipping to city, state zip" on cart if local pickup */ public function remove_shipping_to_cart_local() { // part 1: check on page load and hide if local pickup $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]; if ( 0 === strpos( $chosen_shipping, 'local_pickup' ) ) { ?> <script type="text/javascript"> $(document).ready(function () { jQuery('p.woocommerce-shipping-destination').css("display", "none"); }); </script> <?php } ?> <script type="text/javascript"> jQuery('form.woocommerce-cart-form').on('change', 'input[name^="shipping_method"]', function () { var val = jQuery('input[name^="shipping_method"]:checked').val(); // If it changed, then it must be the radio options so check the one that's selected if (typeof val !== 'undefined' && typeof val.match !== 'undefined') { if (val.match("^local_pickup")) { jQuery('p.woocommerce-shipping-destination').css("display", "none"); } } }); jQuery(document).ajaxComplete(function () { if (jQuery('input[name^="shipping_method"]').attr('type') === 'hidden') { // There's only one option so check the hidden input field with the value var val = jQuery('input[name^="shipping_method"]').val(); } else { // Otherwise, it must be the radio options so check the one that's selected var val = jQuery('input[name^="shipping_method"]:checked').val(); } if (typeof val !== 'undefined' && typeof val.match !== 'undefined') { if (val.match("^local_pickup")) { jQuery('p.woocommerce-shipping-destination').css("display", "none"); } } }); </script> <?php }