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 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 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 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 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 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 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 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 Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

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