Internet Explorer wordt niet ondersteund voor deze website. U wordt geadviseerd om een moderne webbrowser te gebruiken.
Even geduld...
Bezig met laden configurator
Stap 1 3

Kies uw voordeur

Gebruik de filters om snel te zoeken en de resultaten te verfijnen.

Stap 2 3

Bepaal de juiste maat

Pas de deur volledig aan naar jouw situatie.

{substepvalue} {substepname}
Kies een draairichting
Voor buitendeuren is het belangrijk om aan te geven of de deur naar binnen of naar buiten open draait. De meeste voordeuren gaan naar binnen open en de meeste achterdeuren naar buiten.
{substepvalue} {substepname}
Stap 3 3

Accessoires

Maak je deur compleet door accessoires toe te voegen.

{substepvalue} {substepname}
{substepvalue} {substepname}
Stap 5 5 2

Controleer je bestelling

Je hebt voor de onderstaande producten gekozen. We adviseren je om de informatie nog eenmaal goed te controleren.

Terug

Mail deze configuratie naar mijn mailadres

Bewaar deze configuratie

Vul hier je e-mailadres in en kies een naam voor deze configuratie.

Uw configuratie is opgeslagen

Voeg configuratie toe aan uw winkelwagen op uw mobiel

Door het scannen van de QR-code wordt deze configuratie in de winkelwagen van Praxis geplaatst. Hier kun je de bestelling eenvoudig en veilig afronden.

  • {stepnumber} {mainstepname} {steps}
  • {stepvalue} {stepname}:

    Request Details

    Session Id:lmvwnqbbvatitq4rnfyjuzldRequest Type:GET
    Time of Request:13-9-2026 08:59:23Status Code:200
    Request Encoding:Unicode (UTF-8)Response Encoding:Unicode (UTF-8)

    Trace Information

    CategoryMessageFrom First(s)From Last(s)
    aspx.pageBegin PreInit
    aspx.pageEnd PreInit0,0000410,000041
    aspx.pageBegin Init0,0000550,000014
    LoginControl_Init - isValidForThisDomain: True0,0002340,000179
    LoginControl - SetupWebsite - proceed: True, GoAnCode: , TagManagerId: 0,0003320,000097
    This is page: homepage.aspx. With masterpagefile: 0,0004860,000154
    CSS template IDs found: 0,0007860,000300
    End load CSS from Wiser...0,0008010,000015
    JS template IDs found: 0,0010340,000234
    NO JS template inline found0,0010440,000010
    End load JS from Wiser...0,0010550,000010
    aspx.pageEnd Init0,0011110,000056
    aspx.pageBegin InitComplete0,0011200,000009
    aspx.pageEnd InitComplete0,0011270,000006
    aspx.pageBegin PreLoad0,0011330,000007
    aspx.pageEnd PreLoad0,0011390,000006
    aspx.pageBegin Load0,0011450,000006
    aspx.pageEnd Load0,0011980,000053
    aspx.pageBegin LoadComplete0,0012050,000007
    aspx.pageEnd LoadComplete0,0012110,000006
    aspx.pageBegin PreRender0,0012170,000006
    aspx.pageEnd PreRender0,0012770,000060
    aspx.pageBegin PreRenderComplete0,0012900,000013
    aspx.pageEnd PreRenderComplete0,0012980,000008
    aspx.pageBegin SaveState0,0015360,000238
    aspx.pageEnd SaveState0,0015470,000011
    aspx.pageBegin SaveStateComplete0,0015580,000011
    aspx.pageEnd SaveStateComplete0,0015680,000010
    aspx.pageBegin Render0,0015760,000008
    QUERY SYSCON START:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    0,0026060,001030
    Open connection with DB0,0027730,000167
    QUERY SYSCON END:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    0,1103790,107606
    RenderStep Kies uw buitendeur connected to: 2289 - mainstepnumber: 1 - stepnumber: 1 - dependentvalue: 2289 - datasource connectedid: 22890,1142370,003858
    [RenderValues] set query and/or replacements0,1143040,000067
    [RenderValues] Execute query0,1152460,000942
    query cachinghours: 2000,1153630,000117
    QUERY SYSCON START: SET @doortype = 'buitendeur';
    SET @doorsubtype = 'voordeuren';
    SET @_door_id = IF('{door_id}' LIKE '{%}', false, CAST('{door_id}' AS UNSIGNED));
    SET @_glass_id = IF('{glass_id}' LIKE '{%}', false, CAST('{glass_id}' AS UNSIGNED));

    SELECT
    door.fsc AS fsc,
    door.KOMO AS komo,
       doorCat.isEasy AS gelaktgeleverd,
       doorCat.cando_comfort as candocomfort,
    IF(IFNULL(door.warrantyinYears,0)>9,1,0) AS ten_yr_guarantee,
    door.id AS door_id,
    doorCat.id AS door_cat_id,
    doorCat.`name` AS door_name,
    doorCat.style AS style,
    IFNULL(doorCat.door_wood_type, "Overig") AS door_wood_type,
    doorCat.isolerend AS isolerend,
    GROUP_CONCAT(DISTINCT CONCAT(door.height, "x", door.width)) AS sizes,
       IFNULL(MIN(glass.id),"") AS glass_id,
    IFNULL(glass.description_short, "") AS glass_name,
    doorCat.containsglass AS has_glass,
    IFNULL(GROUP_CONCAT(DISTINCT IF(glass.glassType='Paneel', 'Dichte deur', glass.glassType)), IF(doorCat.containsglass =0 OR  glass.glassType='Paneel' ,"Dichte deur", "")) AS glass_type,
    #CONCAT_WS(IF(glass.description_short <> 'Paneel',' met ',' '), doorCat.name, REPLACE(glass.description_short,'Paneel','zonder glas')) AS `name`,
       REPLACE(CONCAT_WS(" met ", doorCat.name, glass.description_short), 'met zonder','zonder') AS `name`,
    GROUP_CONCAT(DISTINCT door.producttype) AS door_type,
    door.eancode AS door_ean,
    glass.eancode AS glass_ean,
    MIN(door.pricecando)  AS door_price,
    glass.pricecando  AS glass_price,
    REPLACE(TRUNCATE(MIN(door.pricecando) + IFNULL(glass.pricecando,0) + IFNULL(mounting_package.pricecando,0),2), '.',',') AS total_price,
    IFNULL(CONCAT('<li>',REPLACE(doorCat.usp_s, '\r\n', '</li><li>'),'</li>'),'') AS usps,
    CONCAT('https://configurator.cando.eu/images/product/overzicht/',IFNULL(IFNULL(img.bestandsnaam,imgBackup.bestandsnaam), '')) AS img_url,
    REPLACE(CONCAT('https://configurator.cando.eu/images/product/overzicht/',IFNULL(IFNULL(img.bestandsnaam,imgBackup.bestandsnaam), '')),'_klein_','_vergroting_')  AS img_url_large,
       REPLACE(CONCAT('https://configurator.cando.eu/images/product/overzicht/',IFNULL(img2.bestandsnaam, '')),'_klein_','_vergroting_')  AS img2_url_large,
       IFNULL(img2.bestandsnaam, '') AS sfeerImageFile,
    glass.visiblecando AS `visible`,
    glass.description_short AS `glass_description`,
       doorCat.sequence AS `orderNr`
    FROM shop_products door
    JOIN shop_pro_cat door_to_cat ON door_to_cat.product_id=door.id
    JOIN shop_category doorCat ON doorCat.doortype=@doortype AND doorCat.id=door_to_cat.cat_id
    LEFT JOIN shop_koppeling glass_to_door ON glass_to_door.prod_dest=door.id AND glass_to_door.koppeltype IN("Roede", "Glas")
    LEFT JOIN shop_products glass ON glass.id=glass_to_door.prod_source #AND glass.visiblecando <> 0
    LEFT JOIN shop_koppeling mounting_package_to_glass ON mounting_package_to_glass.prod_dest=glass.id AND mounting_package_to_glass.koppeltype="Verplicht item"
    LEFT JOIN shop_products mounting_package ON mounting_package.id=mounting_package_to_glass.prod_source
    LEFT JOIN shop_pictures img ON img.cat_id=doorCat.id AND img.formaatnaam = 'klein' AND img.fototype='deur' AND IF(glass.description_short IS NULL, img.name = doorCat.`name`, img.name = glass.description_short)
    LEFT JOIN shop_pictures img2 ON img2.cat_id=doorCat.id AND img2.formaatnaam = 'vergroting' AND img2.fototype='sfeerfoto' AND IF(glass.description_short IS NULL, img.name = doorCat.`name`, img.name = glass.description_short)
    LEFT JOIN shop_pictures imgBackup ON imgBackup.cat_id=doorCat.id AND imgBackup.formaatnaam = 'klein' AND imgBackup.fototype='deur'
    WHERE doorCat.doortype=@doortype
    AND doorCat.doorsubtype=@doorsubtype
       AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', door.visiblecando, door.visiblecandoBranch) <> 0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', doorCat.visiblecando, doorCat.visiblecandoBranch) <> 0
    AND IF(@_door_id = false, 1, door.id = @_door_id)
    AND IF(@_glass_id = false, 1, glass.id = @_glass_id)
       AND (glass.id IS NULL OR glass.visiblecando <> 0)
    GROUP BY `name`
    #HAVING (visible <> 0 OR IFNULL(glass_description, "") = 'zonder glas' OR LOWER(glass_type) = 'zonder glas' OR NULLIF(glass_type, '') IS NULL)
    ORDER BY doorCat.sequence
    0,1153920,000029
    Open connection with DB0,1154810,000089
    QUERY SYSCON END: SET @doortype = 'buitendeur';
    SET @doorsubtype = 'voordeuren';
    SET @_door_id = IF('{door_id}' LIKE '{%}', false, CAST('{door_id}' AS UNSIGNED));
    SET @_glass_id = IF('{glass_id}' LIKE '{%}', false, CAST('{glass_id}' AS UNSIGNED));

    SELECT
    door.fsc AS fsc,
    door.KOMO AS komo,
       doorCat.isEasy AS gelaktgeleverd,
       doorCat.cando_comfort as candocomfort,
    IF(IFNULL(door.warrantyinYears,0)>9,1,0) AS ten_yr_guarantee,
    door.id AS door_id,
    doorCat.id AS door_cat_id,
    doorCat.`name` AS door_name,
    doorCat.style AS style,
    IFNULL(doorCat.door_wood_type, "Overig") AS door_wood_type,
    doorCat.isolerend AS isolerend,
    GROUP_CONCAT(DISTINCT CONCAT(door.height, "x", door.width)) AS sizes,
       IFNULL(MIN(glass.id),"") AS glass_id,
    IFNULL(glass.description_short, "") AS glass_name,
    doorCat.containsglass AS has_glass,
    IFNULL(GROUP_CONCAT(DISTINCT IF(glass.glassType='Paneel', 'Dichte deur', glass.glassType)), IF(doorCat.containsglass =0 OR  glass.glassType='Paneel' ,"Dichte deur", "")) AS glass_type,
    #CONCAT_WS(IF(glass.description_short <> 'Paneel',' met ',' '), doorCat.name, REPLACE(glass.description_short,'Paneel','zonder glas')) AS `name`,
       REPLACE(CONCAT_WS(" met ", doorCat.name, glass.description_short), 'met zonder','zonder') AS `name`,
    GROUP_CONCAT(DISTINCT door.producttype) AS door_type,
    door.eancode AS door_ean,
    glass.eancode AS glass_ean,
    MIN(door.pricecando)  AS door_price,
    glass.pricecando  AS glass_price,
    REPLACE(TRUNCATE(MIN(door.pricecando) + IFNULL(glass.pricecando,0) + IFNULL(mounting_package.pricecando,0),2), '.',',') AS total_price,
    IFNULL(CONCAT('<li>',REPLACE(doorCat.usp_s, '\r\n', '</li><li>'),'</li>'),'') AS usps,
    CONCAT('https://configurator.cando.eu/images/product/overzicht/',IFNULL(IFNULL(img.bestandsnaam,imgBackup.bestandsnaam), '')) AS img_url,
    REPLACE(CONCAT('https://configurator.cando.eu/images/product/overzicht/',IFNULL(IFNULL(img.bestandsnaam,imgBackup.bestandsnaam), '')),'_klein_','_vergroting_')  AS img_url_large,
       REPLACE(CONCAT('https://configurator.cando.eu/images/product/overzicht/',IFNULL(img2.bestandsnaam, '')),'_klein_','_vergroting_')  AS img2_url_large,
       IFNULL(img2.bestandsnaam, '') AS sfeerImageFile,
    glass.visiblecando AS `visible`,
    glass.description_short AS `glass_description`,
       doorCat.sequence AS `orderNr`
    FROM shop_products door
    JOIN shop_pro_cat door_to_cat ON door_to_cat.product_id=door.id
    JOIN shop_category doorCat ON doorCat.doortype=@doortype AND doorCat.id=door_to_cat.cat_id
    LEFT JOIN shop_koppeling glass_to_door ON glass_to_door.prod_dest=door.id AND glass_to_door.koppeltype IN("Roede", "Glas")
    LEFT JOIN shop_products glass ON glass.id=glass_to_door.prod_source #AND glass.visiblecando <> 0
    LEFT JOIN shop_koppeling mounting_package_to_glass ON mounting_package_to_glass.prod_dest=glass.id AND mounting_package_to_glass.koppeltype="Verplicht item"
    LEFT JOIN shop_products mounting_package ON mounting_package.id=mounting_package_to_glass.prod_source
    LEFT JOIN shop_pictures img ON img.cat_id=doorCat.id AND img.formaatnaam = 'klein' AND img.fototype='deur' AND IF(glass.description_short IS NULL, img.name = doorCat.`name`, img.name = glass.description_short)
    LEFT JOIN shop_pictures img2 ON img2.cat_id=doorCat.id AND img2.formaatnaam = 'vergroting' AND img2.fototype='sfeerfoto' AND IF(glass.description_short IS NULL, img.name = doorCat.`name`, img.name = glass.description_short)
    LEFT JOIN shop_pictures imgBackup ON imgBackup.cat_id=doorCat.id AND imgBackup.formaatnaam = 'klein' AND imgBackup.fototype='deur'
    WHERE doorCat.doortype=@doortype
    AND doorCat.doorsubtype=@doorsubtype
       AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', door.visiblecando, door.visiblecandoBranch) <> 0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', doorCat.visiblecando, doorCat.visiblecandoBranch) <> 0
    AND IF(@_door_id = false, 1, door.id = @_door_id)
    AND IF(@_glass_id = false, 1, glass.id = @_glass_id)
       AND (glass.id IS NULL OR glass.visiblecando <> 0)
    GROUP BY `name`
    #HAVING (visible <> 0 OR IFNULL(glass_description, "") = 'zonder glas' OR LOWER(glass_type) = 'zonder glas' OR NULLIF(glass_type, '') IS NULL)
    ORDER BY doorCat.sequence
    0,4440150,328534
    [RenderValues] Do last replacements. Num items: 810,4440510,000037
    [RenderValues] replacements done1,8135721,369521
    RenderStep (values rendered) Kies uw buitendeur connected to: 2289 - mainstepnumber: 1 - stepnumber: 1 - dependentvalue: 2289 - datasource connectedid: 22891,8140340,000462
    [RenderValues] set query and/or replacements1,8151280,001093
    RenderSubStep  connected to:  - mainstepnumber: 1 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 1,8151540,000026
    Language 38 is new1,8153330,000179
    Cache item 'ML_38' already exists, so language is not cached again1,8153650,000032
    Session 'MlJclLanguage' set to 381,8153770,000012
    Start replace dynamic content1,8153980,000022
    Replace dynamic content only once1,8154770,000079
    End replace dynamic content1,8154890,000011
    Filled translationcomponent from cache.1,8160840,000596
    No caching of lanuage 38. Because it is not changed within this session.1,9606430,144559
    Cache item 'ML_38' already exists, so language is not cached again1,9607170,000074
    Session 'MlJclLanguage' set to 381,9607270,000010
    Start replace dynamic content1,9618650,001139
    Replace dynamic content only once1,9643240,002459
    End replace dynamic content1,9643610,000037
    Filled translationcomponent from cache.1,9649510,000590
    Start replacing system objects2,0007970,035846
    Start replacing translation2,0039410,003144
    Start replacing objects2,0049980,001057
    Start replacing request2,0062780,001280
    Start replacing session2,1625980,156320
    Start replacing standards2,1736490,011051
    Start replacing objecs again2,1750060,001357
    [RenderValues] set query and/or replacements2,5696350,394629
    RenderSubStep  connected to:  - mainstepnumber: 1 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 2,5696990,000064
    No caching of lanuage 38. Because it is not changed within this session.2,5699300,000232
    Cache item 'ML_38' already exists, so language is not cached again2,5699680,000038
    Session 'MlJclLanguage' set to 382,5699840,000016
    Start replace dynamic content2,5700100,000026
    Replace dynamic content only once2,5700950,000085
    End replace dynamic content2,5701020,000007
    Filled translationcomponent from cache.2,5705900,000488
    QUERY SYSCON START:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    2,6023110,031721
    Open connection with DB2,6025040,000193
    QUERY SYSCON END:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    2,6401090,037605
    RenderStep Binnendraaiend connected to: binnendeuren  deurtype - mainstepnumber: 2 - stepnumber: 1 - dependentvalue: 1 - datasource connectedid: binnendeuren - deurtype2,6439590,003850
    [RenderValues] set query and/or replacements2,6440070,000049
    RenderStep (values rendered) Binnendraaiend connected to: binnendeuren  deurtype - mainstepnumber: 2 - stepnumber: 1 - dependentvalue: 1 - datasource connectedid: binnendeuren - deurtype2,6440350,000028
    [RenderValues] set query and/or replacements2,6440630,000028
    [RenderValues] Execute query2,6443450,000283
    query cachinghours: 2002,6444350,000090
    query from cache 'JCLDC2a8ee254c5365604b0b2bdf7a6987f6c'2,6444500,000015
    QUERY SYSCON END (FROM CACHE): SET @isBinnen = IF('{uitvoering}' ='Binnendraaiend', true,false);
    SET @isSet = IF('{uitvoering}' LIKE '{%}', false, true);

    SELECT * FROM (
    SELECT 'Links binnendraaiend' AS valuelist_1, 'linksbinnendraaiend' AS valuelist_2, 'L1' AS valuelist_3
    UNION
    SELECT'Rechts binnendraaiend', 'rechtsbinnendraaiend', 'R2'
    ) binnen
    WHERE @isBinnen AND @isSet
    UNION ALL

    SELECT * FROM (
    SELECT 'Links buitendraaiend' AS valuelist_1, 'linksbuitendraaiend' AS valuelist_2, 'L3' AS valuelist_3
    UNION
    SELECT'Rechts buitendraaiend', 'rechtsbuitendraaiend', 'R4'
    ) buiten
    WHERE @isBinnen = false AND @isSet;
    2,6444640,000014
    [RenderValues] Do last replacements. Num items: 02,6444730,000009
    [RenderValues] replacements done2,6444790,000006
    RenderSubStep Kies een draairichting (binnen) connected to: draairichting - mainstepnumber: 2 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: draairichting2,6444920,000012
    No caching of lanuage 38. Because it is not changed within this session.2,6446950,000204
    Cache item 'ML_38' already exists, so language is not cached again2,6447100,000015
    Session 'MlJclLanguage' set to 382,6447190,000010
    Start replace dynamic content2,6447430,000024
    Replace dynamic content only once2,6448030,000059
    End replace dynamic content2,6448130,000010
    Filled translationcomponent from cache.2,6452660,000453
    No caching of lanuage 38. Because it is not changed within this session.2,6738970,028631
    Cache item 'ML_38' already exists, so language is not cached again2,6739680,000071
    Session 'MlJclLanguage' set to 382,6739780,000010
    Start replace dynamic content2,6740250,000047
    QUERY SYSCON START: SELECT * FROM easy_webpages WHERE id=642,6744940,000470
    Open connection with DB2,6745130,000019
    QUERY SYSCON END: SELECT * FROM easy_webpages WHERE id=642,7957020,121188
    Set SEO fields on webpage2,7957420,000040
    title: Welkom op mijn website2,7957530,000011
    metadescription: Vul hier de meta description in2,7957590,000006
    canonicalurl: 2,7957650,000006
    noindex: False2,7957730,000008
    nofollow: False2,7957790,000006
    AddSEOFields: Title=Welkom op mijn website, Description=Vul hier de meta description in, Keywords=Vul hier de metatags in, CanonicalURL=, NoIndex=False, NoFollow=False, Robots=2,7957900,000011
    Trying to add meta data, but no header with runat='server' was found2,7957950,000006
    Start replace dynamic content2,7958480,000052
    Replace dynamic content only once2,7959480,000100
    End replace dynamic content2,7959590,000011
    Filled translationcomponent from cache.2,7964450,000486
    Start replace dynamic content2,7983090,001864
    End replace dynamic content2,7984340,000126
    Filled translationcomponent from cache.2,7988940,000459
    End replace dynamic content2,8233480,024454
    Filled translationcomponent from cache.2,8240640,000716
    [RenderValues] set query and/or replacements2,8495620,025499
    [RenderValues] Execute query2,8499600,000397
    query cachinghours: 2002,8500400,000081
    query from cache 'JCLDC2a8ee254c5365604b0b2bdf7a6987f6c'2,8500530,000013
    QUERY SYSCON END (FROM CACHE): SET @isBinnen = IF('{uitvoering}' ='Binnendraaiend', true,false);
    SET @isSet = IF('{uitvoering}' LIKE '{%}', false, true);

    SELECT * FROM (
    SELECT 'Links binnendraaiend' AS valuelist_1, 'linksbinnendraaiend' AS valuelist_2, 'L1' AS valuelist_3
    UNION
    SELECT'Rechts binnendraaiend', 'rechtsbinnendraaiend', 'R2'
    ) binnen
    WHERE @isBinnen AND @isSet
    UNION ALL

    SELECT * FROM (
    SELECT 'Links buitendraaiend' AS valuelist_1, 'linksbuitendraaiend' AS valuelist_2, 'L3' AS valuelist_3
    UNION
    SELECT'Rechts buitendraaiend', 'rechtsbuitendraaiend', 'R4'
    ) buiten
    WHERE @isBinnen = false AND @isSet;
    2,8500650,000012
    [RenderValues] Do last replacements. Num items: 02,8500750,000011
    [RenderValues] replacements done2,8500820,000007
    RenderSubStep Kies een draairichting (binnen) connected to: draairichting - mainstepnumber: 2 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: draairichting2,8500980,000015
    No caching of lanuage 38. Because it is not changed within this session.2,8503770,000280
    Cache item 'ML_38' already exists, so language is not cached again2,8504110,000033
    Session 'MlJclLanguage' set to 382,8504360,000026
    Start replace dynamic content2,8504680,000031
    Replace dynamic content only once2,8505840,000116
    End replace dynamic content2,8505970,000013
    Filled translationcomponent from cache.2,8511890,000592
    RenderStep Bepaal de afmeting connected to: deurtype;uitvoering;draairichting - mainstepnumber: 2 - stepnumber: 2 - dependentvalue: 1 - datasource connectedid: deurtype;uitvoering;draairichting2,8771250,025936
    [RenderValues] set query and/or replacements2,8771740,000049
    [RenderValues] Execute query2,8777780,000604
    query cachinghours: 2002,8778660,000088
    QUERY SYSCON START: SET @doorChoice = IF('{deurtype}' LIKE '{%}', '0,0,0', '{deurtype}');
    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @turnType = '{draairichting}';
    SET @implementation = IF('{uitvoering}' IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}');
    SET @implementation = IF(@implementation='opdek', CONCAT(@implementation, ' ', @turnType) , @implementation);

    SET @turnDirection = IF(@turnType IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));


    SELECT
    DISTINCT(door.height) AS hoogte, 0 AS isAllInclusive
    FROM shop_products door
    JOIN shop_pro_cat spc ON spc.product_id = door.id
    JOIN shop_category doorCat ON doorCat.id = spc.cat_id AND doorCat.parent_cat_id=2289 AND doorCat.id=@doorCat AND doorCat.visiblecando<>0

    LEFT JOIN shop_products glass_org ON glass_org.id=@doorGlass
    LEFT JOIN shop_products glass_avail ON glass_avail.description_short=glass_org.description_short AND glass_avail.visiblecando<>0
    LEFT JOIN shop_koppeling k ON k.prod_dest=door.id AND k.prod_source=glass_avail.id

    WHERE  (FIND_IN_SET(@implementationDirect, door.producttype) OR (FIND_IN_SET(@implementation, door.producttype)))
    AND IF(@doorGlass > 0, k.id IS NOT NULL, 1)
    AND door.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', door.visiblecando, door.visiblecandoBranch) <> 0
    ORDER BY door.height;



    /*
    #SET @doorCat = 2342;#'1';
    SET @doorChoice = IF('{deurtype}' LIKE '{%}', '0,0,0', '{deurtype}');
    SET @doorCat =   CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    #SET @turnType = '{draairichting}';
    #SET @implementation = IF('{uitvoering}' IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}');
    #SET @implementation = IF(@implementation='opdek', CONCAT(@implementation, ' ', @turnType) , @implementation);

    #SET @glassCat = (SELECT cat_id FROM shop_pro_cat WHERE product_id=@doorGlass LIMIT 1);

    SELECT DISTINCT(door.height) AS hoogte
    FROM shop_products door
    JOIN shop_pro_cat spc ON spc.product_id=door.id
    JOIN shop_category doorCat ON doorCat.id=spc.cat_id AND doorCat.parent_cat_id=2289 AND doorCat.id=@doorCat AND doorCat.visiblecando<>0

    LEFT JOIN shop_products glass_org ON glass_org.id=@doorGlass
    LEFT JOIN shop_products glass_avail ON glass_avail.description_short=glass_org.description_short AND glass_avail .visiblecando<>0
    LEFT JOIN shop_koppeling k ON k.prod_dest=door.id AND k.prod_source=glass_avail.id

    #LEFT JOIN shop_pro_cat spk ON spk.cat_id=@glassCat
    #LEFT JOIN shop_koppeling k ON k.prod_dest=door.id AND k.prod_source=spk.product_id

    WHERE IF(@doorGlass > 0, k.id IS NOT NULL, 1)
    #AND (door.producttype = @implementation OR door.producttype = CONCAT(@implementation, ' ', @turnType))
    #AND door.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', door.visiblecando, door.visiblecandoBranch) <> 0
    ORDER BY door.height

    / *
    SET @doorCat = '1';

    SELECT DISTINCT(height) AS hoogte
    FROM shop_products door
    JOIN shop_pro_cat spc ON spc.product_id = door.id
    JOIN shop_category doorCat ON doorCat.id = spc.cat_id
    WHERE doorCat.parent_cat_id=2289 AND doorCat.id = @doorCat
    AND door.visiblecando<>0
    AND doorCat.visiblecando<>0
    ORDER BY height
    */
    2,8778880,000023
    Open connection with DB2,8779430,000055
    QUERY SYSCON END: SET @doorChoice = IF('{deurtype}' LIKE '{%}', '0,0,0', '{deurtype}');
    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @turnType = '{draairichting}';
    SET @implementation = IF('{uitvoering}' IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}');
    SET @implementation = IF(@implementation='opdek', CONCAT(@implementation, ' ', @turnType) , @implementation);

    SET @turnDirection = IF(@turnType IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));


    SELECT
    DISTINCT(door.height) AS hoogte, 0 AS isAllInclusive
    FROM shop_products door
    JOIN shop_pro_cat spc ON spc.product_id = door.id
    JOIN shop_category doorCat ON doorCat.id = spc.cat_id AND doorCat.parent_cat_id=2289 AND doorCat.id=@doorCat AND doorCat.visiblecando<>0

    LEFT JOIN shop_products glass_org ON glass_org.id=@doorGlass
    LEFT JOIN shop_products glass_avail ON glass_avail.description_short=glass_org.description_short AND glass_avail.visiblecando<>0
    LEFT JOIN shop_koppeling k ON k.prod_dest=door.id AND k.prod_source=glass_avail.id

    WHERE  (FIND_IN_SET(@implementationDirect, door.producttype) OR (FIND_IN_SET(@implementation, door.producttype)))
    AND IF(@doorGlass > 0, k.id IS NOT NULL, 1)
    AND door.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', door.visiblecando, door.visiblecandoBranch) <> 0
    ORDER BY door.height;



    /*
    #SET @doorCat = 2342;#'1';
    SET @doorChoice = IF('{deurtype}' LIKE '{%}', '0,0,0', '{deurtype}');
    SET @doorCat =   CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    #SET @turnType = '{draairichting}';
    #SET @implementation = IF('{uitvoering}' IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}');
    #SET @implementation = IF(@implementation='opdek', CONCAT(@implementation, ' ', @turnType) , @implementation);

    #SET @glassCat = (SELECT cat_id FROM shop_pro_cat WHERE product_id=@doorGlass LIMIT 1);

    SELECT DISTINCT(door.height) AS hoogte
    FROM shop_products door
    JOIN shop_pro_cat spc ON spc.product_id=door.id
    JOIN shop_category doorCat ON doorCat.id=spc.cat_id AND doorCat.parent_cat_id=2289 AND doorCat.id=@doorCat AND doorCat.visiblecando<>0

    LEFT JOIN shop_products glass_org ON glass_org.id=@doorGlass
    LEFT JOIN shop_products glass_avail ON glass_avail.description_short=glass_org.description_short AND glass_avail .visiblecando<>0
    LEFT JOIN shop_koppeling k ON k.prod_dest=door.id AND k.prod_source=glass_avail.id

    #LEFT JOIN shop_pro_cat spk ON spk.cat_id=@glassCat
    #LEFT JOIN shop_koppeling k ON k.prod_dest=door.id AND k.prod_source=spk.product_id

    WHERE IF(@doorGlass > 0, k.id IS NOT NULL, 1)
    #AND (door.producttype = @implementation OR door.producttype = CONCAT(@implementation, ' ', @turnType))
    #AND door.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', door.visiblecando, door.visiblecandoBranch) <> 0
    ORDER BY door.height

    / *
    SET @doorCat = '1';

    SELECT DISTINCT(height) AS hoogte
    FROM shop_products door
    JOIN shop_pro_cat spc ON spc.product_id = door.id
    JOIN shop_category doorCat ON doorCat.id = spc.cat_id
    WHERE doorCat.parent_cat_id=2289 AND doorCat.id = @doorCat
    AND door.visiblecando<>0
    AND doorCat.visiblecando<>0
    ORDER BY height
    */
    2,8960540,018111
    [RenderValues] Do last replacements. Num items: 02,8961020,000048
    [RenderValues] replacements done2,8961140,000012
    RenderStep (values rendered) Bepaal de afmeting connected to: deurtype;uitvoering;draairichting - mainstepnumber: 2 - stepnumber: 2 - dependentvalue: 1 - datasource connectedid: deurtype;uitvoering;draairichting2,8961510,000037
    [RenderValues] set query and/or replacements2,8962150,000064
    [RenderValues] Execute query2,8967330,000517
    query cachinghours: 2002,8968400,000108
    QUERY SYSCON START: SET @doorChoice = IF('{deurtype}' LIKE '{%}', '0,0,0', '{deurtype}');
    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @turnType = '{draairichting}';
    SET @implementation = IF('{uitvoering}' IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}');
    SET @implementation = IF(@implementation='opdek', CONCAT(@implementation, ' ', @turnType) , @implementation);
    SET @turnDirection = IF(@turnType IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));

    SELECT
    DISTINCT(door.width) AS breedte
    FROM shop_products door
    JOIN shop_pro_cat spc ON spc.product_id = door.id
    JOIN shop_category doorCat ON doorCat.id = spc.cat_id AND doorCat.parent_cat_id=2289 AND doorCat.id=@doorCat AND doorCat.visiblecando<>0

    LEFT JOIN shop_products glass_org ON glass_org.id=@doorGlass
    LEFT JOIN shop_products glass_avail ON glass_avail.description_short=glass_org.description_short AND glass_avail .visiblecando<>0
    LEFT JOIN shop_koppeling k ON k.prod_dest=door.id AND k.prod_source=glass_avail.id

    #WHERE  (door.producttype = @implementation OR door.producttype = CONCAT(@implementation, ' ', @turnType))
    WHERE  (FIND_IN_SET(@implementationDirect, door.producttype) OR (FIND_IN_SET(@implementation, door.producttype)))
    AND IF(@doorGlass > 0, k.id IS NOT NULL, 1)
    AND door.height='{height}'
    #AND door.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', door.visiblecando, door.visiblecandoBranch) <> 0
    ORDER BY door.width
    2,8968720,000031
    Open connection with DB2,8969150,000043
    QUERY SYSCON END: SET @doorChoice = IF('{deurtype}' LIKE '{%}', '0,0,0', '{deurtype}');
    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @turnType = '{draairichting}';
    SET @implementation = IF('{uitvoering}' IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}');
    SET @implementation = IF(@implementation='opdek', CONCAT(@implementation, ' ', @turnType) , @implementation);
    SET @turnDirection = IF(@turnType IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));

    SELECT
    DISTINCT(door.width) AS breedte
    FROM shop_products door
    JOIN shop_pro_cat spc ON spc.product_id = door.id
    JOIN shop_category doorCat ON doorCat.id = spc.cat_id AND doorCat.parent_cat_id=2289 AND doorCat.id=@doorCat AND doorCat.visiblecando<>0

    LEFT JOIN shop_products glass_org ON glass_org.id=@doorGlass
    LEFT JOIN shop_products glass_avail ON glass_avail.description_short=glass_org.description_short AND glass_avail .visiblecando<>0
    LEFT JOIN shop_koppeling k ON k.prod_dest=door.id AND k.prod_source=glass_avail.id

    #WHERE  (door.producttype = @implementation OR door.producttype = CONCAT(@implementation, ' ', @turnType))
    WHERE  (FIND_IN_SET(@implementationDirect, door.producttype) OR (FIND_IN_SET(@implementation, door.producttype)))
    AND IF(@doorGlass > 0, k.id IS NOT NULL, 1)
    AND door.height='{height}'
    #AND door.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', door.visiblecando, door.visiblecandoBranch) <> 0
    ORDER BY door.width
    2,9135570,016642
    [RenderValues] Do last replacements. Num items: 02,9136040,000048
    [RenderValues] replacements done2,9136150,000010
    RenderSubStep Breedte connected to: hoogte;uitvoering;draairichting - mainstepnumber: 2 - stepnumber: 2 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: hoogte;uitvoering;draairichting2,9136480,000034
    No caching of lanuage 38. Because it is not changed within this session.2,9138830,000234
    Cache item 'ML_38' already exists, so language is not cached again2,9138970,000015
    Session 'MlJclLanguage' set to 382,9139100,000013
    Start replace dynamic content2,9139430,000033
    Replace dynamic content only once2,9139970,000054
    End replace dynamic content2,9140030,000007
    Filled translationcomponent from cache.2,9144000,000397
    No caching of lanuage 38. Because it is not changed within this session.2,9407550,026355
    Cache item 'ML_38' already exists, so language is not cached again2,9408390,000085
    Session 'MlJclLanguage' set to 382,9408510,000012
    Start replace dynamic content2,9408970,000046
    Replace dynamic content only once2,9409970,000099
    End replace dynamic content2,9410060,000009
    Filled translationcomponent from cache.2,9415670,000562
    [RenderValues] set query and/or replacements2,9706350,029067
    [RenderValues] Execute query2,9712900,000655
    query cachinghours: 2002,9714040,000114
    query from cache 'JCLDCc39abe028994805ccd6c94d8c410e1d9'2,9714240,000020
    QUERY SYSCON END (FROM CACHE): SET @doorChoice = IF('{deurtype}' LIKE '{%}', '0,0,0', '{deurtype}');
    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @turnType = '{draairichting}';
    SET @implementation = IF('{uitvoering}' IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}');
    SET @implementation = IF(@implementation='opdek', CONCAT(@implementation, ' ', @turnType) , @implementation);
    SET @turnDirection = IF(@turnType IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));

    SELECT
    DISTINCT(door.width) AS breedte
    FROM shop_products door
    JOIN shop_pro_cat spc ON spc.product_id = door.id
    JOIN shop_category doorCat ON doorCat.id = spc.cat_id AND doorCat.parent_cat_id=2289 AND doorCat.id=@doorCat AND doorCat.visiblecando<>0

    LEFT JOIN shop_products glass_org ON glass_org.id=@doorGlass
    LEFT JOIN shop_products glass_avail ON glass_avail.description_short=glass_org.description_short AND glass_avail .visiblecando<>0
    LEFT JOIN shop_koppeling k ON k.prod_dest=door.id AND k.prod_source=glass_avail.id

    #WHERE  (door.producttype = @implementation OR door.producttype = CONCAT(@implementation, ' ', @turnType))
    WHERE  (FIND_IN_SET(@implementationDirect, door.producttype) OR (FIND_IN_SET(@implementation, door.producttype)))
    AND IF(@doorGlass > 0, k.id IS NOT NULL, 1)
    AND door.height='{height}'
    #AND door.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', door.visiblecando, door.visiblecandoBranch) <> 0
    ORDER BY door.width
    2,9714440,000020
    [RenderValues] Do last replacements. Num items: 02,9714560,000012
    [RenderValues] replacements done2,9714640,000008
    RenderSubStep Breedte connected to: hoogte;uitvoering;draairichting - mainstepnumber: 2 - stepnumber: 2 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: hoogte;uitvoering;draairichting2,9714810,000017
    No caching of lanuage 38. Because it is not changed within this session.2,9717200,000240
    Cache item 'ML_38' already exists, so language is not cached again2,9717370,000017
    Session 'MlJclLanguage' set to 382,9717480,000011
    Start replace dynamic content2,9717700,000022
    Replace dynamic content only once2,9718300,000060
    End replace dynamic content2,9718360,000006
    Filled translationcomponent from cache.2,9722220,000386
    QUERY SYSCON START:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    2,9981990,025977
    Open connection with DB2,9983360,000137
    QUERY SYSCON END:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    3,0352640,036927
    RenderStep Draairaamset connected to: deurtype;draairichting;draairichtingsub;hoogte;breedte - mainstepnumber: 3 - stepnumber: 1 - dependentvalue: 1 - datasource connectedid: deurtype;draairichting;draairichtingsub;hoogte;breedte3,0369730,001710
    [RenderValues] set query and/or replacements3,0370090,000036
    [RenderValues] Execute query3,0374390,000430
    query cachinghours: 2003,0375250,000086
    QUERY SYSCON START: /* STEP LOGIC:
    This step should only be showed if the door is of type "roosterdeur".
    Than it should show the multiple options
    But the options must be connected to the door to show them.
    */

    # Variables
    SET @doorChoice = IF('{deurtype}' LIKE '{%}', '0,0,0', '{deurtype}');
    SET @_uitvoering = 'Stomp'; #'{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = '{height}';
    SET @_width = '{width}';

    #options
    SET @_connectionType = 'Draairaamset';
    SET @_doorType = NULL;#'Roosterdeur';
    SET @_presetGlassType = 'Rooster';

    # Get door
    SET @doorCat =     CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);

    SET @implementation = IF(@_uitvoering IN('Binnendraaiend', 'Buitendraaiend'), 'stomp', @_uitvoering);
    SET @turntype = IF(@_draairichting LIKE '{%}', '',@_draairichting);
    SET @implementationTest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turntype,'%'), CONCAT('%',@implementation,'%')));
    SET @doorId = (SELECT p.id FROM shop_products p JOIN shop_pro_cat parent ON parent.product_id=p.id AND parent.cat_id=@doorCat WHERE p.height=@_height AND p.width=@_width AND p.producttype LIKE @implementationTest LIMIT 1);

    SELECT
    product.id AS productId,
    product.description_short AS valueName,
    product.description_short AS description,
       img.bestandsnaam AS afbeeldingUrl,
       REPLACE(img.bestandsnaam, 'normaal', 'vergroting') AS afbeeldingUrlGroot
    FROM shop_products product
    JOIN shop_products door ON door.id=@doorId
    JOIN shop_pro_cat door2cat ON door2cat.product_id=door.id
    JOIN shop_category doorCat ON doorCat.id=door2cat.cat_id AND IF(@_doorType IS NOT NULL, doorCat.doortype=@_doorType, 1)AND IF(@_presetGlassType IS NOT NULL, doorCat.preconfigured_glass=@_presetGlassType, 1)
    JOIN shop_koppeling product2door ON product2door.prod_source=product.id AND product2door.prod_dest=door.id AND IF(@_connectionType IS NOT NULL, product2door.koppeltype=@_connectionType, 1)
    LEFT JOIN shop_pictures img ON img.product_id=product.id AND img.formaatnaam='normaal'
    WHERE 1
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', product.visiblecando, product.visiblecandoBranch) <> 0
    3,0375570,000032
    Open connection with DB3,0375950,000038
    QUERY SYSCON END: /* STEP LOGIC:
    This step should only be showed if the door is of type "roosterdeur".
    Than it should show the multiple options
    But the options must be connected to the door to show them.
    */

    # Variables
    SET @doorChoice = IF('{deurtype}' LIKE '{%}', '0,0,0', '{deurtype}');
    SET @_uitvoering = 'Stomp'; #'{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = '{height}';
    SET @_width = '{width}';

    #options
    SET @_connectionType = 'Draairaamset';
    SET @_doorType = NULL;#'Roosterdeur';
    SET @_presetGlassType = 'Rooster';

    # Get door
    SET @doorCat =     CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);

    SET @implementation = IF(@_uitvoering IN('Binnendraaiend', 'Buitendraaiend'), 'stomp', @_uitvoering);
    SET @turntype = IF(@_draairichting LIKE '{%}', '',@_draairichting);
    SET @implementationTest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turntype,'%'), CONCAT('%',@implementation,'%')));
    SET @doorId = (SELECT p.id FROM shop_products p JOIN shop_pro_cat parent ON parent.product_id=p.id AND parent.cat_id=@doorCat WHERE p.height=@_height AND p.width=@_width AND p.producttype LIKE @implementationTest LIMIT 1);

    SELECT
    product.id AS productId,
    product.description_short AS valueName,
    product.description_short AS description,
       img.bestandsnaam AS afbeeldingUrl,
       REPLACE(img.bestandsnaam, 'normaal', 'vergroting') AS afbeeldingUrlGroot
    FROM shop_products product
    JOIN shop_products door ON door.id=@doorId
    JOIN shop_pro_cat door2cat ON door2cat.product_id=door.id
    JOIN shop_category doorCat ON doorCat.id=door2cat.cat_id AND IF(@_doorType IS NOT NULL, doorCat.doortype=@_doorType, 1)AND IF(@_presetGlassType IS NOT NULL, doorCat.preconfigured_glass=@_presetGlassType, 1)
    JOIN shop_koppeling product2door ON product2door.prod_source=product.id AND product2door.prod_dest=door.id AND IF(@_connectionType IS NOT NULL, product2door.koppeltype=@_connectionType, 1)
    LEFT JOIN shop_pictures img ON img.product_id=product.id AND img.formaatnaam='normaal'
    WHERE 1
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', product.visiblecando, product.visiblecandoBranch) <> 0
    3,0577230,020128
    [RenderValues] Do last replacements. Num items: 03,0577730,000050
    [RenderValues] replacements done3,0577830,000010
    RenderStep (values rendered) Draairaamset connected to: deurtype;draairichting;draairichtingsub;hoogte;breedte - mainstepnumber: 3 - stepnumber: 1 - dependentvalue: 1 - datasource connectedid: deurtype;draairichting;draairichtingsub;hoogte;breedte3,0578290,000046
    [RenderValues] set query and/or replacements3,0578890,000060
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,0578970,000008
    No caching of lanuage 38. Because it is not changed within this session.3,0580920,000195
    Cache item 'ML_38' already exists, so language is not cached again3,0581180,000026
    Session 'MlJclLanguage' set to 383,0581300,000012
    Start replace dynamic content3,0581480,000018
    Replace dynamic content only once3,0582070,000060
    End replace dynamic content3,0582130,000006
    Filled translationcomponent from cache.3,0586240,000410
    No caching of lanuage 38. Because it is not changed within this session.3,0821570,023534
    Cache item 'ML_38' already exists, so language is not cached again3,0822210,000064
    Session 'MlJclLanguage' set to 383,0822300,000009
    Start replace dynamic content3,0822610,000031
    Replace dynamic content only once3,0823500,000089
    End replace dynamic content3,0823580,000009
    Filled translationcomponent from cache.3,0828440,000486
    [RenderValues] set query and/or replacements3,1104020,027558
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,1105400,000138
    No caching of lanuage 38. Because it is not changed within this session.3,1107280,000188
    Cache item 'ML_38' already exists, so language is not cached again3,1107510,000023
    Session 'MlJclLanguage' set to 383,1107590,000008
    Start replace dynamic content3,1107800,000021
    Replace dynamic content only once3,1108610,000081
    End replace dynamic content3,1108690,000008
    Filled translationcomponent from cache.3,1114840,000615
    RenderStep Veiligheidspakket connected to: uitvoering;draairichting;hoogte;breedte;draairaamset - mainstepnumber: 3 - stepnumber: 2 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte;draairaamset3,1413730,029889
    [RenderValues] set query and/or replacements3,1414260,000053
    [RenderValues] Execute query3,1419690,000543
    query cachinghours: 2003,1420670,000098
    QUERY SYSCON START: SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###

    SELECT
    @doorId,
    p.id AS product_id,
    p.eancode,
    p.description_short AS description_short,
    IFNULL(p.serie, p.producttype) AS name,
       REPLACE(REPLACE(p.pricecando, '.',','), ',00', ',-')  AS price,
    spk.cat_id,
    sp.bestandsnaam,
    REPLACE(sp.bestandsnaam, 'normaal', 'vergroting') AS afbeeldingUrlGroot,
    suitable_for,
    suitable_for2,
    IFNULL(CONCAT('<li>',REPLACE(p.usp_s, '\r\n', '</li><li>'),'</li>'),'') AS usps
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype = 'veiligheidspakket'
    JOIN shop_pro_cat spk ON spk.product_id=p.id
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'
    WHERE IFNULL(p.serie, p.producttype) = 'Veiligheidspakket'
    AND ( NULLIF(suitable_for2,'') IS NULL
    OR suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(@implementation, 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
    (suitable_for IS NULL OR suitable_for = 'ALLE' OR
    '{draairichting}' LIKE CONCAT('%', suitable_for , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = '{draairichting}') LIKE CONCAT('%', suitable_for , '%')
    )
    )
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    ORDER BY name
    3,1420900,000023
    Open connection with DB3,1421400,000050
    QUERY SYSCON END: SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###

    SELECT
    @doorId,
    p.id AS product_id,
    p.eancode,
    p.description_short AS description_short,
    IFNULL(p.serie, p.producttype) AS name,
       REPLACE(REPLACE(p.pricecando, '.',','), ',00', ',-')  AS price,
    spk.cat_id,
    sp.bestandsnaam,
    REPLACE(sp.bestandsnaam, 'normaal', 'vergroting') AS afbeeldingUrlGroot,
    suitable_for,
    suitable_for2,
    IFNULL(CONCAT('<li>',REPLACE(p.usp_s, '\r\n', '</li><li>'),'</li>'),'') AS usps
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype = 'veiligheidspakket'
    JOIN shop_pro_cat spk ON spk.product_id=p.id
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'
    WHERE IFNULL(p.serie, p.producttype) = 'Veiligheidspakket'
    AND ( NULLIF(suitable_for2,'') IS NULL
    OR suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(@implementation, 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
    (suitable_for IS NULL OR suitable_for = 'ALLE' OR
    '{draairichting}' LIKE CONCAT('%', suitable_for , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = '{draairichting}') LIKE CONCAT('%', suitable_for , '%')
    )
    )
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    ORDER BY name
    3,1687060,026566
    [RenderValues] Do last replacements. Num items: 03,1687620,000056
    [RenderValues] replacements done3,1687720,000010
    RenderStep (values rendered) Veiligheidspakket connected to: uitvoering;draairichting;hoogte;breedte;draairaamset - mainstepnumber: 3 - stepnumber: 2 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte;draairaamset3,1688260,000055
    [RenderValues] set query and/or replacements3,1689060,000080
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 2 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,1689190,000014
    No caching of lanuage 38. Because it is not changed within this session.3,1691740,000255
    Cache item 'ML_38' already exists, so language is not cached again3,1691940,000020
    Session 'MlJclLanguage' set to 383,1692070,000012
    Start replace dynamic content3,1692400,000033
    Replace dynamic content only once3,1693260,000086
    End replace dynamic content3,1693360,000010
    Filled translationcomponent from cache.3,1700800,000745
    No caching of lanuage 38. Because it is not changed within this session.3,1958690,025789
    Cache item 'ML_38' already exists, so language is not cached again3,1959390,000070
    Session 'MlJclLanguage' set to 383,1959520,000014
    Start replace dynamic content3,1959930,000041
    Replace dynamic content only once3,1960780,000085
    End replace dynamic content3,1960850,000007
    Filled translationcomponent from cache.3,1965810,000496
    [RenderValues] set query and/or replacements3,2211950,024615
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 2 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,2212540,000058
    No caching of lanuage 38. Because it is not changed within this session.3,2214680,000215
    Cache item 'ML_38' already exists, so language is not cached again3,2215040,000035
    Session 'MlJclLanguage' set to 383,2215170,000014
    Start replace dynamic content3,2215520,000034
    Replace dynamic content only once3,2216330,000082
    End replace dynamic content3,2216400,000006
    Filled translationcomponent from cache.3,2220680,000429
    RenderStep Driepuntssluiting (alleen bij geen veiligheidspakket) connected to: veiligheidspakket;draairaamset - mainstepnumber: 3 - stepnumber: 3 - dependentvalue: 1 - datasource connectedid: veiligheidspakket;draairaamset3,2458380,023769
    [RenderValues] set query and/or replacements3,2458910,000054
    [RenderValues] Execute query3,2463720,000481
    query cachinghours: 2003,2464540,000082
    QUERY SYSCON START: SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    SET @isIndustrial = (SELECT IF(COUNT(*)>0,true,false) FROM shop_category WHERE id=@doorCat AND style LIKE '%industrial%');
    SET @isDouble = IF('{dubbel}' = 'Ja', true, false);
    SET @results = false;

    SELECT * FROM (
    SELECT 'Geen driepuntsluiting' AS valuelist_1, 0 AS valuelist_2, 0 AS valuelist_3, 0 AS result

    UNION

    SELECT
    /*IF(p.serie LIKE '%sleutel%','Sleutelbediend','Krukbediend')*/p.description_short,
    IF(p.serie LIKE '%sleutel%','sleutelbediend','krukbediend'),
    p.id,
    GREATEST(@results := true, -1) AS result
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_source=p.id AND k.prod_dest = @doorId AND k.koppeltype = 'Driepuntssluiting'
    WHERE ( NULLIF(suitable_for2,'') IS NULL
    OR suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(@implementation, 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
     (suitable_for IS NULL OR suitable_for = 'ALLE' OR
    REPLACE(REPLACE('{draairichting}', 'links', 'R2/L3'), 'rechts', 'L1/R4') LIKE CONCAT('%', suitable_for , '%')
    OR
    #inverted
    suitable_for LIKE CONCAT('%', REPLACE(REPLACE('{draairichting}', 'links', 'R2/L3'), 'rechts', 'L1/R4') , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = '{draairichting}') LIKE CONCAT('%', suitable_for , '%')
    )
    )  
    #AND p.visiblecando<>0
       AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    GROUP BY p.id
    ) res
    WHERE IF('{veiligheidspakketJanee}' = '', '', '{veiligheidspakketJanee}') ='Nee' AND @results
    3,2464810,000028
    Open connection with DB3,2465380,000057
    QUERY SYSCON END: SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    SET @isIndustrial = (SELECT IF(COUNT(*)>0,true,false) FROM shop_category WHERE id=@doorCat AND style LIKE '%industrial%');
    SET @isDouble = IF('{dubbel}' = 'Ja', true, false);
    SET @results = false;

    SELECT * FROM (
    SELECT 'Geen driepuntsluiting' AS valuelist_1, 0 AS valuelist_2, 0 AS valuelist_3, 0 AS result

    UNION

    SELECT
    /*IF(p.serie LIKE '%sleutel%','Sleutelbediend','Krukbediend')*/p.description_short,
    IF(p.serie LIKE '%sleutel%','sleutelbediend','krukbediend'),
    p.id,
    GREATEST(@results := true, -1) AS result
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_source=p.id AND k.prod_dest = @doorId AND k.koppeltype = 'Driepuntssluiting'
    WHERE ( NULLIF(suitable_for2,'') IS NULL
    OR suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(@implementation, 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
     (suitable_for IS NULL OR suitable_for = 'ALLE' OR
    REPLACE(REPLACE('{draairichting}', 'links', 'R2/L3'), 'rechts', 'L1/R4') LIKE CONCAT('%', suitable_for , '%')
    OR
    #inverted
    suitable_for LIKE CONCAT('%', REPLACE(REPLACE('{draairichting}', 'links', 'R2/L3'), 'rechts', 'L1/R4') , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = '{draairichting}') LIKE CONCAT('%', suitable_for , '%')
    )
    )  
    #AND p.visiblecando<>0
       AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    GROUP BY p.id
    ) res
    WHERE IF('{veiligheidspakketJanee}' = '', '', '{veiligheidspakketJanee}') ='Nee' AND @results
    3,2709000,024361
    [RenderValues] Do last replacements. Num items: 03,2709670,000068
    [RenderValues] replacements done3,2709750,000008
    RenderStep (values rendered) Driepuntssluiting (alleen bij geen veiligheidspakket) connected to: veiligheidspakket;draairaamset - mainstepnumber: 3 - stepnumber: 3 - dependentvalue: 1 - datasource connectedid: veiligheidspakket;draairaamset3,2710070,000032
    [RenderValues] set query and/or replacements3,2710700,000063
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 3 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,2710780,000008
    No caching of lanuage 38. Because it is not changed within this session.3,2712770,000199
    Cache item 'ML_38' already exists, so language is not cached again3,2712930,000016
    Session 'MlJclLanguage' set to 383,2713010,000008
    Start replace dynamic content3,2713190,000018
    Replace dynamic content only once3,2713860,000067
    End replace dynamic content3,2714050,000020
    Filled translationcomponent from cache.3,2719320,000527
    No caching of lanuage 38. Because it is not changed within this session.3,2991560,027224
    Cache item 'ML_38' already exists, so language is not cached again3,2992250,000069
    Session 'MlJclLanguage' set to 383,2992340,000010
    Start replace dynamic content3,2992680,000034
    Replace dynamic content only once3,2993610,000092
    End replace dynamic content3,2993690,000008
    Filled translationcomponent from cache.3,2998710,000503
    [RenderValues] set query and/or replacements3,3245740,024703
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 3 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,3246420,000067
    No caching of lanuage 38. Because it is not changed within this session.3,3248460,000205
    Cache item 'ML_38' already exists, so language is not cached again3,3248880,000042
    Session 'MlJclLanguage' set to 383,3249040,000016
    Start replace dynamic content3,3249310,000027
    Replace dynamic content only once3,3250190,000088
    End replace dynamic content3,3250290,000010
    Filled translationcomponent from cache.3,3255460,000517
    RenderStep Slotgatfrezing (bij geen driepuntsluiting) nieuw connected to: uitvoering;draairichting;driepuntsluiting;veiligheidspakket - mainstepnumber: 3 - stepnumber: 4 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;driepuntsluiting;veiligheidspakket3,3557440,030198
    [RenderValues] set query and/or replacements3,3558260,000082
    [RenderValues] Execute query3,3565370,000711
    query cachinghours: 2003,3566480,000111
    QUERY SYSCON START: SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###
    SET @isIndustrial = (SELECT IF(COUNT(*)>0,true,false) FROM shop_category WHERE id=@doorCat AND style LIKE '%industrial%');
    SET @isDouble = IF('{dubbel}' = 'Ja', true, false);

    SELECT
    @doorId,
    IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%', '2x ','') AS ammountPrefix,
    IFNULL(info.html, '') AS info,
    p.id AS product_id,
       CONCAT(IF(@isDouble, ' ', ''), p.description_short) AS product_description,
    IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', ''))) AS product_name,
       REPLACE(REPLACE(p.pricecando * IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%',2,1), '.',','), ',00', ',-')  AS price,
       'images/prod-scharnieren.png' AS product_image,
    spk.cat_id,
    IFNULL(sp.bestandsnaam, '') AS bestandsnaam,
    p.suitable_for,
    p.suitable_for2
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype = 'service'
    JOIN shop_pro_cat spk ON spk.product_id=p.id #AND spk.cat_id IN(2386)# CAT (accessoires)
    LEFT JOIN easy_webpages info ON info.seoname = CONCAT('uitleg-', IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', ''))))
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'

    WHERE ( NULLIF(suitable_for2,'') IS NULL
    OR suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(@implementation, 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
     (suitable_for IS NULL OR suitable_for = 'ALLE' OR
    REPLACE(REPLACE('{draairichting}', 'links', 'R2/L3'), 'rechts', 'L1/R4') LIKE CONCAT('%', suitable_for , '%')
    OR
    #inverted
    suitable_for LIKE CONCAT('%', REPLACE(REPLACE('{draairichting}', 'links', 'R2/L3'), 'rechts', 'L1/R4') , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = '{draairichting}') LIKE CONCAT('%', suitable_for , '%')
    )
    )   AND  '{veiligheidspakketJanee}' = 'Nee'  AND '{driepuntssluiting}' = '0' AND  p.producttype='slotgatfrezing'
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    GROUP BY p.id
    ORDER BY product_name
    3,3566880,000041
    Open connection with DB3,3567770,000089
    QUERY SYSCON END: SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###
    SET @isIndustrial = (SELECT IF(COUNT(*)>0,true,false) FROM shop_category WHERE id=@doorCat AND style LIKE '%industrial%');
    SET @isDouble = IF('{dubbel}' = 'Ja', true, false);

    SELECT
    @doorId,
    IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%', '2x ','') AS ammountPrefix,
    IFNULL(info.html, '') AS info,
    p.id AS product_id,
       CONCAT(IF(@isDouble, ' ', ''), p.description_short) AS product_description,
    IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', ''))) AS product_name,
       REPLACE(REPLACE(p.pricecando * IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%',2,1), '.',','), ',00', ',-')  AS price,
       'images/prod-scharnieren.png' AS product_image,
    spk.cat_id,
    IFNULL(sp.bestandsnaam, '') AS bestandsnaam,
    p.suitable_for,
    p.suitable_for2
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype = 'service'
    JOIN shop_pro_cat spk ON spk.product_id=p.id #AND spk.cat_id IN(2386)# CAT (accessoires)
    LEFT JOIN easy_webpages info ON info.seoname = CONCAT('uitleg-', IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', ''))))
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'

    WHERE ( NULLIF(suitable_for2,'') IS NULL
    OR suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(@implementation, 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
     (suitable_for IS NULL OR suitable_for = 'ALLE' OR
    REPLACE(REPLACE('{draairichting}', 'links', 'R2/L3'), 'rechts', 'L1/R4') LIKE CONCAT('%', suitable_for , '%')
    OR
    #inverted
    suitable_for LIKE CONCAT('%', REPLACE(REPLACE('{draairichting}', 'links', 'R2/L3'), 'rechts', 'L1/R4') , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = '{draairichting}') LIKE CONCAT('%', suitable_for , '%')
    )
    )   AND  '{veiligheidspakketJanee}' = 'Nee'  AND '{driepuntssluiting}' = '0' AND  p.producttype='slotgatfrezing'
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    GROUP BY p.id
    ORDER BY product_name
    3,3817920,025015
    [RenderValues] Do last replacements. Num items: 03,3818450,000053
    [RenderValues] replacements done3,3818520,000006
    RenderStep (values rendered) Slotgatfrezing (bij geen driepuntsluiting) nieuw connected to: uitvoering;draairichting;driepuntsluiting;veiligheidspakket - mainstepnumber: 3 - stepnumber: 4 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;driepuntsluiting;veiligheidspakket3,3818870,000036
    [RenderValues] set query and/or replacements3,3819550,000068
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 4 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,3819690,000014
    No caching of lanuage 38. Because it is not changed within this session.3,3821420,000173
    Cache item 'ML_38' already exists, so language is not cached again3,3821580,000016
    Session 'MlJclLanguage' set to 383,3821660,000009
    Start replace dynamic content3,3821830,000017
    Replace dynamic content only once3,3822360,000053
    End replace dynamic content3,3822430,000008
    Filled translationcomponent from cache.3,3827550,000511
    No caching of lanuage 38. Because it is not changed within this session.3,4098400,027085
    Cache item 'ML_38' already exists, so language is not cached again3,4099180,000078
    Session 'MlJclLanguage' set to 383,4099300,000012
    Start replace dynamic content3,4099640,000034
    Replace dynamic content only once3,4100380,000074
    End replace dynamic content3,4100440,000006
    Filled translationcomponent from cache.3,4104590,000415
    [RenderValues] set query and/or replacements3,4336030,023144
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 4 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,4336660,000063
    No caching of lanuage 38. Because it is not changed within this session.3,4339510,000285
    Cache item 'ML_38' already exists, so language is not cached again3,4339840,000033
    Session 'MlJclLanguage' set to 383,4339970,000013
    Start replace dynamic content3,4340220,000025
    Replace dynamic content only once3,4341270,000105
    End replace dynamic content3,4341360,000009
    Filled translationcomponent from cache.3,4346770,000541
    RenderStep Brievenbuspakket connected to: veiligheidspakket - mainstepnumber: 3 - stepnumber: 5 - dependentvalue: 1 - datasource connectedid: veiligheidspakket3,4593110,024634
    [RenderValues] set query and/or replacements3,4593590,000048
    [RenderValues] Execute query3,4598400,000481
    query cachinghours: 2003,4599240,000084
    QUERY SYSCON START:
    SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###

    # uitvoering
    SET @securityPackageVersion = (SELECT version FROM shop_products WHERE eancode='{veiligheidspakketSerie}' AND version <> '');

    SELECT
    @doorId,
    p.id AS product_id,
        p.eancode,
         p.description_short AS description_short,
    IFNULL(p.serie, p.producttype) AS name,
       REPLACE(REPLACE(p.pricecando, '.',','), ',00', ',-')  AS price,
    spk.cat_id,
    sp.bestandsnaam,
    suitable_for,
    suitable_for2
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype = 'brievenbuspakket'
    JOIN shop_pro_cat spk ON spk.product_id=p.id
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'
    WHERE /* IFNULL(p.serie, p.producttype) = 'brievenbuspakket'
    AND */ ( NULLIF(suitable_for2,'') IS NULL
    OR suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(@implementation, 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
    (suitable_for IS NULL OR suitable_for = 'ALLE' OR
    '{draairichting}' LIKE CONCAT('%', suitable_for , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = '{draairichting}') LIKE CONCAT('%', suitable_for , '%')
    )
    )
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0
    AND (@securityPackageVersion IS NULL /*OR p.version IS NULL */ OR p.version = @securityPackageVersion)
    GROUP BY p.id
    ORDER BY name
    3,4599500,000026
    Open connection with DB3,4600010,000051
    QUERY SYSCON END:
    SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###

    # uitvoering
    SET @securityPackageVersion = (SELECT version FROM shop_products WHERE eancode='{veiligheidspakketSerie}' AND version <> '');

    SELECT
    @doorId,
    p.id AS product_id,
        p.eancode,
         p.description_short AS description_short,
    IFNULL(p.serie, p.producttype) AS name,
       REPLACE(REPLACE(p.pricecando, '.',','), ',00', ',-')  AS price,
    spk.cat_id,
    sp.bestandsnaam,
    suitable_for,
    suitable_for2
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype = 'brievenbuspakket'
    JOIN shop_pro_cat spk ON spk.product_id=p.id
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'
    WHERE /* IFNULL(p.serie, p.producttype) = 'brievenbuspakket'
    AND */ ( NULLIF(suitable_for2,'') IS NULL
    OR suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(@implementation, 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
    (suitable_for IS NULL OR suitable_for = 'ALLE' OR
    '{draairichting}' LIKE CONCAT('%', suitable_for , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = '{draairichting}') LIKE CONCAT('%', suitable_for , '%')
    )
    )
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0
    AND (@securityPackageVersion IS NULL /*OR p.version IS NULL */ OR p.version = @securityPackageVersion)
    GROUP BY p.id
    ORDER BY name
    3,4980790,038078
    [RenderValues] Do last replacements. Num items: 03,4981240,000045
    [RenderValues] replacements done3,4981300,000006
    RenderStep (values rendered) Brievenbuspakket connected to: veiligheidspakket - mainstepnumber: 3 - stepnumber: 5 - dependentvalue: 1 - datasource connectedid: veiligheidspakket3,4981630,000033
    [RenderValues] set query and/or replacements3,4982290,000066
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 5 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,4982380,000009
    No caching of lanuage 38. Because it is not changed within this session.3,4984440,000206
    Cache item 'ML_38' already exists, so language is not cached again3,4984680,000024
    Session 'MlJclLanguage' set to 383,4984770,000009
    Start replace dynamic content3,4985010,000025
    Replace dynamic content only once3,4985780,000077
    End replace dynamic content3,4985850,000007
    Filled translationcomponent from cache.3,4990760,000491
    No caching of lanuage 38. Because it is not changed within this session.3,5246660,025590
    Cache item 'ML_38' already exists, so language is not cached again3,5247380,000072
    Session 'MlJclLanguage' set to 383,5247470,000009
    Start replace dynamic content3,5247800,000034
    Replace dynamic content only once3,5248670,000086
    End replace dynamic content3,5248730,000007
    Filled translationcomponent from cache.3,5252700,000396
    [RenderValues] set query and/or replacements3,5500360,024766
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 5 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,5500920,000056
    No caching of lanuage 38. Because it is not changed within this session.3,5502830,000192
    Cache item 'ML_38' already exists, so language is not cached again3,5503090,000026
    Session 'MlJclLanguage' set to 383,5503170,000008
    Start replace dynamic content3,5503350,000018
    Replace dynamic content only once3,5504040,000069
    End replace dynamic content3,5504110,000007
    Filled translationcomponent from cache.3,5508570,000447
    RenderStep Briefplaatfrezing connected to: brievenbuspakket - mainstepnumber: 3 - stepnumber: 6 - dependentvalue: 1 - datasource connectedid: brievenbuspakket3,5753610,024504
    [RenderValues] set query and/or replacements3,5754150,000055
    [RenderValues] Execute query3,5759310,000516
    query cachinghours: 2003,5760430,000112
    QUERY SYSCON START: SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###

    SET @isIndustrial = (SELECT IF(COUNT(*)>0,true,false) FROM shop_category WHERE id=@doorCat AND style LIKE '%industrial%');
    SET @isDouble = IF('{dubbel}' = 'Ja', true, false);


    SELECT
    @doorId,
    IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%', '2x ','') AS ammountPrefix,
    IFNULL(info.html, '') AS info,
    p.id AS product_id,
       CONCAT(IF(@isDouble, ' ', ''), p.description_short) AS product_description,
    LOWER(IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', '')))) AS product_name,
    REPLACE(REPLACE(p.pricecando * IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%',2,1), '.',','), ',00', ',-')  AS price,
       'images/prod-scharnieren.png' AS product_image,
    spk.cat_id,
    IFNULL(sp.bestandsnaam, '') AS bestandsnaam,
    p.suitable_for,
    p.suitable_for2
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype= 'service'
    JOIN shop_pro_cat spk ON spk.product_id=p.id #AND spk.cat_id IN(2386)# CAT (accessoires)
    LEFT JOIN easy_webpages info ON info.seoname = CONCAT('uitleg-', IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', ''))))
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'

    WHERE (NULLIF(p.suitable_for2,'') IS NULL
    OR p.suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(LOWER(@implementation), 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
     (p.suitable_for IS NULL OR p.suitable_for = 'ALLE' OR
    REPLACE(REPLACE(@turnDirection, 'links', 'R2/L3'), 'rechts', 'L1/R4') LIKE CONCAT('%', p.suitable_for , '%') OR
    # reversed
    p.suitable_for LIKE CONCAT('%', REPLACE(REPLACE(@turnDirection, 'links', 'R2/L3'), 'rechts', 'L1/R4') , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = @turnDirection) LIKE CONCAT('%', p.suitable_for , '%')
    )
    )  AND '{brievenbuspakketJanee}' = 'Nee' AND  p.producttype='briefplaatfrezing'
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    GROUP BY p.id
    ORDER BY product_name
    3,5760830,000040
    Open connection with DB3,5761540,000071
    QUERY SYSCON END: SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###

    SET @isIndustrial = (SELECT IF(COUNT(*)>0,true,false) FROM shop_category WHERE id=@doorCat AND style LIKE '%industrial%');
    SET @isDouble = IF('{dubbel}' = 'Ja', true, false);


    SELECT
    @doorId,
    IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%', '2x ','') AS ammountPrefix,
    IFNULL(info.html, '') AS info,
    p.id AS product_id,
       CONCAT(IF(@isDouble, ' ', ''), p.description_short) AS product_description,
    LOWER(IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', '')))) AS product_name,
    REPLACE(REPLACE(p.pricecando * IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%',2,1), '.',','), ',00', ',-')  AS price,
       'images/prod-scharnieren.png' AS product_image,
    spk.cat_id,
    IFNULL(sp.bestandsnaam, '') AS bestandsnaam,
    p.suitable_for,
    p.suitable_for2
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype= 'service'
    JOIN shop_pro_cat spk ON spk.product_id=p.id #AND spk.cat_id IN(2386)# CAT (accessoires)
    LEFT JOIN easy_webpages info ON info.seoname = CONCAT('uitleg-', IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', ''))))
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'

    WHERE (NULLIF(p.suitable_for2,'') IS NULL
    OR p.suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(LOWER(@implementation), 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
     (p.suitable_for IS NULL OR p.suitable_for = 'ALLE' OR
    REPLACE(REPLACE(@turnDirection, 'links', 'R2/L3'), 'rechts', 'L1/R4') LIKE CONCAT('%', p.suitable_for , '%') OR
    # reversed
    p.suitable_for LIKE CONCAT('%', REPLACE(REPLACE(@turnDirection, 'links', 'R2/L3'), 'rechts', 'L1/R4') , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = @turnDirection) LIKE CONCAT('%', p.suitable_for , '%')
    )
    )  AND '{brievenbuspakketJanee}' = 'Nee' AND  p.producttype='briefplaatfrezing'
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    GROUP BY p.id
    ORDER BY product_name
    3,5959170,019764
    [RenderValues] Do last replacements. Num items: 03,5959680,000051
    [RenderValues] replacements done3,5959770,000009
    RenderStep (values rendered) Briefplaatfrezing connected to: brievenbuspakket - mainstepnumber: 3 - stepnumber: 6 - dependentvalue: 1 - datasource connectedid: brievenbuspakket3,5960170,000039
    [RenderValues] set query and/or replacements3,5960670,000050
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 6 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,5960770,000010
    No caching of lanuage 38. Because it is not changed within this session.3,5962690,000192
    Cache item 'ML_38' already exists, so language is not cached again3,5962860,000017
    Session 'MlJclLanguage' set to 383,5962940,000008
    Start replace dynamic content3,5963110,000017
    Replace dynamic content only once3,5963690,000058
    End replace dynamic content3,5963760,000007
    Filled translationcomponent from cache.3,5968940,000519
    No caching of lanuage 38. Because it is not changed within this session.3,6218500,024956
    Cache item 'ML_38' already exists, so language is not cached again3,6219110,000061
    Session 'MlJclLanguage' set to 383,6219200,000009
    Start replace dynamic content3,6219560,000036
    Replace dynamic content only once3,6220260,000071
    End replace dynamic content3,6220450,000019
    Filled translationcomponent from cache.3,6224540,000409
    [RenderValues] set query and/or replacements3,6493720,026918
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 6 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,6494300,000058
    No caching of lanuage 38. Because it is not changed within this session.3,6496420,000212
    Cache item 'ML_38' already exists, so language is not cached again3,6496680,000026
    Session 'MlJclLanguage' set to 383,6496810,000013
    Start replace dynamic content3,6497000,000018
    Replace dynamic content only once3,6497700,000070
    End replace dynamic content3,6497770,000007
    Filled translationcomponent from cache.3,6503380,000561
    RenderStep Scharnierkrozingen connected to: uitvoering;draairichting;hoogte;breedte - mainstepnumber: 3 - stepnumber: 7 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte3,6747720,024434
    [RenderValues] set query and/or replacements3,6748400,000068
    [RenderValues] Execute query3,6753070,000467
    query cachinghours: 2003,6753920,000085
    QUERY SYSCON START:
    SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###


    SET @isDubbel = IF('{dubbel}' = 'Ja', 1, 0);

    SELECT
      @isIndustrial,
    false AS hidden,
    'scharnierkrozingen' AS product_name,
    'scharnierkrozingen' AS product_description,
    sp.bestandsnaam,
    p.id,
    p.eancode,
    p.description_short,
    p.version,
    REPLACE(REPLACE(IFNULL(SUM(p.pricecando),0), '.',','), ',00', ',-')  AS price
    FROM shop_products p
    JOIN shop_products door ON door.id=@doorId
    JOIN shop_koppeling k ON k.prod_source = p.id AND k.prod_dest=door.id AND k.koppeltype = 'Scharnierkrozing'
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'
    WHERE p.suitable_for = REPLACE(REPLACE(@turnType, 'links', 'L1'),'rechts','R2')
    AND p.visiblecando<>0
    GROUP BY p.id
    3,6754110,000019
    Open connection with DB3,6754540,000043
    QUERY SYSCON END:
    SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###


    SET @isDubbel = IF('{dubbel}' = 'Ja', 1, 0);

    SELECT
      @isIndustrial,
    false AS hidden,
    'scharnierkrozingen' AS product_name,
    'scharnierkrozingen' AS product_description,
    sp.bestandsnaam,
    p.id,
    p.eancode,
    p.description_short,
    p.version,
    REPLACE(REPLACE(IFNULL(SUM(p.pricecando),0), '.',','), ',00', ',-')  AS price
    FROM shop_products p
    JOIN shop_products door ON door.id=@doorId
    JOIN shop_koppeling k ON k.prod_source = p.id AND k.prod_dest=door.id AND k.koppeltype = 'Scharnierkrozing'
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'
    WHERE p.suitable_for = REPLACE(REPLACE(@turnType, 'links', 'L1'),'rechts','R2')
    AND p.visiblecando<>0
    GROUP BY p.id
    3,6945610,019108
    [RenderValues] Do last replacements. Num items: 03,6946050,000044
    [RenderValues] replacements done3,6946140,000008
    RenderStep (values rendered) Scharnierkrozingen connected to: uitvoering;draairichting;hoogte;breedte - mainstepnumber: 3 - stepnumber: 7 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte3,6946430,000029
    [RenderValues] set query and/or replacements3,6946930,000051
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 7 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,6947040,000011
    No caching of lanuage 38. Because it is not changed within this session.3,6948780,000173
    Cache item 'ML_38' already exists, so language is not cached again3,6948900,000012
    Session 'MlJclLanguage' set to 383,6948980,000008
    Start replace dynamic content3,6949140,000016
    Replace dynamic content only once3,6949710,000057
    End replace dynamic content3,6949780,000006
    Filled translationcomponent from cache.3,6953700,000393
    No caching of lanuage 38. Because it is not changed within this session.3,7199360,024566
    Cache item 'ML_38' already exists, so language is not cached again3,7200070,000071
    Session 'MlJclLanguage' set to 383,7200270,000020
    Start replace dynamic content3,7200650,000038
    Replace dynamic content only once3,7201480,000083
    End replace dynamic content3,7201550,000007
    Filled translationcomponent from cache.3,7206280,000472
    [RenderValues] set query and/or replacements3,7454520,024825
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 7 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,7455040,000052
    No caching of lanuage 38. Because it is not changed within this session.3,7457290,000225
    Cache item 'ML_38' already exists, so language is not cached again3,7457530,000024
    Session 'MlJclLanguage' set to 383,7457640,000012
    Start replace dynamic content3,7457820,000017
    Replace dynamic content only once3,7458590,000077
    End replace dynamic content3,7458750,000016
    Filled translationcomponent from cache.3,7464350,000560
    RenderStep Accessoires connected to: uitvoering;draairichting;hoogte;breedte - mainstepnumber: 3 - stepnumber: 8 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte3,7695410,023105
    [RenderValues] set query and/or replacements3,7695970,000056
    [RenderValues] Execute query3,7702190,000622
    query cachinghours: 2003,7703060,000087
    QUERY SYSCON START:
    SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###

    SET @isIndustrial = (SELECT IF(COUNT(*)>0,true,false) FROM shop_category WHERE id=@doorCat AND style LIKE '%industrial%');
    SET @isDouble = IF('{dubbel}' = 'Ja', true, false);


    SELECT
    @doorId,
    IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%', '2x ','') AS ammountPrefix,
    #IFNULL(info.html, '') AS info,
    p.usp_s AS info,
    p.id AS product_id,
       CONCAT(IF(@isDouble, ' ', ''), p.description_short) AS product_description,
    LOWER(IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', '')))) AS product_name,
       REPLACE(REPLACE(IFNULL(SUM(innerProducts.pricecando), p.pricecando) * IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%',2,1), '.',','), ',00', ',-')  AS price,
       'images/prod-scharnieren.png' AS product_image,
    spk.cat_id,
    IFNULL(MIN(spi.bestandsnaam), sp.bestandsnaam) AS bestandsnaam,
    p.suitable_for,
    p.suitable_for2
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype IN ('accessoire', 'accessoirepakket')
    JOIN shop_pro_cat spk ON spk.product_id=p.id #AND spk.cat_id IN(2386)# CAT (accessoires)
    LEFT JOIN easy_webpages info ON info.seoname = CONCAT('uitleg-', IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', ''))))
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'

    LEFT JOIN shop_koppeling k2 ON k2.prod_dest = k.prod_source AND k2.koppeltype='accessoire' # schuifsysteem
    LEFT JOIN shop_products innerProducts ON innerProducts.id=k2.prod_source
    LEFT JOIN shop_pictures spi ON spi.product_id=innerProducts.id AND spi.formaatnaam='normaal'

    WHERE (NULLIF(p.suitable_for2,'') IS NULL
    OR p.suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(LOWER(@implementation), 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
     (p.suitable_for IS NULL OR p.suitable_for = 'ALLE' OR
    REPLACE(REPLACE(@turntype, 'links', 'R2/L3'), 'rechts', 'L1/R4') LIKE CONCAT('%', p.suitable_for , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = @turntype) LIKE CONCAT('%', p.suitable_for , '%')
    )
    )  
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    GROUP BY p.id
    ORDER BY product_name
    3,7703280,000021
    Open connection with DB3,7703890,000061
    QUERY SYSCON END:
    SET @_doorType = '{deurtype}';
    SET @_uitvoering = '{uitvoering}';
    SET @_draairichting = '{draairichting}';
    SET @_height = IF('{height}' LIKE '{%}', '', '{height}');
    SET @_width = IF('{width}' LIKE '{%}', '', '{width}');

    ### Get correct door id and information.
    SET @doorChoice = IF(@_doorType LIKE '{%}', '0,0,0', @_doorType);

    SET @doorCat = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 1), ',', -1) AS UNSIGNED);
    SET @doorGlass = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 2), ',', -1) AS UNSIGNED);
    SET @doorExtra = CAST(SUBSTRING_INDEX(SUBSTRING_INDEX(@doorChoice, ',', 3), ',', -1) AS UNSIGNED);
    SET @implementation = IF(@_uitvoering LIKE '{%}', NULL, IF(@_uitvoering IN('Buitendraaiend', 'Binnendraaiend', 'schuifdeur'), 'stomp', '{uitvoering}'));
    SET @turnDirection = IF(@_draairichting IN ('R2/L3', 'L3', 'R2'), 'links', 'rechts');
    SET @implementationDirect = CONCAT_WS(' ', @implementation, IF(@turnDirection LIKE '{%}', NULL, @turnDirection));
    SET @implementationTestNearest = IF(@implementation = 'schuifdeur', '%stomp%', IF(@implementation='opdek', CONCAT('%',@implementation, ' ', @turnDirection,'%'), CONCAT('%', @implementation ,'%')));

    # Try to match exact, if fails try to match nearest
    SET @doorId = (
    SELECT * FROM (
    SELECT p.id FROM shop_pro_cat catLnk
            JOIN shop_category cat ON cat.id=@doorCat
            JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=cat.id AND p.height = @_height AND p.width = @_width
    AND FIND_IN_SET( @implementationDirect, p.producttype)
    UNION ALL
    SELECT p.id FROM shop_pro_cat catLnk JOIN shop_products p ON p.id=catLnk.product_id AND catLnk.cat_id=@doorCat AND p.height = @_height AND p.width = @_width
    AND p.producttype LIKE @implementationTestNearest
    ) d LIMIT 1
    );
    ### END door vars ###

    SET @isIndustrial = (SELECT IF(COUNT(*)>0,true,false) FROM shop_category WHERE id=@doorCat AND style LIKE '%industrial%');
    SET @isDouble = IF('{dubbel}' = 'Ja', true, false);


    SELECT
    @doorId,
    IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%', '2x ','') AS ammountPrefix,
    #IFNULL(info.html, '') AS info,
    p.usp_s AS info,
    p.id AS product_id,
       CONCAT(IF(@isDouble, ' ', ''), p.description_short) AS product_description,
    LOWER(IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', '')))) AS product_name,
       REPLACE(REPLACE(IFNULL(SUM(innerProducts.pricecando), p.pricecando) * IF(p.suitable_for2 LIKE '%enkel%' AND p.suitable_for2 LIKE '%dubbel%',2,1), '.',','), ',00', ',-')  AS price,
       'images/prod-scharnieren.png' AS product_image,
    spk.cat_id,
    IFNULL(MIN(spi.bestandsnaam), sp.bestandsnaam) AS bestandsnaam,
    p.suitable_for,
    p.suitable_for2
    FROM shop_products p
    JOIN shop_koppeling k ON k.prod_dest = @doorId AND k.prod_source = p.id AND k.koppeltype IN ('accessoire', 'accessoirepakket')
    JOIN shop_pro_cat spk ON spk.product_id=p.id #AND spk.cat_id IN(2386)# CAT (accessoires)
    LEFT JOIN easy_webpages info ON info.seoname = CONCAT('uitleg-', IFNULL(NULLIF(p.producttype,''), IFNULL(p.serie, REPLACE(p.description_short, ' ', ''))))
    LEFT JOIN shop_pictures sp ON sp.product_id=p.id AND sp.formaatnaam='normaal'

    LEFT JOIN shop_koppeling k2 ON k2.prod_dest = k.prod_source AND k2.koppeltype='accessoire' # schuifsysteem
    LEFT JOIN shop_products innerProducts ON innerProducts.id=k2.prod_source
    LEFT JOIN shop_pictures spi ON spi.product_id=innerProducts.id AND spi.formaatnaam='normaal'

    WHERE (NULLIF(p.suitable_for2,'') IS NULL
    OR p.suitable_for2 LIKE CONCAT('%', IF(@isDouble, 'dubbel', 'enkel'), ' ', REPLACE(LOWER(@implementation), 'schuifdeur', 'schuif'), '%')
    ) AND
    # turntypes
     (p.suitable_for IS NULL OR p.suitable_for = 'ALLE' OR
    REPLACE(REPLACE(@turntype, 'links', 'R2/L3'), 'rechts', 'L1/R4') LIKE CONCAT('%', p.suitable_for , '%')
    OR (
    (SELECT suitable_for FROM shop_products WHERE eancode = @turntype) LIKE CONCAT('%', p.suitable_for , '%')
    )
    )  
    #AND p.visiblecando<>0
    AND IF('{branch}' LIKE '{%}' OR '{branch}' = '', p.visiblecando, p.visiblecandoBranch) <> 0

    GROUP BY p.id
    ORDER BY product_name
    3,7903160,019928
    [RenderValues] Do last replacements. Num items: 03,7903700,000054
    [RenderValues] replacements done3,7903800,000010
    RenderStep (values rendered) Accessoires connected to: uitvoering;draairichting;hoogte;breedte - mainstepnumber: 3 - stepnumber: 8 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte3,7904170,000037
    [RenderValues] set query and/or replacements3,7904810,000064
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 8 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,7904940,000013
    No caching of lanuage 38. Because it is not changed within this session.3,7907490,000255
    Cache item 'ML_38' already exists, so language is not cached again3,7907670,000018
    Session 'MlJclLanguage' set to 383,7907800,000013
    Start replace dynamic content3,7908040,000025
    Replace dynamic content only once3,7908920,000087
    End replace dynamic content3,7909020,000010
    Filled translationcomponent from cache.3,7914630,000561
    No caching of lanuage 38. Because it is not changed within this session.3,8226900,031228
    Cache item 'ML_38' already exists, so language is not cached again3,8227670,000077
    Session 'MlJclLanguage' set to 383,8227850,000018
    Start replace dynamic content3,8228330,000048
    Replace dynamic content only once3,8229300,000097
    End replace dynamic content3,8229430,000013
    Filled translationcomponent from cache.3,8235580,000615
    [RenderValues] set query and/or replacements3,8541370,030579
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 8 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,8541980,000061
    No caching of lanuage 38. Because it is not changed within this session.3,8544670,000269
    Cache item 'ML_38' already exists, so language is not cached again3,8545010,000035
    Session 'MlJclLanguage' set to 383,8545270,000026
    Start replace dynamic content3,8545510,000024
    Replace dynamic content only once3,8546390,000088
    End replace dynamic content3,8546520,000013
    Filled translationcomponent from cache.3,8552500,000598
    QUERY SYSCON START:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    3,8860690,030819
    Open connection with DB3,8862730,000205
    QUERY SYSCON END:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    3,9169250,030651
    QUERY SYSCON START:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    3,9174750,000550
    Open connection with DB3,9176630,000189
    QUERY SYSCON END:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    3,9555010,037838
    QUERY SYSCON START:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    3,9560020,000501
    Open connection with DB3,9561130,000110
    QUERY SYSCON END:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    3,9858030,029691
    QUERY SYSCON START:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    3,9875830,001780
    Open connection with DB3,9877220,000139
    QUERY SYSCON END:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    4,0177400,030018
    QUERY SYSCON START:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    4,0197850,002045
    Open connection with DB4,0199400,000155
    QUERY SYSCON END:
                           SELECT
                               #SUMMARY
                               IFNULL(configvalues_duplicate.summary_template,configvalues.summary_template) AS summary_template
                               ,IFNULL(configvalues_duplicate.summary_mainstep_template,configvalues.summary_mainstep_template) AS summary_mainstep_template
                               ,IFNULL(configvalues_duplicate.summary_step_template,configvalues.summary_step_template) AS summary_step_template

                               #PROGRESS
                               ,IFNULL(configvalues_duplicate.pre_progress_template,configvalues.pre_progress_template) AS progress_pre_template
                               ,IFNULL(configvalues_duplicate.pre_progress_step_template,configvalues.pre_progress_step_template) AS progress_pre_step_template
                               ,IFNULL(configvalues_duplicate.pre_progress_substep_template,configvalues.pre_progress_substep_template) AS progress_pre_substep_template

                               ,IFNULL(configvalues_duplicate.post_progress_template,configvalues.post_progress_template) AS progress_post_template
                               ,IFNULL(configvalues_duplicate.post_progress_step_template,configvalues.post_progress_step_template) AS progress_post_step_template
                               ,IFNULL(configvalues_duplicate.post_progress_substep_template,configvalues.post_progress_substep_template) AS progress_post_substep_template

                               ,IFNULL(configvalues_duplicate.progress_template,configvalues.progress_template) AS progress_template
                               ,IFNULL(configvalues_duplicate.progress_step_template,configvalues.progress_step_template) AS progress_step_template
                               ,IFNULL(configvalues_duplicate.progress_substep_template,configvalues.progress_substep_template) AS progress_substep_template

                               #CONFIGURATOR
                           ,configurator.name
                           ,IFNULL(configvalues_duplicate.template,configvalues.template) AS template
                               ,configvalues.price_calculation_query

                               #MAIN STEPS
                           #,IF(mainstepvalues.step_template IS NULL OR TRIM(mainstepvalues.step_template)='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),mainstepvalues.step_template) AS mainstep_template
                               ,IF(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template) IS NULL OR TRIM(IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template))='',IFNULL(configvalues_duplicate.step_template,configvalues.step_template),IFNULL(mainstepvalues_duplicate.step_template,mainstepvalues.step_template)) AS mainstep_template
                           ,mainsteps.name AS mainstepname
                               ,mainstepvalues.free_content1 AS mainstep_free_content1
                               ,mainstepvalues.free_content2 AS mainstep_free_content2
                               ,mainstepvalues.free_content3 AS mainstep_free_content3
                               ,mainstepvalues.free_content4 AS mainstep_free_content4
                               ,mainstepvalues.free_content5 AS mainstep_free_content5

                               #STEPS
                           ,IF(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template) IS NULL OR TRIM(IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template))='',IFNULL(configvalues_duplicate.default_step_template,configvalues.default_step_template),IFNULL(stepvalues_duplicate.step_template,stepvalues.step_template)) AS step_template
                           ,steps.name AS stepname
                           ,IFNULL(stepvalues_duplicate.values_template,stepvalues.values_template) AS values_template
                           ,stepvalues.datasource
                           ,stepvalues.custom_query
                           ,stepvalues.fixed_valuelist
                               ,stepvalues.datasource_connectedtype
                               ,IF(IFNULL(stepvalues.variable_name,'')='',steps.seoname,stepvalues.variable_name) AS variable_name
                               ,stepvalues.free_content1 AS step_free_content1
                               ,stepvalues.free_content2 AS step_free_content2
                               ,stepvalues.free_content3 AS step_free_content3
                               ,stepvalues.free_content4 AS step_free_content4
                               ,stepvalues.free_content5 AS step_free_content5
                               ,stepvalues.datasource_connectedid
                               ,stepvalues.isrequired
                               ,stepvalues.check_connectedid

                               #SUBSTEPS
                           ,substeps.name AS substepname
                           ,IFNULL(substepvalues_duplicate.step_template,substepvalues.step_template) AS substep_template
                           ,IFNULL(substepvalues_duplicate.values_template,substepvalues.values_template) AS substep_values_template
                           ,substepvalues.datasource AS substep_datasource
                           ,substepvalues.custom_query AS substep_custom_query
                           ,substepvalues.fixed_valuelist AS substep_fixed_valuelist
                               ,substepvalues.datasource_connectedtype AS substep_datasource_connectedtype
                               ,IF(IFNULL(substepvalues.variable_name,'')='',substeps.seoname,substepvalues.variable_name) AS substep_variable_name
                               ,substepvalues.datasource_connectedid AS substep_datasource_connectedid
                               ,substepvalues.isrequired AS substep_isrequired
                               ,substepvalues.check_connectedid AS substep_check_connectedid

                               #Get the applied regex
                               ,IF(IFNULL(mainstepvalues.urlregex,'')<>'',mainstepvalues.urlregex,
                                   IF(IFNULL(stepvalues.urlregex,'')<>'',stepvalues.urlregex,IFNULL(substepvalues.urlregex,''))) AS urlregex

                           FROM easy_items configurator
                           JOIN `easy_configuratorsetup` configvalues ON configvalues.itemid = configurator.id
    LEFT JOIN `easy_configuratorsetup` configvalues_duplicate ON configvalues_duplicate.itemid=configvalues.duplicatelayoutfrom
                           JOIN easy_items mainsteps ON mainsteps.moduleid=320 AND mainsteps.`level`=2 AND mainsteps.parent_id=configurator.id AND mainsteps.published=1

                           LEFT JOIN `easy_configuratorsetup` mainstepvalues ON mainstepvalues.itemid = mainsteps.id
                           LEFT JOIN `easy_configuratorsetup` mainstepvalues_duplicate ON mainstepvalues_duplicate.itemid=mainstepvalues.duplicatelayoutfrom

                           LEFT JOIN easy_items steps ON steps.moduleid=320 AND steps.`level`=3 AND steps.parent_id=mainsteps.id AND steps.published=1
                           LEFT JOIN `easy_configuratorsetup` stepvalues ON stepvalues.itemid = steps.id
                           LEFT JOIN `easy_configuratorsetup` stepvalues_duplicate ON stepvalues_duplicate.itemid=stepvalues.duplicatelayoutfrom
                           LEFT JOIN easy_items substeps ON substeps.moduleid=320 AND substeps.`level`=4 AND substeps.parent_id=steps.id AND substeps.published=1
                           LEFT JOIN `easy_configuratorsetup` substepvalues ON substepvalues.itemid = substeps.id
                           LEFT JOIN `easy_configuratorsetup` substepvalues_duplicate ON substepvalues_duplicate.itemid=substepvalues.duplicatelayoutfrom
                           WHERE
                           configurator.moduleid=320 AND
                           configurator.`level`=1 AND
                           configurator.`name`=?name
                           ORDER BY mainsteps.volgnr,steps.volgnr
                          
    4,0497590,029819
    No caching of lanuage 38. Because it is not changed within this session.4,0513440,001585
    Cache item 'ML_38' already exists, so language is not cached again4,0513810,000037
    Session 'MlJclLanguage' set to 384,0513960,000015
    Start replace dynamic content4,0527190,001323
    Replace dynamic content only once4,0553640,002645
    End replace dynamic content4,0553880,000024
    Filled translationcomponent from cache.4,0560360,000648
    Start replacing system objects4,0943590,038323
    Start replacing translation4,1062260,011867
    Start replacing objects4,1070710,000846
    Start replacing request4,1081950,001124
    Start replacing session4,2481360,139941
    Start replacing standards4,2577420,009606
    Start replacing objecs again4,2593080,001566
    aspx.pageEnd Render4,2822100,022902

    Control Tree

    Control UniqueIDTypeRender Size Bytes (including children)ViewState Size Bytes (excluding children)ControlState Size Bytes (excluding children)
    __PageASP.homepage_aspx25345800
        ctl00System.Web.UI.HtmlControls.HtmlHead130100
            ctl01System.Web.UI.HtmlControls.HtmlMeta2400
            ctl02System.Web.UI.HtmlControls.HtmlMeta7000
            ctl03System.Web.UI.HtmlControls.HtmlMeta4500
            LiteralTagmanagerCodeSystem.Web.UI.WebControls.Literal58700
            ctl09System.Web.UI.LiteralControl8200
            ctl04System.Web.UI.HtmlControls.HtmlTitle5100
            ctl05System.Web.UI.HtmlControls.HtmlGenericControl6800
            ctl06System.Web.UI.HtmlControls.HtmlGenericControl13000
                ctl10System.Web.UI.LiteralControl11300
            ctl07System.Web.UI.HtmlControls.HtmlLink11500
            ctl08System.Web.UI.HtmlControls.HtmlGenericControl11600
        LoginCJuiceControlLibrary.LoginControl2400

    Session State

    Session KeyTypeValue
    JCLSEOURLSystem.String 
    JCLSEOURLWQSSystem.String 
    JCLSEOURLQSSystem.String 
    JuiceControlCustIdSystem.Int32290
    MlJclLanguageSystem.Int3238

    Application State

    Application KeyTypeValue

    Request Cookies Collection

    NameValueSize

    Response Cookies Collection

    NameValueSize
    ASP.NET_SessionIdlmvwnqbbvatitq4rnfyjuzld42
    CurrentDomaincando.juicebv.nl30

    Headers Collection

    NameValue
    Cache-Controlmax-age=0
    Connectionclose
    Via1.1 squid-proxy-5b96dc6d46-t2mp7 (squid/6.13)
    Content-Length0
    Accept*/*
    Accept-Encodinggzip, br, zstd, deflate
    Hostcando.juicebv.nl
    User-AgentMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
    X-Forwarded-For10.8.200.22, 216.73.217.72
    X-Forwarded-Protohttp

    Response Headers Collection

    NameValue
    Cache-Controlprivate
    Content-Typetext/html

    Form Collection

    NameValue

    Querystring Collection

    NameValue
    configuratorvoordeuren
    typevoordeuren

    Server Variables

    NameValue
    ALL_HTTPHTTP_CACHE_CONTROL:max-age=0 HTTP_CONNECTION:close HTTP_VIA:1.1 squid-proxy-5b96dc6d46-t2mp7 (squid/6.13) HTTP_CONTENT_LENGTH:0 HTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, br, zstd, deflate HTTP_HOST:cando.juicebv.nl HTTP_USER_AGENT:Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) HTTP_X_FORWARDED_FOR:10.8.200.22, 216.73.217.72 HTTP_X_FORWARDED_PROTO:http
    ALL_RAWCache-Control: max-age=0 Connection: close Via: 1.1 squid-proxy-5b96dc6d46-t2mp7 (squid/6.13) Content-Length: 0 Accept: */* Accept-Encoding: gzip, br, zstd, deflate Host: cando.juicebv.nl User-Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) X-Forwarded-For: 10.8.200.22, 216.73.217.72 X-Forwarded-Proto: http
    APPL_MD_PATH/LM/W3SVC/1/ROOT
    APPL_PHYSICAL_PATHC:\inetpub\wwwroot\configurator-cando - LIVE\
    AUTH_TYPE 
    AUTH_USER 
    AUTH_PASSWORD 
    LOGON_USER 
    REMOTE_USER 
    CERT_COOKIE 
    CERT_FLAGS 
    CERT_ISSUER 
    CERT_KEYSIZE 
    CERT_SECRETKEYSIZE 
    CERT_SERIALNUMBER 
    CERT_SERVER_ISSUER 
    CERT_SERVER_SUBJECT 
    CERT_SUBJECT 
    CONTENT_LENGTH0
    CONTENT_TYPE 
    GATEWAY_INTERFACECGI/1.1
    HTTPSoff
    HTTPS_KEYSIZE 
    HTTPS_SECRETKEYSIZE 
    HTTPS_SERVER_ISSUER 
    HTTPS_SERVER_SUBJECT 
    INSTANCE_ID1
    INSTANCE_META_PATH/LM/W3SVC/1
    LOCAL_ADDR136.144.214.155
    PATH_INFO/homepage.aspx
    PATH_TRANSLATEDC:\inetpub\wwwroot\configurator-cando - LIVE\homepage.aspx
    QUERY_STRINGconfigurator=voordeuren&type=voordeuren
    REMOTE_ADDR89.41.168.5
    REMOTE_HOST89.41.168.5
    REMOTE_PORT46622
    REQUEST_METHODGET
    SCRIPT_NAME/homepage.aspx
    SERVER_NAMEcando.juicebv.nl
    SERVER_PORT80
    SERVER_PORT_SECURE0
    SERVER_PROTOCOLHTTP/1.1
    SERVER_SOFTWAREMicrosoft-IIS/10.0
    URL/homepage.aspx
    HTTP_CACHE_CONTROLmax-age=0
    HTTP_CONNECTIONclose
    HTTP_VIA1.1 squid-proxy-5b96dc6d46-t2mp7 (squid/6.13)
    HTTP_CONTENT_LENGTH0
    HTTP_ACCEPT*/*
    HTTP_ACCEPT_ENCODINGgzip, br, zstd, deflate
    HTTP_HOSTcando.juicebv.nl
    HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
    HTTP_X_FORWARDED_FOR10.8.200.22, 216.73.217.72
    HTTP_X_FORWARDED_PROTOhttp

    Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.4136.0