What are the Slack Archives?

Itโ€™s a history of our time together in the Slack Community! Thereโ€™s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you wonโ€™t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Hallo all, How can we make Spryker generate URLs for store that has two english locales? like en_GB

UM9F81RCP
UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

Hallo all,
How can we make Spryker generate URLs for store that has two english locales? like en_GB and en_IE,

ยซ1

Comments

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    You must have those locales defined for your stores and also your data must have a value for those locales
    โ€ข CMS pages
    โ€ข Products
    โ€ข etc.

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    yeah but in stores.php the key for locale array is language

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet
        'locales' => [
            'en' => 'en_GB',
            'en' => 'en_IE', // <- ????
    
        ],
    
  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    you could define whatever you want as key there, we use it for shortcut

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    I see

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    thank you Jeremy ๐Ÿ™‚

  • Jeremy Fourna
    Jeremy Fourna Lead Product Manager Posts: 130 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    yrw

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    one more question please ๐Ÿ˜… how would dropping unique indexfrom url column in spy_url affect the applicaiton behaviour?

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    u can override spy_url.schema.xml in pyz level and u can overwrite the unique index or remove it for example.

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    I know I can do that ๐Ÿ˜… my concern is what would be the consequences of that!?

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    you won't get where you might expect? as the first occurence of url might be used afterwards

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    so you think it is safe?

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    I cant read your thoughts, sorry

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    what do you try to achieve with dropping unique constraint?

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    I want a different URL based on locale not language

  • Ievgen Varava
    Ievgen Varava Sprykee Posts: 154 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    then make it different and stick to unique constraint

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    i had for example the unique key extended with fk_locale too and everything worked fine..

    because in the case u have two store with same language and same url then the actual schema does not work

    They are already based on locale and not language.. the problem is only in stores.php

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    I was thinkning the same but doing this will require a lot of data manipulation on my import files because I have big files โ€ฆ I was thinking maybe we can do somehting on app level

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    @UL65CH0MC how did you address the problem in stores.php?

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    one mom.. let me see in my old project..

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    thanks a lot

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    ok, i dont' have any store with two same language..

    i have only for example FR Store with fr_FR locale and CH Shop with fr_CH locale too..

    it means with the change of unique key it was possible in my shop have the same url /fr/blabla in spy_url table but for two different locales.. but unfortunately i dont have the same language for the same store...

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    i have only for example FR Store with fr_FR locale and CH Shop with fr_CH locale too..

    I have similar problem ๐Ÿ˜„

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    but i think u need two different language.. therefore it is as key in stores.php because the language is used to recognize the language via url...

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    actually the same

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    then it is enough to extend the unique key in db..

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    ok I will try that

  • UM9F81RCP
    UM9F81RCP Posts: 516 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    thank you very much ๐Ÿ™‚

  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    so i had in my old project

    <?xml version="1.0"?>
    <database xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" name="zed" xsi:noNamespaceSchemaLocation="<http://static.spryker.com/schema-01.xsd>" namespace="Orm\Zed\Url\Persistence" package="src.Orm.Zed.Url.Persistence">
    
        <table name="spy_url" phpName="SpyUrl">
            <unique name="spy_url_unique_key">
                <unique-column name="url"/>
                <unique-column name="fk_locale"/>
            </unique>
        </table>
    </database>
    
  • giovanni.piemontese
    giovanni.piemontese Technical Lead @ Lรถffelhardt Spryker Solution Partner Posts: 871 ๐Ÿง‘๐Ÿปโ€๐Ÿš€ - Cadet

    please check if name etc... still the same are