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

mutation UpdateItemQuantities does not update the cart. #783

Open
Vignesh-02 opened this issue Aug 13, 2023 · 3 comments
Open

mutation UpdateItemQuantities does not update the cart. #783

Vignesh-02 opened this issue Aug 13, 2023 · 3 comments
Labels
awaiting author response Awaiting response from Issue/PR author

Comments

@Vignesh-02
Copy link

Vignesh-02 commented Aug 13, 2023

mutation udpateCartItemQuantities($items: [CartItemQuantityInput] = [{key: "053c837dca3a5636ad1c9bccd6af3415", quantity: 12}], $clientMutationId: String = "random") { updateItemQuantities( input: {items: $items, clientMutationId: $clientMutationId} ) { cart { contents { edges { node { key quantity product { node { image { link } } } total } } itemCount } contentsTotal contentsTax total discountTotal } } }

Even fillCart and removeItems do not work. They give 'internal server error' which in turn gives a 'woo transaction executed out of order' error. Please do fix this ASAP. The only way to avoid the Woo transaction error is to comment out the code at line 224 in class-session-transaction-manager.php

` public function pop_transaction_id() {
// Bail if transaction not started.
if ( is_null( $this->transaction_id ) ) {
return;
}

	// Get transaction queue.
	$transaction_queue = get_transient( "woo_session_transactions_queue_{$this->session_handler->get_customer_id()}" );

	// Throw if transaction ID not on top.
	if ( $this->transaction_id !== $transaction_queue[0]['transaction_id'] ) {

// throw new UserError( __( 'Woo session transaction executed out of order', 'wp-graphql-woocommerce' ) );
} else {

// // Remove Transaction ID and update queue.
array_shift( $transaction_queue );
$this->save_transaction_queue( $transaction_queue );
$this->transaction_id = null;
}
}
`

@kidunot89
Copy link
Member

@Vignesh-02 It would appear you woo session token is not being configured correctly. Have you read through the docs on this subject?

@kidunot89 kidunot89 added the awaiting author response Awaiting response from Issue/PR author label Aug 16, 2023
@kidunot89
Copy link
Member

@Vignesh-02 Have you gotten it working?

@YishaqG
Copy link

YishaqG commented Oct 25, 2023

@kidunot89 It does not work for me, followed the docs (https://woographql.com/docs/configuring-graphql-client-for-user-session and https://woographql.com/docs/configuring-graphql-client-for-user-session) and got the same error using the mutation updateCustomer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting author response Awaiting response from Issue/PR author
Projects
None yet
Development

No branches or pull requests

3 participants