How can I hook into your wpcss-products POST to get full WooCommerce cart data (including variation ID and attributes)? I need it to be compatible with a plugin that relies on standard Woo cart requests.
Seems I was premature in my success. I am working with the plugin 3DP (https://www.wp3dprinting.com/) which creates an items with some unique attributers. I am getting an error when clicking "add selected items to cart" which leads me to "Invalid Value posted for Printer"
"When using the Share Cart plugin with variable products that have attributes stored as custom taxonomies (e.g., pa_p3d_printer), does Share Cart POST the selected attribute values using the term ID, slug, or label?"
(Follow-up: Can this behavior be configured?)
2. Attribute Validation Compatibility:
"WooCommerce 7.8+ and 9.x have stricter variation attribute validation.
Is Share Cart explicitly preparing the posted attribute fields in a format WooCommerce expects for variable products, or does it just dump the cart's raw attribute values?"
(Follow-up: If not corrected automatically, is there a hook to intercept/modify the attributes before submit?)
3. Customization Hooks or Filters:
"Is there an official hook or filter inside Share Cart to modify the attributes or cart item data before the 'Add Selected Products to Cart' form is submitted or processed?"
(Follow-up: If so, where is it documented or can you provide an example?)
I understand you will need to do a lot of work to make it compatible with 3D Printing. However, I cannot help you with those details. You must read the plugin code and tell me where we should adjust or add filter hooks to support your work. I will help you do that.
For example, in the latest version 2.1.5, we added a filter hook here:
So you can adjust any value before adding the saved product to the cart.
We’re integrating your Share Cart plugin with the 3DPrint plugin, which requires certain attributes (like pa_p3d_printer, pa_p3d_material, etc.) to be passed as term IDs, not slugs or names. Additionally, file-related data comes from a paired file manager and must be rehydrated before cart restore.
Right now, we're hitting errors like: "Invalid value posted for Printer" during restore.
Request:
Please add a filter before add_to_cart() is called so we can modify attributes as needed.
Placing this right before the cart add logic would let us normalize or reroute the data through p3d_add_cart_handler() (used by 3DPrint to bypass strict validation).
How can I hook into your wpcss-products POST to get full WooCommerce cart data (including variation ID and attributes)? I need it to be compatible with a plugin that relies on standard Woo cart requests.
Hi Jason,
Each shared cart has a key. You can retrieve the cart data from a key like this:
Best regards,
Dustin
Thank you! With this help I was able to get my functionality back! Thank you!
Seems I was premature in my success. I am working with the plugin 3DP (https://www.wp3dprinting.com/) which creates an items with some unique attributers. I am getting an error when clicking "add selected items to cart" which leads me to "Invalid Value posted for Printer"
1. Share Cart POST Format for Variable Products:
"When using the Share Cart plugin with variable products that have attributes stored as custom taxonomies (e.g., pa_p3d_printer), does Share Cart POST the selected attribute values using the term ID, slug, or label?"(Follow-up: Can this behavior be configured?)
2. Attribute Validation Compatibility:
"WooCommerce 7.8+ and 9.x have stricter variation attribute validation.Is Share Cart explicitly preparing the posted attribute fields in a format WooCommerce expects for variable products, or does it just dump the cart's raw attribute values?"
(Follow-up: If not corrected automatically, is there a hook to intercept/modify the attributes before submit?)
3. Customization Hooks or Filters:
"Is there an official hook or filter inside Share Cart to modify the attributes or cart item data before the 'Add Selected Products to Cart' form is submitted or processed?"(Follow-up: If so, where is it documented or can you provide an example?)
I understand you will need to do a lot of work to make it compatible with 3D Printing. However, I cannot help you with those details. You must read the plugin code and tell me where we should adjust or add filter hooks to support your work. I will help you do that.
For example, in the latest version 2.1.5, we added a filter hook here:
So you can adjust any value before adding the saved product to the cart.
Best regards,
Dustin
Thanks for your willingness to collaborate.
We’re integrating your Share Cart plugin with the 3DPrint plugin, which requires certain attributes (like pa_p3d_printer, pa_p3d_material, etc.) to be passed as term IDs, not slugs or names. Additionally, file-related data comes from a paired file manager and must be rehydrated before cart restore.
Right now, we're hitting errors like:
Request:"Invalid value posted for Printer" during restore.
Please add a filter before add_to_cart() is called so we can modify attributes as needed.
Proposed hook:
Placing this right before the cart add logic would let us normalize or reroute the data through p3d_add_cart_handler() (used by 3DPrint to bypass strict validation).
Happy to provide sample code if needed.
As per my previous reply, I already added a filter hook at this position:
You can retrieve the product ID from $cart_item:
Best regards,
Dustin