i’ve XML with data, that contains information about tax.
I created 2 tax classes with WooCommerce:
Standard – 23% and Reduced Rate – 8%
My XML contains value of the tax – ex. 8
I need to change class tax based on that value.
XML looks like that:
<product>
<tax>
<value>8</value>
</tax>
</product>
How can i achive that with Xpath? Or maybe it is another way to do it?
Regards
]]>I want to use multiple elements on a function.
Xml Elements
<subCategory>K?pek</subCategory>
<kategorialt>K?pek Bak?m Sa?l?k</kategorialt>
Xpath Function
[category_replace(array({subCategory[1]},{kategorialt[1]}))]
Output
-Array
Any ideas or advice on where I went wrong?
Thank you!
]]>
"product_categories" : [
{ "name":"Category 1", "description":"Lorem ipsum dolor sit amet", "slug":"category-1" },
{ "name":"Category 2", "description":"Lorem ipsum dolor sit amet", "slug":"category-2" },
...
],
or
<ProductCategories>
<ProductCategory>
<Name>Category 1</Name>
<Description>Lorem ipsum dolor sit amet</Description>
<Slug>category-1</Slug>
</ProductCategory>
<ProductCategory>
<Name>Category 2/Name>
<Description>Lorem ipsum dolor sit amet</Description>
<Slug>category-2</Slug>
</ProductCategory>
</ProductCategories>
So far I’ve had to set up separate imports to get the terms imported directly into a Taxonomy to pull the other data for the taxonomy terms and match them with the comma-separated names, but it would be much more efficient to be able to get this information through the WooCommerce add-on in one feed as Products are the only post type needed.
]]>When using simple Xpath get value by attribute name {attrs/a[@name="Rozmiar pier?cionków"]}
it doesnt work because it contains non-standard character ? ó . I couldnt wrap my head around it.
After long searching I found https://gist.github.com/trey8611/7b6e79e6610f9d2b06257fb570f05e03 “WP All Import – use XPath Query based on Cyrillic attribute value” from trey8611.
So for example: Rozmiar pier?cionków
Encoded with https://mothereff.in/html-entities
(Enable option “only encode unsafe and non-ASCII characters”)
Rozmiar pier?cionków => Rozmiar pierś ;cionkó ;w"
(I added spaces before ; because it would auto decode here even inside code block)
!!! PASTING IT IN DESCRIPTION VISUAL TEXT EDITOR BREAKS IT
!!! CHANGE FIRST TO TEXT EDITOR IN WP ALL IMPORT
Different results:
0 {attrs/a/@name} --- Rozmiar pier?cionków --- Correct test
1 {attrs/a[@name="Rozmiar pier?cionków"]} --- Doesnt work
2 {attrs/a[@name="Rozmiar pierś ;cionkó ;w"]} --- US8 EU17 --- Correct working answer!
3 {attrs/a[@name="Rozmiar pier&sacute ;cionkó ;w"]} --- Doesnt work
4 {attrs/a[@name="R ;o ;z ;m ;i ;a ;r ;  ;p ;i ;e ;r ;ś ;c ;i ;o ;n ;k ;ó ;w"]} --- Doesnt work
(I added spaces before ; because it would auto decode here even inside code block)
Works for cyrillic characters too.
Happy imports ??
]]>If there is a comma, the filter system will not work to show more prices.
“10” works.
“10.00” works.
“10,00” does not work. “There are no elements to import based on your XPath.”
Trieds: /item[price1[1] >= 10]
/item[price1[1] >= 10,00]
Below are a few sample products.
<?xml version="1.0"?>
<Products>
<Product>
<Code>7410000428901</Code>
<ProductType>As?l</ProductType>
<MainProductCode/>
<Barcode>74100004289012</Barcode>
<UnitInStock>6</UnitInStock>
<IsActive>1</IsActive>
<ModelNumber>HBCV000013B5HJ</ModelNumber>
<Mark>ModaCar</Mark>
<ProductName>ModaCar Magnus Trafik Emniyet Seti 428901</ProductName>
<Description> </Description>
<Price>50,00</Price>
<Currency>YTL</Currency>
<Vat>18</Vat>
<Desi>1</Desi>
<MainGroupCode>21130</MainGroupCode>
<MainGroup>ARAC AKSESUAR</MainGroup>
<EndGroupCode>12954</EndGroupCode>
<EndGroup>Trafik Yol Yard?mc? ürünler</EndGroup>
<PictureCode>https://www.arabayaservis.com/productimages/175176/big/7410000428901.jpg</PictureCode>
</Product>
<Product>
<Code>7410000428899</Code>
<ProductType>As?l</ProductType>
<MainProductCode/>
<Barcode>74100004288991</Barcode>
<UnitInStock>12</UnitInStock>
<IsActive>1</IsActive>
<ModelNumber>HBCV00001338WW</ModelNumber>
<Mark>ModaCar</Mark>
<ProductName>ModaCar 7.9 mm 1 Metrekare Oto Ses Is? Yal?t?m Levhas? 428899</ProductName>
<Description> </Description>
<Price>40,00</Price>
<Currency>YTL</Currency>
<Vat>18</Vat>
<Desi>1</Desi>
<MainGroupCode>21130</MainGroupCode>
<MainGroup>Mutfak ürünleri</MainGroup>
<EndGroupCode>14735</EndGroupCode>
<EndGroup>Ara? Kap? Koruyucu</EndGroup>
<PictureCode>https://www.arabayaservis.com/productimages/175173/big/7410000428897.jpg</PictureCode>
</Product>
<Product>
<Code>7410000427620</Code>
<ProductType>As?l</ProductType>
<MainProductCode/>
<Barcode>7410000427620</Barcode>
<UnitInStock>1</UnitInStock>
<IsActive>1</IsActive>
<ModelNumber>HBV00000QJO5H</ModelNumber>
<Mark>ModaCar</Mark>
<ProductName>Modacar Vogue Spralli Aux Kablosu 427620 </ProductName>
<Description> </Description>
<Price>30,00</Price>
<Currency>YTL</Currency>
<Vat>18</Vat>
<Desi>1</Desi>
<MainGroupCode>21360</MainGroupCode>
<MainGroup>Mutfak ürünleri</MainGroup>
<EndGroupCode>21359</EndGroupCode>
<EndGroup>AUX Kablo ve D?nü?türücü</EndGroup>
<PictureCode>https://www.arabayaservis.com/productimages/175162/big/7410000427620.jpg</PictureCode>
</Product>
<Product>
<Code>7460000715810</Code>
<ProductType>As?l</ProductType>
<MainProductCode/>
<Barcode>7460000715810</Barcode>
<UnitInStock>6</UnitInStock>
<IsActive>1</IsActive>
<ModelNumber>7460000715810</ModelNumber>
<Mark>HomeCare</Mark>
<ProductName>HomeCare Rolland Lavabo A??c? Pratik 715810 6 l? ?ndirimli Paket</ProductName>
<Description> </Description>
<Price>20,00</Price>
<Currency>YTL</Currency>
<Vat>18</Vat>
<Desi>1</Desi>
<MainGroupCode>21141</MainGroupCode>
<MainGroup>Mutfak ürünleri</MainGroup>
<EndGroupCode>21248</EndGroupCode>
<EndGroup>Lavabo A??c? ve T?ka?lar</EndGroup>
<PictureCode>https://www.arabayaservis.com/productimages/184969/big/7430000715810.jpg</PictureCode>
</Product>
<Product>
<Code>7460000715493</Code>
<ProductType>As?l</ProductType>
<MainProductCode/>
<Barcode>7460000715493</Barcode>
<UnitInStock>6</UnitInStock>
<IsActive>1</IsActive>
<ModelNumber>HBCV000014GX1G</ModelNumber>
<Mark>Transformacion</Mark>
<ProductName>Transformacion Cecilio Saya?l? ?p Atlama Lasti?i 715493 6 LI ?ND?R?ML? PAKET</ProductName>
<Description> </Description>
<Price>10,00</Price>
<Currency>YTL</Currency>
<Vat>18</Vat>
<Desi>1</Desi>
<MainGroupCode>21201</MainGroupCode>
<MainGroup>Mutfak ürünleri</MainGroup>
<EndGroupCode>21107</EndGroupCode>
<EndGroup>Spor</EndGroup>
<PictureCode>https://www.arabayaservis.com/productimages/178027/big/7430000715493.jpg</PictureCode>
</Product>
</Products>
]]>How can figure out the problem? Thanks.
]]>I have an element <CloseDate>01202020</CloseDate> that is written in DDYMMYYYY format. I only want to import posts that have a close date after 00002021 (that is, from the year 2021 onwards.)
How do I do this with the available filters in Wp All Import?
For example, I tried the greater than 00002021 but an old post from 1999 will still get imported because the number 01001999 is larger than 00002021.
I also tried greater than ends with 2020$ but that didn’t work.
Suggestions?
Thanks for the plugin.
]]><PRODUCT ITEM=”WHCHEAMAR” NAME=”Passion Amara Chemise”>
<STOCK Size=”S/M”>In Stock</STOCK>
<STOCK Size=”L/XL”>In Stock</STOCK>
<STOCK Size=”XXL/XXXL”>In Stock</STOCK>
</PRODUCT>
Kindly assist.
Thank you.
]]>