rabiancone
Forum Replies Created
-
They are unable to provide assistance outside of the existing functionality so I guess we are stuck.
Is there any accounting software that your plugin works with in the manner in which I described?
Share their response about what?
Hi Sanesh,
Thank you for replying. The plugin I use is called WooCommerce Connector by Intuit.
Thanks,
RyanForum: Plugins
In reply to: [Product Pre-Orders for WooCommerce] Change default no date messageHi Angela,
This works wonderfully.
Thank you!
Ryan
Forum: Plugins
In reply to: [Product Pre-Orders for WooCommerce] Change default order statusI figured it out. Here’s the code I used for variable products. Will require additional modification to apply to simple products as well.
/** * Set pre order status when order has any pre order items * * @param string $status Payment status that should be set on payment complete. * @param int $order_id Order ID. * @param WC_Order $order Order object. * * @return string */ function vh_sto_wc_set_pre_order_status_on_payment_complete( $status, $order_id, $order ) { // Make a check that new status is "processing" as we don't want to do anything for virtual orders. // If you have to perform check for virtual orders as well then you can add or check ('processing' === $status || 'completed' === $status). if ( 'processing' === $status && ( 'on-hold' === $order->status || 'pending' === $order->status || 'failed' === $order->status ) ) { // Define has pre order false initially. $has_pre_order = false; // Loop through order items. foreach ( $order->get_items() as $item_id => $item ) { // Get the product object from the order item. $product = $item->get_product(); // Get the product id. $product_id = $product->get_id(); $variation_id = $item->get_variation_id(); // Write your logic to validate if product is a pre order product or not. // then store in $pre_order_checked as true/false. $pre_order_checked = get_post_meta( $variation_id, '_wpro_variable_is_preorder', true ); if ( $pre_order_checked == 'yes' ) { // assuming you perform a true condition test in if statement // then set has pre order to true. $has_pre_order = true; // Break the loop as we got what we want. break; } } if ( $has_pre_order == 'yes' ) { $status = 'preorder'; } else { // Autocomplete the processing order if the pre-order is unidentified. $status = 'completed'; } } return $status; } add_action( 'woocommerce_payment_complete_order_status', 'vh_sto_wc_set_pre_order_status_on_payment_complete', 20, 3 );
Forum: Plugins
In reply to: [Product Pre-Orders for WooCommerce] Custom “in stock” messageHere’s the solution for anybody who is interested:
/** * Change availability text. * * @param array $availability Availability data array. * @param WC_Product $_product WC Product object. * * @return array. */ function wcs_custom_get_availability( $availability, $_product ) { $is_preorder = 'no'; if ( $_product->is_type( 'variation' ) ) { $is_preorder = get_post_meta( $_product->get_id(), '_wpro_variable_is_preorder', true ); } elseif ( $_product->is_type( 'variable' ) ) { $_variations = $_product->get_available_variations(); $_variations_ids = ! empty( $_variations ) ? wp_list_pluck( $_variations, 'variation_id' ) : array(); if ( ! empty( $_variations_ids ) ) { $is_preorders = array_map( function( $id ) { return wc_string_to_bool( get_post_meta( $id, '_wpro_variable_is_preorder', true ) ); }, $_variations_ids ); $is_preorder = in_array( true, $is_preorders, true ) ? 'yes' : 'no'; } } else { $is_preorder = get_post_meta( $_product->get_id(), '_simple_preorder', true ); } if ( wc_string_to_bool( $is_preorder ) ) { $availability['availability'] = __( 'Available for Pre-Order', 'woocommerce' ); } return $availability; } add_action( 'woocommerce_get_availability', 'wcs_custom_get_availability', 20, 2 );
Forum: Plugins
In reply to: [WooCommerce] Randomly sending order completion emailsHi Mirko,
The issue has not happened again since posting here. If it does I will revisit with you.
Thanks for your help.
Ryan
Forum: Plugins
In reply to: [Autoptimize] Plugin conflict RapidloadHi Frank,
I tried to set up a staging site to work on but too many plugins had conflicts due to licenses and other issues that I abandoned the attempt altogether and tried to figure it out myself.
Eventually I ended up deactivating CSS optimization in Autoptimize and updated the Advanced settings in Rapidload to handle CSS optimization. This seemed to eliminate the issues with no adverse affect. Since Autoptimize was no longer handling CSS optimization I also deactivated Critical CSS.
So far, so good. Thanks for checking in.
Ryan
Forum: Plugins
In reply to: [WooCommerce] Randomly sending order completion emailsHi Nathan,
I’d prefer not to post anything in a public forum. Can we move this correspondence to email?
Forum: Plugins
In reply to: [Autoptimize] Plugin conflict RapidloadHi Frank,
I’m back to working directly with the RapidLoad team however nothing is bearing fruit so far as they are unable to work on my staging site and I don’t want them touching my production site.
Nothing is clearing the cache that I’m aware of. It’s fairly random as to which pages break and how many but typically 10-20 out of 250 or so.
One thing I failed to mention previously is the errors seem to occur on pages that use Elementor. I wonder if somehow Elementor’s CSS is conflicting.
Thanks,
RyanAbsolutely!
Thanks again
Frank,
So far it seems to have done the trick! I’ll let you know if anything changes. Thanks so much for your help!
Best,
Ryan