Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@marcusig
Created May 18, 2022 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusig/c2d15f8bf44ced473b2e1dacd487e00e to your computer and use it in GitHub Desktop.
Save marcusig/c2d15f8bf44ced473b2e1dacd487e00e to your computer and use it in GitHub Desktop.
Move the Save your design button to the sidebar
<?php
// Hook before the templates are included
add_action( 'mkl_pc_frontend_templates_before', function() {
// Get the SYD instance
$save_your_design = mkl_pc()->get_extension( 'save-your-design' );
if ( ! $save_your_design ) return;
// Remove the original button
remove_action( 'mkl_pc_frontend_configurator_footer_section_right_before', array( $save_your_design->product, 'add_configurator_button' ), 20 );
// Add the original button in the toolbar instead
add_action( 'mkl_pc_frontend_configurator_toolbar', array( $save_your_design->product, 'add_configurator_button' ), 20 );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment