daymobrew
Forum Replies Created
-
I definitely second the “use a plugin” suggestion.
I wrote about creating a CF7DTX shortcode back in 2019 (it’s really just a regular shortcode). https://www.damiencarbery.com/2019/11/shortcode-for-contact-form-7-dynamic-text-extension/
Forum: Plugins
In reply to: [CMB2] file_list data not stored when WooCommerce HPOS activeI have changed the
new_cmb2_box()
code:$woo_hpos_active = get_option( 'woocommerce_custom_orders_table_enabled' ); $object_types = ( 'yes' == $woo_hpos_active ) ? array( 'woocommerce_page_wc-orders' ) : array( 'shop_order' ); $cmb = new_cmb2_box( array( ... 'object_types' => $object_types, ... );
- This reply was modified 1 year, 6 months ago by daymobrew.
Forum: Plugins
In reply to: [CMB2] file_list data not stored when WooCommerce HPOS activeI think I’ve figured out the issue:
If object_types is
shop_order
andwoocommerce_page_wc-orders
then it will not work.'object_types' ?=> array( 'shop_order', 'woocommerce_page_wc-orders' ),
If it is only
woocommerce_page_wc-orders
then it works fine.'object_types' ?=> array( 'woocommerce_page_wc-orders' ),
Maybe I can check whether HPOS is active and set the object_types list appropriately.
Forum: Plugins
In reply to: [CMB2] file_list data not stored when WooCommerce HPOS activeIt’s also strange that when debugging in VSC I added breakpoints at the top of CMB2_Woo_Orders_Hookup::hooks(), get_order_meta(), update_order_meta() and save_order_meta_changes(). These work on my ‘other‘ code but not on the attach-order-files-to-wc-order-email.php code (VSC marks them as Unverified Breakpoints!).
I even modified the latter code to change from a PHP class to straight functional code (like the working file) but no joy.
Forum: Plugins
In reply to: [CMB2] file_list data not stored when WooCommerce HPOS activeI noticed that when I put the
file_list
field in another meta box (one from the other support thread [though it is not in the linked file]) that it works. I’ll keep looking into this strangeness.Forum: Plugins
In reply to: [Custom Order Statuses for WooCommerce] Is this plugin still in development?I think that the developer is gone, even the website listed on the profile page is dead and the developer has not been active on www.remarpro.com in at least a year.
That said, the plugin still works for me on Woo 8.0.3 and WordPress 6.3.1.
First, the message is a ‘notice’ so not an error or even a warning. That said, the fix is trivial.
In custom-order-statuses-for-woocommerce/ajax/deactivation-form.php around line 30 change
$order->id
to$order->get_id()
:array_push( $found_orders, $order->id )
to
array_push( $found_orders, $order->get_id() );
I am using it with WC 8.0.3 and WP 6.3.1 and it is working for me.
There is a small warning from WooCommerce but it’s trivial. (it has $order->id instead of $order->get_id() – I’m submitting a patch for that).
That did it. I got a fresh copy from
develop
branch and the data is now loading and being stored inwp_wc_orders_meta
table.View post on imgur.com
Thank you.
Should I mark this as resolved or wait until the branch is merged to main?
So as not to override cmb2 2.10.1 I put the
develop
branch version inwp-content/plugins/CMB2-develop
directory.My cmb2 code has not changes – still https://pastebin.com/PDFBNgaQ
I downloaded the zip from github.
develop
branch has version number 2.10.0.For hpos add-on I downloaded the zip from github and activated that as a plugin. I’ve been trying to debug in VSC but my breakpoints are ‘unverified’ and ignored so I just began adding error_log() calls to verify the code is being run. The
CMB2_Woo_HPOS_Orders::_construct
function. I then added error_log() to init_hooks but that did not run. I could find thedo_action( 'cmb2_init_hooks' )
call anywhere in CMB2 2.10.1 or CMB2 develop. Similar issue for the add_filter() calls tocmb2_set_box_object_type
andcmb2_set_box_object_type
– cannot find the matching apply_filters() calls.- This reply was modified 1 year, 7 months ago by daymobrew. Reason: Add info about add_filter
Justin – thank you for all that work.
I have replaced CMB2 with CMB2-develop and added cmb2-woocommerce-hpos-orders plugin.
The meta box shows and the CSS is enqueued.
The submitted values do not show when I Update the order. Nor is the data written to the
wp_wc_orders_meta
db table.I am happy to debug here – just let me know what areas I should look at.
- This reply was modified 1 year, 7 months ago by daymobrew. Reason: Mention that values not in db
Code: https://pastebin.com/PDFBNgaQ
To set up HPOS in WooCommerce: https://woocommerce.com/document/high-performance-order-storage/#section-2
Essentially: WooCommerce/Settings/Advanced/Features then click ‘High performance order storage (new)’. I also uncheck ‘Keep the posts and orders tables in sync (compatibility mode).’
I can see that ‘
cmb2_override_meta_value
‘ is not being run because inCMB2_Field::__construct()
$args[‘object_id’] is zero so $this->object_id is zero and$this->get_data()
does not get called.If my field group has object_type=page then object_id will be the page ID.
- This reply was modified 1 year, 7 months ago by daymobrew. Reason: Typo in filter name