Download the PHP package jacobarriola/woographql-product-bundles without Composer
On this page you can find all versions of the php package jacobarriola/woographql-product-bundles. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jacobarriola/woographql-product-bundles
More information about jacobarriola/woographql-product-bundles
Files in jacobarriola/woographql-product-bundles
Package woographql-product-bundles
Short Description Add WooCommerce Product Bundles support to the WPGraphQL schema.
License GPL-3.0-or-later
Informations about the package woographql-product-bundles
WooGraphQL Product Bundles
Add WooCommerce Product Bundle support to your WPGraphQL schema.
Requirements
- PHP +7.1
- WordPress +5.0
- WPGraphQL +1
- WooGraphQL +0.8.0
- WooCommerce +4.7.0
- WooCommerce Product Bundles +0.5.0
Documentation
Add To Cart Mutation
For now, add to cart is a different mutation since additional data is required. The mutation
mimics the existing WooGraphQL addToCart
, with a few differences.
Essentially it attempts to mimic the underlying Product Bundles' API, which is found https://docs.woocommerce.com/document/bundles/bundles-functions-reference/#add_bundle_to_cart
The extraData
input is a JSON value.
Arguments
object index
: The bundle item IDproduct_id
: Product ID of the bundled itemquantity
: Quantity of the bundled itemvariation_id
: The variation ID of the selected variation, if applicableattributes
: An object with the key asattribute_ATTRIBUTE_SLUG
and the value as the attribute value, if applicable
Example:
In this example, the Bundle contains two Bundle Items, 765
and 896
. 765
is a variable
product (designated by the product_id: 9876
). The variation_id
and attributes are required
. On the other hand, 896
is a simple product. It's only passing in the product_id
.
Todo
- return appropriate types instead of JSON for
allowedVariations
anddefaultVariationAttributes
- simplify the
addToCartBundle
or merge it with the coreaddToCart
mutation