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:3u2vlio1fw4jlj2fyqhe43erRequest Type:GET
    Time of Request:16-9-2026 09:44:55Status 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,0000350,000035
    aspx.pageBegin Init0,0000460,000011
    LoginControl_Init - isValidForThisDomain: True0,0006580,000612
    LoginControl - SetupWebsite - proceed: True, GoAnCode: , TagManagerId: 0,0010350,000377
    This is page: homepage.aspx. With masterpagefile: 0,0012590,000224
    CSS template IDs found: 0,0015070,000248
    End load CSS from Wiser...0,0015170,000010
    JS template IDs found: 0,0017590,000242
    NO JS template inline found0,0017680,000010
    End load JS from Wiser...0,0017740,000006
    aspx.pageEnd Init0,0018140,000040
    aspx.pageBegin InitComplete0,0018200,000006
    aspx.pageEnd InitComplete0,0018260,000006
    aspx.pageBegin PreLoad0,0018310,000006
    aspx.pageEnd PreLoad0,0018390,000008
    aspx.pageBegin Load0,0018450,000006
    aspx.pageEnd Load0,0018740,000029
    aspx.pageBegin LoadComplete0,0018800,000006
    aspx.pageEnd LoadComplete0,0018900,000010
    aspx.pageBegin PreRender0,0018950,000005
    aspx.pageEnd PreRender0,0019490,000054
    aspx.pageBegin PreRenderComplete0,0019580,000009
    aspx.pageEnd PreRenderComplete0,0019630,000006
    aspx.pageBegin SaveState0,0021580,000195
    aspx.pageEnd SaveState0,0021710,000013
    aspx.pageBegin SaveStateComplete0,0021800,000009
    aspx.pageEnd SaveStateComplete0,0021870,000006
    aspx.pageBegin Render0,0021920,000005
    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,0029080,000716
    Open connection with DB0,0030380,000130
    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,1732600,170222
    RenderStep Kies uw buitendeur connected to: 2289 - mainstepnumber: 1 - stepnumber: 1 - dependentvalue: 2289 - datasource connectedid: 22890,1772240,003964
    [RenderValues] set query and/or replacements0,1772950,000072
    [RenderValues] Execute query0,1785210,001226
    query cachinghours: 2000,1786470,000126
    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,1786840,000038
    Open connection with DB0,1787990,000115
    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,4217020,242903
    [RenderValues] Do last replacements. Num items: 810,4217530,000051
    [RenderValues] replacements done1,9565191,534766
    RenderStep (values rendered) Kies uw buitendeur connected to: 2289 - mainstepnumber: 1 - stepnumber: 1 - dependentvalue: 2289 - datasource connectedid: 22891,9569100,000391
    [RenderValues] set query and/or replacements1,9578480,000938
    RenderSubStep  connected to:  - mainstepnumber: 1 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 1,9578710,000023
    Language 38 is new1,9580700,000200
    Cache item 'ML_38' already exists, so language is not cached again1,9581100,000040
    Session 'MlJclLanguage' set to 381,9581270,000017
    Start replace dynamic content1,9581520,000024
    Replace dynamic content only once1,9582330,000082
    End replace dynamic content1,9582490,000015
    Filled translationcomponent from cache.1,9589220,000674
    No caching of lanuage 38. Because it is not changed within this session.2,1349210,175999
    Cache item 'ML_38' already exists, so language is not cached again2,1349940,000073
    Session 'MlJclLanguage' set to 382,1350030,000009
    Start replace dynamic content2,1362350,001232
    Replace dynamic content only once2,1389400,002705
    End replace dynamic content2,1389840,000044
    Filled translationcomponent from cache.2,1397280,000744
    Start replacing system objects2,1803900,040662
    Start replacing translation2,1833610,002972
    Start replacing objects2,1842300,000869
    Start replacing request2,1852640,001034
    Start replacing session2,3281090,142845
    Start replacing standards2,3397160,011607
    Start replacing objecs again2,3411380,001422
    [RenderValues] set query and/or replacements2,7823710,441234
    RenderSubStep  connected to:  - mainstepnumber: 1 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 2,7824260,000055
    No caching of lanuage 38. Because it is not changed within this session.2,7827460,000320
    Cache item 'ML_38' already exists, so language is not cached again2,7827960,000049
    Session 'MlJclLanguage' set to 382,7828060,000010
    Start replace dynamic content2,7828390,000034
    Replace dynamic content only once2,7829330,000093
    End replace dynamic content2,7829410,000008
    Filled translationcomponent from cache.2,7835360,000595
    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,8279050,044368
    Open connection with DB2,8280430,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
                          
    2,8859560,057913
    RenderStep Binnendraaiend connected to: binnendeuren  deurtype - mainstepnumber: 2 - stepnumber: 1 - dependentvalue: 1 - datasource connectedid: binnendeuren - deurtype2,8897240,003768
    [RenderValues] set query and/or replacements2,8897730,000048
    RenderStep (values rendered) Binnendraaiend connected to: binnendeuren  deurtype - mainstepnumber: 2 - stepnumber: 1 - dependentvalue: 1 - datasource connectedid: binnendeuren - deurtype2,8898440,000071
    [RenderValues] set query and/or replacements2,8898740,000030
    [RenderValues] Execute query2,8901490,000275
    query cachinghours: 2002,8902440,000095
    QUERY SYSCON START: 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,8902630,000019
    Open connection with DB2,8902800,000018
    QUERY SYSCON END: 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,9159450,025664
    [RenderValues] Do last replacements. Num items: 02,9159880,000044
    [RenderValues] replacements done2,9159970,000009
    RenderSubStep Kies een draairichting (binnen) connected to: draairichting - mainstepnumber: 2 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: draairichting2,9160330,000036
    No caching of lanuage 38. Because it is not changed within this session.2,9163250,000293
    Cache item 'ML_38' already exists, so language is not cached again2,9163520,000026
    Session 'MlJclLanguage' set to 382,9163630,000012
    Start replace dynamic content2,9163970,000033
    Replace dynamic content only once2,9164560,000059
    End replace dynamic content2,9164620,000006
    Filled translationcomponent from cache.2,9170640,000602
    No caching of lanuage 38. Because it is not changed within this session.2,9541850,037121
    Cache item 'ML_38' already exists, so language is not cached again2,9542620,000077
    Session 'MlJclLanguage' set to 382,9542730,000011
    Start replace dynamic content2,9543140,000041
    QUERY SYSCON START: SELECT * FROM easy_webpages WHERE id=642,9693630,015049
    Open connection with DB2,9694040,000041
    QUERY SYSCON END: SELECT * FROM easy_webpages WHERE id=643,0889350,119531
    Set SEO fields on webpage3,0889790,000045
    title: Welkom op mijn website3,0889950,000016
    metadescription: Vul hier de meta description in3,0890010,000007
    canonicalurl: 3,0890080,000007
    noindex: False3,0890200,000012
    nofollow: False3,0890260,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=3,0890380,000012
    Trying to add meta data, but no header with runat='server' was found3,0890440,000006
    Start replace dynamic content3,0890910,000046
    Replace dynamic content only once3,0891720,000082
    End replace dynamic content3,0892230,000051
    Filled translationcomponent from cache.3,0897140,000491
    Start replace dynamic content3,0917820,002068
    End replace dynamic content3,0919270,000145
    Filled translationcomponent from cache.3,0923970,000470
    End replace dynamic content3,1209210,028524
    Filled translationcomponent from cache.3,1217640,000843
    [RenderValues] set query and/or replacements3,1594580,037695
    [RenderValues] Execute query3,1598960,000438
    query cachinghours: 2003,1600080,000112
    query from cache 'JCLDC2a8ee254c5365604b0b2bdf7a6987f6c'3,1600320,000024
    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;
    3,1600500,000018
    [RenderValues] Do last replacements. Num items: 03,1600620,000012
    [RenderValues] replacements done3,1600740,000012
    RenderSubStep Kies een draairichting (binnen) connected to: draairichting - mainstepnumber: 2 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: draairichting3,1600900,000017
    No caching of lanuage 38. Because it is not changed within this session.3,1604550,000365
    Cache item 'ML_38' already exists, so language is not cached again3,1605270,000071
    Session 'MlJclLanguage' set to 383,1605410,000014
    Start replace dynamic content3,1605750,000035
    Replace dynamic content only once3,1606670,000092
    End replace dynamic content3,1606780,000011
    Filled translationcomponent from cache.3,1613310,000653
    RenderStep Bepaal de afmeting connected to: deurtype;uitvoering;draairichting - mainstepnumber: 2 - stepnumber: 2 - dependentvalue: 1 - datasource connectedid: deurtype;uitvoering;draairichting3,1978860,036555
    [RenderValues] set query and/or replacements3,1979520,000065
    [RenderValues] Execute query3,1989120,000960
    query cachinghours: 2003,1990270,000116
    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
    */
    3,1990580,000031
    Open connection with DB3,1991380,000080
    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
    */
    3,2289310,029794
    [RenderValues] Do last replacements. Num items: 03,2289790,000048
    [RenderValues] replacements done3,2289850,000006
    RenderStep (values rendered) Bepaal de afmeting connected to: deurtype;uitvoering;draairichting - mainstepnumber: 2 - stepnumber: 2 - dependentvalue: 1 - datasource connectedid: deurtype;uitvoering;draairichting3,2290180,000033
    [RenderValues] set query and/or replacements3,2290810,000063
    [RenderValues] Execute query3,2295660,000484
    query cachinghours: 2003,2296830,000117
    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
    3,2297020,000019
    Open connection with DB3,2297330,000032
    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
    3,2628380,033105
    [RenderValues] Do last replacements. Num items: 03,2628960,000057
    [RenderValues] replacements done3,2629030,000008
    RenderSubStep Breedte connected to: hoogte;uitvoering;draairichting - mainstepnumber: 2 - stepnumber: 2 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: hoogte;uitvoering;draairichting3,2629440,000041
    No caching of lanuage 38. Because it is not changed within this session.3,2632700,000326
    Cache item 'ML_38' already exists, so language is not cached again3,2633040,000034
    Session 'MlJclLanguage' set to 383,2633160,000012
    Start replace dynamic content3,2633470,000031
    Replace dynamic content only once3,2634100,000062
    End replace dynamic content3,2634180,000009
    Filled translationcomponent from cache.3,2639150,000497
    No caching of lanuage 38. Because it is not changed within this session.3,2889100,024995
    Cache item 'ML_38' already exists, so language is not cached again3,2889740,000064
    Session 'MlJclLanguage' set to 383,2889830,000009
    Start replace dynamic content3,2890130,000029
    Replace dynamic content only once3,2890870,000074
    End replace dynamic content3,2890930,000006
    Filled translationcomponent from cache.3,2896550,000562
    [RenderValues] set query and/or replacements3,3153200,025665
    [RenderValues] Execute query3,3158320,000512
    query cachinghours: 2003,3159180,000086
    query from cache 'JCLDCc39abe028994805ccd6c94d8c410e1d9'3,3159320,000014
    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
    3,3159490,000016
    [RenderValues] Do last replacements. Num items: 03,3159580,000010
    [RenderValues] replacements done3,3159640,000006
    RenderSubStep Breedte connected to: hoogte;uitvoering;draairichting - mainstepnumber: 2 - stepnumber: 2 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: hoogte;uitvoering;draairichting3,3159760,000012
    No caching of lanuage 38. Because it is not changed within this session.3,3161680,000192
    Cache item 'ML_38' already exists, so language is not cached again3,3161890,000021
    Session 'MlJclLanguage' set to 383,3161970,000008
    Start replace dynamic content3,3162160,000019
    Replace dynamic content only once3,3162600,000044
    End replace dynamic content3,3162680,000008
    Filled translationcomponent from cache.3,3166890,000421
    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,3414420,024753
    Open connection with DB3,3416610,000219
    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,3869040,045244
    RenderStep Draairaamset connected to: deurtype;draairichting;draairichtingsub;hoogte;breedte - mainstepnumber: 3 - stepnumber: 1 - dependentvalue: 1 - datasource connectedid: deurtype;draairichting;draairichtingsub;hoogte;breedte3,3889800,002076
    [RenderValues] set query and/or replacements3,3890270,000047
    [RenderValues] Execute query3,3895660,000539
    query cachinghours: 2003,3896670,000101
    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,3896940,000027
    Open connection with DB3,3897330,000039
    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,4184340,028701
    [RenderValues] Do last replacements. Num items: 03,4184960,000062
    [RenderValues] replacements done3,4185070,000011
    RenderStep (values rendered) Draairaamset connected to: deurtype;draairichting;draairichtingsub;hoogte;breedte - mainstepnumber: 3 - stepnumber: 1 - dependentvalue: 1 - datasource connectedid: deurtype;draairichting;draairichtingsub;hoogte;breedte3,4185480,000042
    [RenderValues] set query and/or replacements3,4186060,000058
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,4186140,000008
    No caching of lanuage 38. Because it is not changed within this session.3,4187970,000183
    Cache item 'ML_38' already exists, so language is not cached again3,4188150,000018
    Session 'MlJclLanguage' set to 383,4188250,000010
    Start replace dynamic content3,4188460,000021
    Replace dynamic content only once3,4189230,000077
    End replace dynamic content3,4189330,000010
    Filled translationcomponent from cache.3,4195060,000573
    No caching of lanuage 38. Because it is not changed within this session.3,4456440,026138
    Cache item 'ML_38' already exists, so language is not cached again3,4457070,000063
    Session 'MlJclLanguage' set to 383,4457160,000008
    Start replace dynamic content3,4457460,000031
    Replace dynamic content only once3,4458190,000073
    End replace dynamic content3,4458260,000007
    Filled translationcomponent from cache.3,4462520,000427
    [RenderValues] set query and/or replacements3,4695690,023316
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 1 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,4696200,000052
    No caching of lanuage 38. Because it is not changed within this session.3,4698040,000184
    Cache item 'ML_38' already exists, so language is not cached again3,4698270,000022
    Session 'MlJclLanguage' set to 383,4698350,000008
    Start replace dynamic content3,4698520,000018
    Replace dynamic content only once3,4699240,000071
    End replace dynamic content3,4699300,000006
    Filled translationcomponent from cache.3,4703830,000453
    RenderStep Veiligheidspakket connected to: uitvoering;draairichting;hoogte;breedte;draairaamset - mainstepnumber: 3 - stepnumber: 2 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte;draairaamset3,4946750,024292
    [RenderValues] set query and/or replacements3,4947330,000058
    [RenderValues] Execute query3,4952070,000474
    query cachinghours: 2003,4953010,000094
    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,4953250,000024
    Open connection with DB3,4953740,000049
    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,5250470,029674
    [RenderValues] Do last replacements. Num items: 03,5250950,000048
    [RenderValues] replacements done3,5251010,000006
    RenderStep (values rendered) Veiligheidspakket connected to: uitvoering;draairichting;hoogte;breedte;draairaamset - mainstepnumber: 3 - stepnumber: 2 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte;draairaamset3,5251320,000031
    [RenderValues] set query and/or replacements3,5251940,000062
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 2 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,5252030,000009
    No caching of lanuage 38. Because it is not changed within this session.3,5253670,000164
    Cache item 'ML_38' already exists, so language is not cached again3,5253800,000013
    Session 'MlJclLanguage' set to 383,5253880,000008
    Start replace dynamic content3,5254040,000016
    Replace dynamic content only once3,5254590,000055
    End replace dynamic content3,5254650,000006
    Filled translationcomponent from cache.3,5260020,000537
    No caching of lanuage 38. Because it is not changed within this session.3,5522320,026231
    Cache item 'ML_38' already exists, so language is not cached again3,5522950,000062
    Session 'MlJclLanguage' set to 383,5523030,000008
    Start replace dynamic content3,5523320,000029
    Replace dynamic content only once3,5524240,000092
    End replace dynamic content3,5524310,000007
    Filled translationcomponent from cache.3,5528820,000451
    [RenderValues] set query and/or replacements3,5788620,025980
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 2 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,5789170,000055
    No caching of lanuage 38. Because it is not changed within this session.3,5791080,000191
    Cache item 'ML_38' already exists, so language is not cached again3,5791310,000023
    Session 'MlJclLanguage' set to 383,5791390,000008
    Start replace dynamic content3,5791570,000018
    Replace dynamic content only once3,5792540,000097
    End replace dynamic content3,5792600,000007
    Filled translationcomponent from cache.3,5797420,000482
    RenderStep Driepuntssluiting (alleen bij geen veiligheidspakket) connected to: veiligheidspakket;draairaamset - mainstepnumber: 3 - stepnumber: 3 - dependentvalue: 1 - datasource connectedid: veiligheidspakket;draairaamset3,6036200,023878
    [RenderValues] set query and/or replacements3,6036930,000073
    [RenderValues] Execute query3,6041950,000502
    query cachinghours: 2003,6042940,000099
    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,6043150,000022
    Open connection with DB3,6043660,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
    );
    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,6356480,031282
    [RenderValues] Do last replacements. Num items: 03,6356980,000050
    [RenderValues] replacements done3,6357050,000006
    RenderStep (values rendered) Driepuntssluiting (alleen bij geen veiligheidspakket) connected to: veiligheidspakket;draairaamset - mainstepnumber: 3 - stepnumber: 3 - dependentvalue: 1 - datasource connectedid: veiligheidspakket;draairaamset3,6357400,000036
    [RenderValues] set query and/or replacements3,6357890,000049
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 3 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,6357990,000010
    No caching of lanuage 38. Because it is not changed within this session.3,6359880,000189
    Cache item 'ML_38' already exists, so language is not cached again3,6360010,000013
    Session 'MlJclLanguage' set to 383,6360090,000008
    Start replace dynamic content3,6360270,000017
    Replace dynamic content only once3,6360820,000055
    End replace dynamic content3,6360880,000006
    Filled translationcomponent from cache.3,6365840,000496
    No caching of lanuage 38. Because it is not changed within this session.3,6623820,025799
    Cache item 'ML_38' already exists, so language is not cached again3,6624460,000064
    Session 'MlJclLanguage' set to 383,6624580,000011
    Start replace dynamic content3,6625010,000043
    Replace dynamic content only once3,6625770,000076
    End replace dynamic content3,6625840,000006
    Filled translationcomponent from cache.3,6630550,000471
    [RenderValues] set query and/or replacements3,6892510,026196
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 3 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,6893090,000058
    No caching of lanuage 38. Because it is not changed within this session.3,6895500,000242
    Cache item 'ML_38' already exists, so language is not cached again3,6895800,000030
    Session 'MlJclLanguage' set to 383,6895920,000012
    Start replace dynamic content3,6896140,000022
    Replace dynamic content only once3,6896800,000066
    End replace dynamic content3,6896860,000006
    Filled translationcomponent from cache.3,6901520,000466
    RenderStep Slotgatfrezing (bij geen driepuntsluiting) nieuw connected to: uitvoering;draairichting;driepuntsluiting;veiligheidspakket - mainstepnumber: 3 - stepnumber: 4 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;driepuntsluiting;veiligheidspakket3,7166300,026477
    [RenderValues] set query and/or replacements3,7166810,000051
    [RenderValues] Execute query3,7172080,000528
    query cachinghours: 2003,7173050,000097
    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,7173340,000029
    Open connection with DB3,7174090,000075
    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,7655450,048137
    [RenderValues] Do last replacements. Num items: 03,7656060,000061
    [RenderValues] replacements done3,7656200,000014
    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,7656620,000043
    [RenderValues] set query and/or replacements3,7657460,000084
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 4 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,7657610,000014
    No caching of lanuage 38. Because it is not changed within this session.3,7660320,000272
    Cache item 'ML_38' already exists, so language is not cached again3,7660650,000033
    Session 'MlJclLanguage' set to 383,7660780,000012
    Start replace dynamic content3,7661060,000029
    Replace dynamic content only once3,7662110,000104
    End replace dynamic content3,7662220,000011
    Filled translationcomponent from cache.3,7669060,000684
    No caching of lanuage 38. Because it is not changed within this session.3,8027960,035891
    Cache item 'ML_38' already exists, so language is not cached again3,8028640,000067
    Session 'MlJclLanguage' set to 383,8028730,000009
    Start replace dynamic content3,8029120,000040
    Replace dynamic content only once3,8029990,000086
    End replace dynamic content3,8030050,000007
    Filled translationcomponent from cache.3,8034500,000444
    [RenderValues] set query and/or replacements3,8259430,022494
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 4 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,8259930,000050
    No caching of lanuage 38. Because it is not changed within this session.3,8261870,000194
    Cache item 'ML_38' already exists, so language is not cached again3,8262070,000021
    Session 'MlJclLanguage' set to 383,8262160,000008
    Start replace dynamic content3,8262430,000027
    Replace dynamic content only once3,8263140,000072
    End replace dynamic content3,8263210,000007
    Filled translationcomponent from cache.3,8267720,000452
    RenderStep Brievenbuspakket connected to: veiligheidspakket - mainstepnumber: 3 - stepnumber: 5 - dependentvalue: 1 - datasource connectedid: veiligheidspakket3,8480260,021254
    [RenderValues] set query and/or replacements3,8480740,000048
    [RenderValues] Execute query3,8485570,000483
    query cachinghours: 2003,8486510,000094
    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,8486790,000028
    Open connection with DB3,8487300,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,8771300,028401
    [RenderValues] Do last replacements. Num items: 03,8771890,000059
    [RenderValues] replacements done3,8771960,000007
    RenderStep (values rendered) Brievenbuspakket connected to: veiligheidspakket - mainstepnumber: 3 - stepnumber: 5 - dependentvalue: 1 - datasource connectedid: veiligheidspakket3,8772250,000029
    [RenderValues] set query and/or replacements3,8772730,000048
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 5 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,8772830,000011
    No caching of lanuage 38. Because it is not changed within this session.3,8774510,000168
    Cache item 'ML_38' already exists, so language is not cached again3,8774700,000019
    Session 'MlJclLanguage' set to 383,8774980,000028
    Start replace dynamic content3,8775180,000020
    Replace dynamic content only once3,8775750,000057
    End replace dynamic content3,8775860,000011
    Filled translationcomponent from cache.3,8780410,000455
    No caching of lanuage 38. Because it is not changed within this session.3,9028680,024828
    Cache item 'ML_38' already exists, so language is not cached again3,9029390,000071
    Session 'MlJclLanguage' set to 383,9029520,000013
    Start replace dynamic content3,9029880,000036
    Replace dynamic content only once3,9030610,000074
    End replace dynamic content3,9030680,000007
    Filled translationcomponent from cache.3,9035260,000458
    [RenderValues] set query and/or replacements3,9270170,023491
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 5 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,9270650,000048
    No caching of lanuage 38. Because it is not changed within this session.3,9272830,000218
    Cache item 'ML_38' already exists, so language is not cached again3,9273180,000035
    Session 'MlJclLanguage' set to 383,9273380,000020
    Start replace dynamic content3,9273580,000020
    Replace dynamic content only once3,9274280,000069
    End replace dynamic content3,9274340,000006
    Filled translationcomponent from cache.3,9278810,000447
    RenderStep Briefplaatfrezing connected to: brievenbuspakket - mainstepnumber: 3 - stepnumber: 6 - dependentvalue: 1 - datasource connectedid: brievenbuspakket3,9513820,023501
    [RenderValues] set query and/or replacements3,9514400,000059
    [RenderValues] Execute query3,9519440,000504
    query cachinghours: 2003,9520220,000078
    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,9520430,000020
    Open connection with DB3,9521010,000058
    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,9809020,028801
    [RenderValues] Do last replacements. Num items: 03,9809480,000046
    [RenderValues] replacements done3,9809540,000006
    RenderStep (values rendered) Briefplaatfrezing connected to: brievenbuspakket - mainstepnumber: 3 - stepnumber: 6 - dependentvalue: 1 - datasource connectedid: brievenbuspakket3,9809880,000034
    [RenderValues] set query and/or replacements3,9810500,000062
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 6 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 3,9810600,000010
    No caching of lanuage 38. Because it is not changed within this session.3,9812810,000221
    Cache item 'ML_38' already exists, so language is not cached again3,9813010,000020
    Session 'MlJclLanguage' set to 383,9813090,000008
    Start replace dynamic content3,9813290,000021
    Replace dynamic content only once3,9813870,000058
    End replace dynamic content3,9813940,000006
    Filled translationcomponent from cache.3,9818830,000489
    No caching of lanuage 38. Because it is not changed within this session.4,0065530,024670
    Cache item 'ML_38' already exists, so language is not cached again4,0066260,000073
    Session 'MlJclLanguage' set to 384,0066390,000013
    Start replace dynamic content4,0066750,000036
    Replace dynamic content only once4,0067810,000106
    End replace dynamic content4,0067910,000010
    Filled translationcomponent from cache.4,0074350,000644
    [RenderValues] set query and/or replacements4,0319680,024533
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 6 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 4,0320480,000081
    No caching of lanuage 38. Because it is not changed within this session.4,0322540,000206
    Cache item 'ML_38' already exists, so language is not cached again4,0322810,000027
    Session 'MlJclLanguage' set to 384,0322890,000008
    Start replace dynamic content4,0323150,000026
    Replace dynamic content only once4,0324040,000089
    End replace dynamic content4,0324170,000014
    Filled translationcomponent from cache.4,0330210,000603
    RenderStep Scharnierkrozingen connected to: uitvoering;draairichting;hoogte;breedte - mainstepnumber: 3 - stepnumber: 7 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte4,0610670,028046
    [RenderValues] set query and/or replacements4,0611320,000065
    [RenderValues] Execute query4,0616090,000477
    query cachinghours: 2004,0616910,000081
    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
    4,0617070,000016
    Open connection with DB4,0617550,000048
    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
    4,0973790,035624
    [RenderValues] Do last replacements. Num items: 04,0974190,000040
    [RenderValues] replacements done4,0974270,000008
    RenderStep (values rendered) Scharnierkrozingen connected to: uitvoering;draairichting;hoogte;breedte - mainstepnumber: 3 - stepnumber: 7 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte4,0974560,000030
    [RenderValues] set query and/or replacements4,0975380,000082
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 7 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 4,0975490,000011
    No caching of lanuage 38. Because it is not changed within this session.4,0977430,000194
    Cache item 'ML_38' already exists, so language is not cached again4,0977650,000023
    Session 'MlJclLanguage' set to 384,0977740,000009
    Start replace dynamic content4,0977930,000019
    Replace dynamic content only once4,0978510,000058
    End replace dynamic content4,0978570,000006
    Filled translationcomponent from cache.4,0983510,000494
    No caching of lanuage 38. Because it is not changed within this session.4,1249300,026578
    Cache item 'ML_38' already exists, so language is not cached again4,1249910,000062
    Session 'MlJclLanguage' set to 384,1250000,000009
    Start replace dynamic content4,1250440,000044
    Replace dynamic content only once4,1251180,000074
    End replace dynamic content4,1251250,000006
    Filled translationcomponent from cache.4,1256060,000482
    [RenderValues] set query and/or replacements4,1538640,028258
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 7 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 4,1539310,000066
    No caching of lanuage 38. Because it is not changed within this session.4,1541240,000193
    Cache item 'ML_38' already exists, so language is not cached again4,1541490,000025
    Session 'MlJclLanguage' set to 384,1541570,000008
    Start replace dynamic content4,1541900,000033
    Replace dynamic content only once4,1542580,000069
    End replace dynamic content4,1542650,000006
    Filled translationcomponent from cache.4,1548380,000573
    RenderStep Accessoires connected to: uitvoering;draairichting;hoogte;breedte - mainstepnumber: 3 - stepnumber: 8 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte4,1824560,027619
    [RenderValues] set query and/or replacements4,1825170,000061
    [RenderValues] Execute query4,1830360,000519
    query cachinghours: 2004,1831180,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
    );
    ### 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
    4,1831370,000018
    Open connection with DB4,1832080,000072
    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
    4,2143110,031103
    [RenderValues] Do last replacements. Num items: 04,2143500,000039
    [RenderValues] replacements done4,2143560,000006
    RenderStep (values rendered) Accessoires connected to: uitvoering;draairichting;hoogte;breedte - mainstepnumber: 3 - stepnumber: 8 - dependentvalue: 1 - datasource connectedid: uitvoering;draairichting;hoogte;breedte4,2143860,000030
    [RenderValues] set query and/or replacements4,2144390,000052
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 8 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 4,2144470,000009
    No caching of lanuage 38. Because it is not changed within this session.4,2146470,000200
    Cache item 'ML_38' already exists, so language is not cached again4,2146620,000015
    Session 'MlJclLanguage' set to 384,2146740,000012
    Start replace dynamic content4,2146970,000024
    Replace dynamic content only once4,2147630,000066
    End replace dynamic content4,2147700,000007
    Filled translationcomponent from cache.4,2152170,000447
    No caching of lanuage 38. Because it is not changed within this session.4,2400370,024820
    Cache item 'ML_38' already exists, so language is not cached again4,2401060,000069
    Session 'MlJclLanguage' set to 384,2401180,000012
    Start replace dynamic content4,2401500,000032
    Replace dynamic content only once4,2402440,000094
    End replace dynamic content4,2402510,000007
    Filled translationcomponent from cache.4,2407270,000476
    [RenderValues] set query and/or replacements4,2652060,024480
    RenderSubStep  connected to:  - mainstepnumber: 3 - stepnumber: 8 - substepnumber: 1 - dependentvalue: 1 - datasource connectedid: 4,2652650,000059
    No caching of lanuage 38. Because it is not changed within this session.4,2654490,000184
    Cache item 'ML_38' already exists, so language is not cached again4,2654730,000024
    Session 'MlJclLanguage' set to 384,2654950,000022
    Start replace dynamic content4,2655180,000023
    Replace dynamic content only once4,2655860,000069
    End replace dynamic content4,2655930,000006
    Filled translationcomponent from cache.4,2660060,000413
    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,2902140,024208
    Open connection with DB4,2903540,000140
    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,3387690,048415
    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,3392290,000461
    Open connection with DB4,3393450,000116
    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,3820680,042723
    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,3825850,000516
    Open connection with DB4,3827020,000117
    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,4267200,044019
    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,4286120,001892
    Open connection with DB4,4287490,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
                          
    4,4741480,045399
    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,4764940,002346
    Open connection with DB4,4766270,000133
    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,5159430,039317
    No caching of lanuage 38. Because it is not changed within this session.4,5170690,001125
    Cache item 'ML_38' already exists, so language is not cached again4,5171060,000037
    Session 'MlJclLanguage' set to 384,5171150,000009
    Start replace dynamic content4,5181740,001060
    Replace dynamic content only once4,5206190,002445
    End replace dynamic content4,5206560,000037
    Filled translationcomponent from cache.4,5212120,000556
    Start replacing system objects4,5562140,035002
    Start replacing translation4,5647950,008581
    Start replacing objects4,5655410,000746
    Start replacing request4,5663680,000828
    Start replacing session4,7589650,192597
    Start replacing standards4,7715970,012632
    Start replacing objecs again4,7730480,001451
    aspx.pageEnd Render4,7957420,022694

    Control Tree

    Control UniqueIDTypeRender Size Bytes (including children)ViewState Size Bytes (excluding children)ControlState Size Bytes (excluding children)
    __PageASP.homepage_aspx25268800
        ctl00System.Web.UI.HtmlControls.HtmlHead77400
            ctl01System.Web.UI.HtmlControls.HtmlMeta2400
            ctl02System.Web.UI.HtmlControls.HtmlMeta7000
            ctl03System.Web.UI.HtmlControls.HtmlMeta4500
            LiteralTagmanagerCodeSystem.Web.UI.WebControls.Literal6000
            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_SessionId3u2vlio1fw4jlj2fyqhe43er42
    CurrentDomainhubo.cando.eu27

    Headers Collection

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

    Response Headers Collection

    NameValue
    Cache-Controlprivate
    Content-Typetext/html

    Form Collection

    NameValue

    Querystring Collection

    NameValue
    configuratorvoordeuren

    Server Variables

    NameValue
    ALL_HTTPHTTP_CACHE_CONTROL:max-age=0 HTTP_CONNECTION:close HTTP_VIA:1.1 squid-proxy-5b96dc6d46-p97xt (squid/6.13) HTTP_CONTENT_LENGTH:0 HTTP_ACCEPT:*/* HTTP_ACCEPT_ENCODING:gzip, br, zstd, deflate HTTP_HOST:hubo.cando.eu HTTP_USER_AGENT:Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) HTTP_X_FORWARDED_FOR:10.10.77.56, 216.73.216.242 HTTP_X_FORWARDED_PROTO:http
    ALL_RAWCache-Control: max-age=0 Connection: close Via: 1.1 squid-proxy-5b96dc6d46-p97xt (squid/6.13) Content-Length: 0 Accept: */* Accept-Encoding: gzip, br, zstd, deflate Host: hubo.cando.eu User-Agent: Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com) X-Forwarded-For: 10.10.77.56, 216.73.216.242 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
    REMOTE_ADDR89.41.168.5
    REMOTE_HOST89.41.168.5
    REMOTE_PORT34662
    REQUEST_METHODGET
    SCRIPT_NAME/homepage.aspx
    SERVER_NAMEhubo.cando.eu
    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-p97xt (squid/6.13)
    HTTP_CONTENT_LENGTH0
    HTTP_ACCEPT*/*
    HTTP_ACCEPT_ENCODINGgzip, br, zstd, deflate
    HTTP_HOSThubo.cando.eu
    HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
    HTTP_X_FORWARDED_FOR10.10.77.56, 216.73.216.242
    HTTP_X_FORWARDED_PROTOhttp

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