A simple query to set the first combination of products as default.
The query will only work for products that do not have any the combination set as the default.
SET `default_on` = 1
WHERE `id_product_attribute` IN (
WHERE `id_product` IN (
FROM `ps_product_attribute` pa
WHERE 0 = (
WHERE `default_on` = 1 AND `id_product` = pa.`id_product`
GROUP BY pa.`id_product`
GROUP BY `id_product`
By default when you use entity field
DateTimeType the date is saved in default timezone configured in your php configuration. Sometimes we need to show and manage dates from database in different timezones.
Using code placed below, date in the database will be saved in UTC +00:00 and during every insert/update data, dates will be converted into this timezone. Every time when you will load data from database, dates will be converted into user defined timezone.
How to do this:
Continue reading Symfony, Doctrine – Manage user timezone
To set the deepest category assigned to the product as the default you need to do:
- Open your database (for example by phpMyAdmin)
- I suggest you create backup of your database for safety (export data and structure)
- Open SQL tab and perform these queries Continue reading [Prestashop] Set the deepest category assigned to the product as the default