Skip to content

Instantly share code, notes, and snippets.

@unlocomqx
Last active March 27, 2025 04:50
Show Gist options
  • Save unlocomqx/6181e322ae68c4d69988b17fd540d443 to your computer and use it in GitHub Desktop.
Save unlocomqx/6181e322ae68c4d69988b17fd540d443 to your computer and use it in GitHub Desktop.
# update id_module because it has changed after the new installation
UPDATE `pr_customized_data`
SET `id_module` = (SELECT `id_module` FROM `pr_module` WHERE `name` = 'dynamicproduct')
WHERE `id_module` = 96
# many rows are missing from the dynamicproduct_input table. To find the orders that have data
SELECT o.id_order, i.id_input, c.id_cart FROM `pr_cart` c
JOIN `pr_orders` o ON o.id_cart = c.id_cart
JOIN `pr_dynamicproduct_input` i ON i.id_cart = c.id_cart
ORDER BY c.id_cart DESC
# many fields do not have an Italian translation in the `dynamicproduct_field_lang` table, to find them
SELECT f.id_field FROM `pr_dynamicproduct_field` f
LEFT JOIN pr_dynamicproduct_field_lang fl ON fl.id_field = f.id_field AND fl.id_lang = 2
WHERE fl.id_lang IS NULL
# to add the missing translations, run the query
INSERT INTO pr_dynamicproduct_field_lang (
SELECT id_field, 2 as id_lang, label, `value`, short_description, description, placeholder FROM pr_dynamicproduct_field_lang WHERE id_field IN (
SELECT f.id_field FROM pr_dynamicproduct_field f
LEFT JOIN pr_dynamicproduct_field_lang fl ON fl.id_field = f.id_field AND fl.id_lang = 2
WHERE fl.id_lang IS NULL
) AND id_lang = 1)
# I also updated the module to version 3.22.34 which fixes an issue when the field is marked as deleted
# Test order that has the complete data 884
# https://20250127.polypiu.shop/lj8ba5g63ove3qqm/index.php/sell/orders/884/view
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment