We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
gspc-clear-stale-entries-on-load.php
1 parent 26aefd9 commit 54c98d2Copy full SHA for 54c98d2
gs-product-configurator/gspc-clear-stale-entries-on-load.php
@@ -0,0 +1,15 @@
1
+<?php
2
+/**
3
+ * Gravity Shop // Product Configurator // Clear stale Entries on load
4
+ * https://gravitywiz.com/documentation/gravity-shop-product-configurator/
5
+ *
6
+ * Although stale entries are cleared via the `woocommerce_cleanup_sessions` cron schedule that runs twice daily,
7
+ * this snippet will clear the stale entries on site load.
8
+ */
9
+
10
+add_action( 'woocommerce_set_cart_cookies', function( $set ) {
11
+ if ( ! $set && class_exists( 'GS_Product_Configurator\Entry_Lifecycle' ) ) {
12
+ $entry_lifecycle = new GS_Product_Configurator\Entry_Lifecycle();
13
+ $entry_lifecycle->cleanup_stale_entries();
14
+ }
15
+} );
0 commit comments