• Resolved chris15326

    (@chris15326)


    Hey! So I believe what I want to do can be done with some PHP code. I already moved address fields around, but now I would love to change the position of my opt-in consent directly under the mail-address field:
    https://i.postimg.cc/qBY50G2F/fdfdfdffdf.png

    The block of the consent consists out of two nested classes, the outer class is growmatik_consent_wc_checkout and the inner growmatik-consent.

    Hope you can help out on this one!

    As always: Thank you for your time and support-

    With kind regards
    Chris

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi @chris15326

    Thanks for reaching out!

    I understand that you want to change the position of your opt-in consent directly under the mail-address field as seen on this screenshot.

    Can you please share your site’s URL so that we could check this further?

    Thanks!

    Thread Starter chris15326

    (@chris15326)

    Hey @xue28 !

    Thank you so much!

    You can check this out under this staging:
    https://wordpress-858200-3004984.cloudwaysapps.com/index.php/product/denim-jacket/

    Here is an Image to give you an idea:
    https://i.postimg.cc/Y9bjZYyN/fdfdfdffdf.png

    With kind regards
    Chris

    P.S:
    Here is the PHP Code I used to change the position of the e-mail-field, but I dont think this is any help:

    add_filter( 'woocommerce_billing_fields', 'bbloomer_move_checkout_email_field' );
     
    function bbloomer_move_checkout_email_field( $address_fields ) {
        $address_fields['billing_email']['priority'] = 1;
        return $address_fields;
    }
    anastas10s

    (@anastas10s)

    Howdy @chris15326 ??

    You can check this out under this staging:
    https://wordpress-858200-3004984.cloudwaysapps.com/index.php/product/denim-jacket/

    Thanks for providing us with the site’s URL. From what I gather, the site at https://wordpress-858200-3004984.cloudwaysapps.com/index.php/product/denim-jacket/ is using the Shoptimizer theme, which in turn has a custom checkout page layout, according to the article directly linked here.

    Therefore, I suggest getting in touch with the theme’s support regarding this inquiry. Here is the link I could find:
    https://www.commercegurus.com/support/

    I trust that points you in the right direction, but if you have more questions, let us know. We’re happy to help.

    Thread Starter chris15326

    (@chris15326)

    Hey @anastas10s thanks for your response!

    Yes, the Checkout is from the theme, but the actual checkout field is fully WooCommerce.

    I hope you know what I mean. That’s why I was able to setup and change a lot through the WooCommerce app itself and also used WooCommerce’s codes to relocate the single fields within the checkout form fields.

    I already asked Shoptimizer as well and they pointed me towards you/WooCommerce! ??

    Thread Starter chris15326

    (@chris15326)

    The plugin that creates this opt-in on the checkout page also said I would need to ask the Woo support. ?? Because the checkout area itself is pure Woo and I want to add it right there.

    From my understanding the code would need to be similar to this one:

    add_filter( 'woocommerce_billing_fields', 'bbloomer_move_checkout_email_field' );
     
    function bbloomer_move_checkout_email_field( $address_fields ) {
        $address_fields['billing_email']['priority'] = 1;
        return $address_fields;
    }

    That was the code I was able to display the e-mail-field on top of all other fields. But it would need to address the Checkout opt-in and I cant make this due to lack of basic understanding.

    Saif

    (@babylon1999)

    Hello @chris15326,

    The entire checkout template in your case is not controlled by WooCommerce, and even if it was changing field positions is definitely not within our scope of support here unless you’re using WooCommerce blocks.

    However, I didn’t want to end my reply without providing any help, so here’s what I’ll recommend you do.

    Reach out to the plugin developer for that consent field and ask them for the name of the field so you can add it instead of the_conset_hook below.

    As for the priority, then it should stay 22 to be under the email, but since you don’t have a first and last name the email field might consider the first field, in which case change it to 11. ??

    
    add_filter( 'woocommerce_checkout_fields', 'Email_first_everything_below' );
    
    function Email_first_everything_below( $checkout_fields ) {
    	$checkout_fields[ 'billing' ][ 'the_conset_hook' ][ 'priority' ] = 22;
    	return $checkout_fields;
    }
    

    If you need more help with this, I recommend working with a WooExpert.

    Hope this helps!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Change checkout opt-in position’ is closed to new replies.