<?xml version="1.0" encoding="UTF-8"?>
<data>
<!-- BEGIN LOOP -->
<post>
<ID>{ID}</ID>
<Title>{Title}</Title>
<Sku>{Sku}</Sku>
<AliUrl>https://www.aliexpress.com/item/[replaceurlstr({Title})]/{Sku}.html</AliUrl>
</post>
<!-- END LOOP -->
</data>
<?php
function replaceurlstr($Title){
$Title = preg_replace('/\s+/', '-', $Title);
return $Title;
}
?>
<AliUrl>https://www.aliexpress.com/item/[replaceurlstr({Title})]/{Sku}.html</AliUrl>
<AliUrl>https://www.aliexpress.com/item/{Title}/{Sku}.html</AliUrl>
This is for the product url only
Extra:
if for some reason the export stuck, do not use php code at all and changetoCode:<AliUrl>https://www.aliexpress.com/item/[replaceurlstr({Title})]/{Sku}.html</AliUrl>
Code:<AliUrl>https://www.aliexpress.com/item/{Title}/{Sku}.html</AliUrl>
after that open excel and:
1. check the entire column "aliurl"
2. open search and replace dialog and replace spaces with "-"
After that you will se that the 90% of the urls working and you can visit to make whatever you want, also if you want a specific job, eg to categorize your already imported products, you can use a vba macro that automatically visit link by link and copy/paste categories.
of course this is an example, you can use the product type custom field if you want to categorize your products....
I am writing a macro for that, I will post it in the near future....
cheers
Hi! I tried your code on WP All Export but i can't make it work right. Upon PREVIEW, i receive multiple result for the same product but only the first result has SKU value.
Can i have your full code to export your products? Thanks!
<AliUrl>https://www.aliexpress.com/item/{Title}/{Sku}.html</AliUrl>
<?xml version="1.0" encoding="UTF-8"?>
<data>
<!-- BEGIN LOOP -->
<post>
<id>{ID}</id>
<Title>{Title}</Title>
<Sku>{Sku}</Sku>
<AliUrl>https://www.aliexpress.com/item/{Title}/{Sku}.html</AliUrl>
<ProductAttributes>{Product Attributes}</ProductAttributes>
</post>
<!-- END LOOP -->
</data>
a:7:{s:10:"brand-name";a:6:{s:4:"name";s:10:"Brand Name";s:5:"value";s:9:"HUAMIANLI";s:8:"position";i:0;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:9:"item-type";a:6:{s:4:"name";s:9:"Item Type";s:5:"value";s:10:"Toothpaste";s:8:"position";i:1;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:10:"ingredient";a:6:{s:4:"name";s:10:"Ingredient";s:5:"value";s:9:"maquiagem";s:8:"position";i:2;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:6:"net-wt";a:6:{s:4:"name";s:6:"NET WT";s:5:"value";s:4:"100g";s:8:"position";i:3;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:8:"quantity";a:6:{s:4:"name";s:8:"Quantity";s:5:"value";s:10:"toothpaste";s:8:"position";i:4;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:9:"age-group";a:6:{s:4:"name";s:9:"Age Group";s:5:"value";s:6:"Adults";s:8:"position";i:5;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:12:"model-number";a:6:{s:4:"name";s:12:"Model Number";s:5:"value";s:15:"diagnostic-tool";s:8:"position";i:6;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}}
Actually i tried your xml code and import it to my another websites, it created lots of post/product. Ithink it created more than 5 post/product with the same product title. How can I update the product based on SKU without happening this?Thas is because the preview function only shows you 10 products and your first product has 9 more variations but only the main product has sku.
I believe that is the problem.
Forget the php code and use only this on xml (between <post></post> tags):after that open excel and:Code:<AliUrl>https://www.aliexpress.com/item/{Title}/{Sku}.html</AliUrl>
1. check the entire column "aliurl"
2. open search and replace dialog and replace spaces with "-"
you will see that the 90% of the urls working and you can visit to make whatever you want
extra!!!
If you want also to export variations of your products use:
Code:<?xml version="1.0" encoding="UTF-8"?> <data> <!-- BEGIN LOOP --> <post> <id>{ID}</id> <Title>{Title}</Title> <Sku>{Sku}</Sku> <AliUrl>https://www.aliexpress.com/item/{Title}/{Sku}.html</AliUrl> <ProductAttributes>{Product Attributes}</ProductAttributes> </post> <!-- END LOOP --> </data>
after that open excel check the entire variation column and open "Search and Replace" dialog
if you want eg the brand name and the cell values it's like this:Code:a:7:{s:10:"brand-name";a:6:{s:4:"name";s:10:"Brand Name";s:5:"value";s:9:"HUAMIANLI";s:8:"position";i:0;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:9:"item-type";a:6:{s:4:"name";s:9:"Item Type";s:5:"value";s:10:"Toothpaste";s:8:"position";i:1;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:10:"ingredient";a:6:{s:4:"name";s:10:"Ingredient";s:5:"value";s:9:"maquiagem";s:8:"position";i:2;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:6:"net-wt";a:6:{s:4:"name";s:6:"NET WT";s:5:"value";s:4:"100g";s:8:"position";i:3;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:8:"quantity";a:6:{s:4:"name";s:8:"Quantity";s:5:"value";s:10:"toothpaste";s:8:"position";i:4;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:9:"age-group";a:6:{s:4:"name";s:9:"Age Group";s:5:"value";s:6:"Adults";s:8:"position";i:5;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}s:12:"model-number";a:6:{s:4:"name";s:12:"Model Number";s:5:"value";s:15:"diagnostic-tool";s:8:"position";i:6;s:10:"is_visible";i:1;s:12:"is_variation";i:0;s:11:"is_taxonomy";i:0;}}
you can delete everything before "Brand Name"
search for: *"Brand Name"
replace with: "Brand Name"
then you must delete everything after: "HUAMIANLI"
and how you can do that????
search for: *;s:
replace with nothing
be careful, some cells may be different, so you will have 2 use search and replace 2 times, just think a clever way and you will have your results.
cheers to everybody