• Hello,

    We love to Product Configurator but it turns out when we have the plugin Weglot enabled, the Product Configurator breaks completely on the translated pages. On the German page (main language) it works flawlessly, but on the English page we get this JavaScript error:

    SyntaxError: Unexpected token ‘<‘

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

    (@marcusig)

    HI there,

    Could you try adding the following code, which should prevent Weglot from translating the data:

    add_filter( 'weglot_ajax_no_translate', function( $actions ) {
    	$actions[] = 'pc_get_data';
    	return $actions;
    } );

    Marc

    Thread Starter modularte

    (@modularte)

    Hi Marc,

    Thanks for your quick reply. Sadly, the solution provided by you didn’t appear to change anything, were you able to reproduce the issue?

    Currently I temporarily resolved the issue by preventing the URLs where the Product Configurator is enabled to be translated but ideally this is not a long-term solution.

    Plugin Contributor Marc Lacroix

    (@marcusig)

    Could you maybe contact Weglot support, as they’re obviously applying some filters on the Ajax results, ending in the broken content.
    They’ll probably know the right filter to use to disable this.

    Marc

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘SyntaxError when using Weglot’ is closed to new replies.