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

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,

Welcome!

It looks like you're new here. Sign in or register to get started.
Β«1

Comments

  • 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.

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet
        'locales' => [
            'en' => 'en_GB',
            'en' => 'en_IE', // <- ????
    
        ],
    
  • Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    I see

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    thank you Jeremy πŸ™‚

  • Lead Product Manager Posts: 130 πŸ§‘πŸ»β€πŸš€ - Cadet

    yrw

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • 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.

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    so you think it is safe?

  • Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    I cant read your thoughts, sorry

  • Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    what do you try to achieve with dropping unique constraint?

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    I want a different URL based on locale not language

  • Sprykee Posts: 154 πŸ§‘πŸ»β€πŸš€ - Cadet

    then make it different and stick to unique constraint

  • 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

  • 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

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    thanks a lot

  • 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...

  • 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 πŸ˜„

  • 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...

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    actually the same

  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

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

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok I will try that

  • Posts: 516 πŸ§‘πŸ»β€πŸš€ - Cadet

    thank you very much πŸ™‚

  • 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>
    
  • Technical Lead @ LΓΆffelhardt Spryker Solution Partner Posts: 871 πŸ§‘πŸ»β€πŸš€ - Cadet

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

Welcome!

It looks like you're new here. Sign in or register to get started.