I have a script in php that updates my prices via csv upload. All good except the products that are not on sale.
I have update on :
_regular_price – works fine
_price – works fine
_sale_price – working only on products that already have an discount.
My query for _sale_price update is :
$query = ”
UPDATE wp3l_postmeta
SET
meta_value = ‘$saleprice’
WHERE wp3l_postmeta.meta_key = ‘_sale_price’ AND wp3l_postmeta.post_id = (SELECT post_id FROM wp3l_postmeta WHERE wp3l_postmeta.meta_key = ‘_sku’ AND wp3l_postmeta.meta_value = ‘$product_id’)
“;
The query works fine, but its imposible to update the products that do not have an active discount. In database is missing _sale_price if the product has no discount, and my update cant run.
How can i fix this? Dunno how to create _sale_price for the products that have no discount on site, but in my csv will have a discount.
wordpress version 5.5.3
woocommerce version 4.3.2
(The new prices are in a .csv)
Thanks !!
]]>If i use an old product as a temp?ate, it won’t update the price, everything else updates just fine.
First i thought it was a cache issue, but i have disable everything and it won’t work. Any idea?
Versión de WC: 3.0.4
Directorio de registros con permiso de escritura: /var/www/domain.ltd/web/wp-content/uploads/wc-logs/
Versión de WP: 4.7.4
WordPress Multisitio: –
Límite de memoria WP: 256 MB
Modo de depuración de WP: –
WP Cron:
Idioma: es_ES
Información del servidor: Apache/2.4.7
Versión de PHP: 7.0.18
PHP post max size: 30 MB
PHP time limit: 30
PHP max input vars: 1000
Versión cURL: 7.35.0, OpenSSL/1.0.1f
]]>the same i want to make for website, it should be able to add/edit products, show results, update prices, by state wise, date wise, year wise, category wise.
exactly the same i want to make in WordPress.
If it is there any Plugin or any customisation???
Regards,
Jeff