Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gplc-gspc-compatibility.php: Added new snippet to check validation before an order is created. #893

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

barthc
Copy link
Contributor

@barthc barthc commented Sep 23, 2024

Context

⛑️ Ticket(s): https://secure.helpscout.net/conversation/2696647789/70877

Summary

Added new snippet to check validation again before an order is created.

Copy link

github-actions bot commented Sep 23, 2024

Warnings
⚠️ When ready, don't forget to request reviews on this pull request from your fellow wizards.

Generated by 🚫 dangerJS against 60f1f4e

$items = $order->get_items();

foreach ( $items as $item ) {
$gspc_order_item = new WC_Order_Item( $item );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$gspc_order_item = new WC_Order_Item( $item );
$gspc_order_item = new GS_Product_Configurator\WC_Order_Item( $item );

I think you're going to need the namespace here. Is this snippet confirmed working right now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@claygriffiths Yes the snippet is working.

*/

add_action( 'woocommerce_checkout_create_order', function( $order ) {
if ( ! function_exists( 'gp_limit_choices' ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also check for GSPC here

@barthc barthc force-pushed the barth/add/70877-gplc-gspc-compatibility branch from 38e4ed8 to 60f1f4e Compare September 24, 2024 07:59
@barthc barthc merged commit 81df57d into master Sep 27, 2024
3 checks passed
@barthc barthc deleted the barth/add/70877-gplc-gspc-compatibility branch September 27, 2024 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants