• mrrhut

    (@mrrhut)


    Can you please assist on how I can move the “configure” button bellow the product variations div .

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Marc Lacroix

    (@marcusig)

    Hi there,

    You can try the various positions available in Settings > Product Configurator > General options > Where should the “configure” button be placed.

    Marc

    Thread Starter mrrhut

    (@mrrhut)

    Thanks for the reply Marc.

    I have seen those options in the setting but unfortunately the place I want to put the button is not showing there.

    I want to place it below the variations options :

    .single-product .entry-summary form.variations_form div.variations

    Plugin Contributor Marc Lacroix

    (@marcusig)

    Ok. Then you can try the following PHP:

    /**
     * remove the Configure button
     */
    add_action( 'woocommerce_before_single_product_summary', function() {
    	// add button after form, as form will be moved.
    	$location = 'woocommerce_after_add_to_cart_form';
    	$priority = 20;
    	if ( $location = mkl_pc( 'settings' )->get( 'configure_button_location' ) ) {
    		$pr = explode( ':', $location );
    		if ( isset( $pr[0] ) ) $location = $pr[0];
    		if ( isset( $pr[1] ) ) $priority = intVal( $pr[1] );
    	}
    	remove_action( $location, array( mkl_pc( 'frontend' )->product, 'add_configure_button' ), $priority );
    }, 20 );
    
    /**
     * Add configure button after .variations elemeent
     */
    add_action( 'woocommerce_after_variations_table', array( mkl_pc( 'frontend' )->product, 'add_configure_button' ) );

    You can add this PHP to your theme’s functions.php, or any other appropriate location.

    Though note that this is made to work with WooCommerce’s hooks.

    You seem to be using a plugin which changes the variations layout (isw-swatches?), so this code will only work if this plugin utilises WooCommerce existing hooks.

    Marc

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Move location of “configure” button’ is closed to new replies.