• Resolved robertzollner

    (@robertzollner)


    Just a head-up:

    When using the search form inside an “dialog” html tag, by using “[aws_search_form]” shortcode or “seamless integration”, the live ajax results will be rendered visually under the dialog and will most likely not be visible at all. This is happening because dialog tag is shown in the TopLayer and the z-index of AWS markup has no effect.

    Shoptimizer theme which was prev compatible with AWS has switched to using the ‘dialog’ for the search modal in the latest version 2.7.7 released 31.05.2024

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    Can you help me to find an option for Shoptimizer theme to enable this search form ?inside an “dialog” html tag?

    Regards

    Thread Starter robertzollner

    (@robertzollner)

    The demo with the search modal using the “dialog” html tag can be seen here: https://shoptimizerdemo.commercegurus.com/?header=header-4&headercontainer=full-width-header

    Their demo is using the built-in search but it can be changed from the Appearance / Customization to AWS. And the AWS shortcode will be added inside “dialog.shoptimizer-modal .shoptimizer-modal–content .site-search”

    Plugin Author ILLID

    (@mihail-barinov)

    I see. But please tell me how to enable this “dialog” html. Is it can be enabled somewhere inside Appearance / Customization ?

    Thread Starter robertzollner

    (@robertzollner)

    Themes Customization:
    “Header and Navigation” -> “Header” -> “Header Layout” has to be set to “Logo / Navigation / Cart” from the dropdown

    Plugin Author ILLID

    (@mihail-barinov)

    Please try to use following custom code snippet:

    add_action( 'wp_enqueue_scripts', 'aws_wp_enqueue_scripts', 999 );
    function aws_wp_enqueue_scripts() {

    $script = "
    function aws_results_append_to( container, options ) {
    if ( options.form.closest('.shoptimizer-modal').length > 0 ) {
    return '.shoptimizer-modal .site-search';
    }
    return container;
    }
    function aws_results_layout( styles, options ) {
    if ( options.form.closest('.shoptimizer-modal').length > 0 ) {
    var offset = options.form.offset();
    var dialogOffset = options.form.closest('.site-search').offset();
    styles.left = offset.left - dialogOffset.left;
    styles.top = offset.top - dialogOffset.top + options.form.innerHeight();
    }
    return styles;
    }
    AwsHooks.add_filter( 'aws_results_append_to', aws_results_append_to );
    AwsHooks.add_filter( 'aws_results_layout', aws_results_layout );
    ";

    wp_add_inline_script( 'aws-script', $script);
    wp_add_inline_script( 'aws-pro-script', $script);

    }

    I will also add the same changes to the next plugin release.

    Regards

    Thread Starter robertzollner

    (@robertzollner)

    I have tested and it is working perfect, well done!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.