cauta in baza de date specificatii tehnice (campuri custom) si incocuieste valoarea la cele care se portrivesc cu cautarea specifica la toate produsele dintr-o categorie
Partea de cautare
SELECT p.ID, p.post_title, pm.meta_value FROM wp_posts p INNER JOIN wp_postmeta pm ON p.ID = pm.post_id INNER JOIN wp_term_relationships tr ON p.ID = tr.object_id INNER JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'product_cat' AND tt.term_id = [id categorie] WHERE p.post_type = 'product' AND pm.meta_key LIKE 'specificatii_tehnice%' AND pm.meta_value = '[CAUTAREA SPECIFICA]';
Partea de inlocuire
UPDATE wp_postmeta pm INNER JOIN wp_posts p ON pm.post_id = p.ID INNER JOIN wp_term_relationships tr ON p.ID = tr.object_id INNER JOIN wp_term_taxonomy tt ON tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'product_cat' AND tt.term_id = [id categorie] SET pm.meta_value = 'Panou fotovoltaic Longi' WHERE p.post_type = 'product' AND pm.meta_key LIKE 'specificatii_tehnice%' AND pm.meta_value = '[CAUTAREA SPECIFICA]';
e-mail: office@allfix.ro
PALMQ CREATION SYSTEM SRL
Reg. com: J18/57/2022
CIF: 45479630
Adresa: Aleea Smirdan, Nr.8, Targu Jiu, Jud. Gorj