Skip to content

Instantly share code, notes, and snippets.

@marcusig
Last active February 12, 2022 18:37
Show Gist options
  • Save marcusig/08a0dc524c32cba0d1e1a643a2536fd9 to your computer and use it in GitHub Desktop.
Save marcusig/08a0dc524c32cba0d1e1a643a2536fd9 to your computer and use it in GitHub Desktop.
OceanWP add QTY buttons to the configurator
<?php
add_action( 'wp_enqueue_scripts', function() {
wp_add_inline_script( 'mkl_pc/js/product_configurator', "
// When the configurator starts, add the qty buttons
wp.hooks.addAction( 'PC.fe.start', 'MKL/PC/Conditional', function() {
if ( 'undefined' != typeof oceanwpWooCustomFeatures && oceanwpWooCustomFeatures.quantityButtons ) oceanwpWooCustomFeatures.quantityButtons.start();
}, 30 );
" );
}, 60 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment