Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editing product not save slug for each locale #9040

Closed
1 task done
ghena opened this issue Nov 26, 2023 · 3 comments
Closed
1 task done

editing product not save slug for each locale #9040

ghena opened this issue Nov 26, 2023 · 3 comments
Assignees
Labels
Done When enhancement is done. Feature Request Issues filed as feature requests.

Comments

@ghena
Copy link

ghena commented Nov 26, 2023

Terms

  • Before you openning this issue, i have checked if the issue has already been reported.

Bagisto Version(s) affected

2.0.

Issue Description

Add a product in the default language.
Assume you have at least 2 locales enabled.

Edit the product.
switch on not default locale and alter url_key.

The url_key saved is equal to the default locale.
So the new url_key is not saved in the product_attribute_values table

Preconditions

assume you have at least 2 locales enabled.

Steps to reproduce

Add a product and assume you have at least 2 locales enabled.
switch on not default locale and alter url_key.

The url_key saved is equal to the default locales.
So the new url_key is not saved in the product_attribute_values table

Expected Result

new url key for the current locales is saved on the product_attribute_values table

Actual Result

the url_key submitted is not saved

Screenshots

No response

Additional context

No response

@ghena ghena added the Bug Something isn't working. label Nov 26, 2023
@jitendra-webkul jitendra-webkul added Feature Request Issues filed as feature requests. and removed Bug Something isn't working. labels Dec 1, 2023
@vitalijalbu
Copy link

I also have this issue, changed locale from EN to IT and product disappeared

@devansh-webkul
Copy link
Member

Hi @ghena,

As of now, you can change the attribute of the url_key to locale based from the database. We will provide this feature in our next release.

@jitendra-webkul
Copy link
Member

Implemented in PR #9833. This implementation will work only with new or fresh databases. Existing databases will continue to function as before, meaning url_key will remain non-locale based because all the product attribute values and the attribute itself are non-locale based.

If you want url_key to be locale-based in the existing database, follow these manual steps:

  1. Update the value_per_locale column to 1 for the attribute with id = 3 or code = url_key in the attributes table. This step will convert the url_key attribute to be locale-based.

  2. Convert the url_key attribute saved in product_attribute_values to be locale-based by running the following query on the database:

    UPDATE product_attribute_values
    SET locale = 'en',
        unique_id = CONCAT_WS('|', channel, 'en', product_id, attribute_id)
    WHERE attribute_id = 3;

Ensure you update your default locale accordingly in the above query.

@jitendra-webkul jitendra-webkul added the Done When enhancement is done. label May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done When enhancement is done. Feature Request Issues filed as feature requests.
Projects
None yet
Development

No branches or pull requests

4 participants