gspc_process_form_on_add_to_cart
Description
Filter if the form should be processed when adding to the cart. Defaults to true. Useful to
skip an attached form for specific variations, etc.
Usage
Filter if attached forms should be processed when adding a product to cart.
add_filter( 'gspc_process_form_on_add_to_cart', '__return_true' );Parameters
process_form bool
True to process and validate attached form, false to skip processing and defer to the default behavior.
product \WC_Product
The current product.
product_form \GFForm
The product form.
feed \GSPCFeed
The product feed.
valid bool
The current validation status.
quantity int
The quantity of the product being added to the cart.
variation_id int|null
The variation ID being added to the cart.
variation array|null
The variation data.
Examples
Skip processing if a “skip-form” query parameter is present.
add_filter( 'gspc_process_form_on_add_to_cart', function ( $process_form ) {
if ( rgget( 'skip-form' ) ) {
return false;
}
return $process_form;
}, 10 );Skip processing the form if the product is a specific variation.
add_filter( 'gspc_process_form_on_add_to_cart', function ( $process_form, $product, $product_form, $feed, $valid, $quantity, $variation_id, $variation ) {
if ( $variation_id == 123 )
return false;
}
return $process_form;
}, 10, 8 );Since
This filter is available since Gravity Shop Product Configurator 1.0-beta-2.26.
All Connections
All Perks
- GF Address Autocomplete
- GF Advanced Calculations
- GF Advanced Phone Field
- GF Advanced Save & Continue
- GF Advanced Select
- GF Auto List Field
- GF Auto Login
- GF Better User Activation
- GF Blocklist
- GF Bookings
- GF Conditional Logic Dates
- GF Conditional Pricing
- GF Copy Cat
- GF Date Time Calculator
- GF Disable Entry Creation
- GF Easy Passthrough
- GF eCommerce Fields
- GF Email Users
- GF Email Validator
- GF Entry Blocks
- GF Expand Textareas
- GF File Renamer
- GF File Upload Pro
- GF Inventory
- GF Limit Checkboxes
- GF Limit Dates
- GF Limit Submissions
- GF Live Preview
- GF Media Library
- GF Multi-Page Navigation
- GF Nested Forms
- GF Notification Scheduler
- GF Page Transitions
- GF Pay Per Word
- GF Populate Anything
- GF Post Content Merge Tags
- GF Preview Submission
- GF Price Range
- GF QR Code
- GF Randomizer
- GF Read Only
- GF Reload Form
- GF Submit to Access
- GF Terms Of Service
- GF Unique ID
- GF Word Count