These are the web feed versions of example files from http://www.wpallimport.com/documentation/woocommerce/example-files/
#!/bin/bash | |
# Dropbox linux install | |
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf - | |
wget -O dropbox.py https://www.dropbox.com/download?dl=packages/dropbox.py | |
chmod +x dropbox.py | |
# comment3 |
Sometimes you might need to look up the attachment id for an imported image (or other media library file) to accommodate a third party plugin. You can use this code in the function editor.
/* Returns attachment ID for the given filename, path or URL. Argument can be a
* URL or local file path because this will only look at the file basename. Ex - These
* would return the same thing:
* $id = img_id("myfile.jpg");
* $id = img_id("http://domain.com/images/myfile.jpg");
*/
function att_id($image_filename) {
<?php | |
// Redirect browser to the WP All Export feed of your choice. Just put the correct URL below. | |
// Note: Anyone could access your data if they guess the URL of this script. You can gain a little protection by naming | |
// it something "unguessable". For proper security you should use an .htaccess rule or other mechanism. | |
// Disclaimer: This is provided with the hope it will be useful but custom PHP is not officially supported. | |
$url = "http://example.com/wp-cron.php?export_hash=ed5a94029a05b1c9&export_id=1&action=get_data"; | |
header("Location: $url"); |
<?php | |
// Note: Anyone could access your data if they guess this URL. You should remove this file from the server | |
// after importing or name it to something "unguessable". For even better security use an .htaccess rule. | |
// | |
// If you're experiencing problems you can uncomment the following line so errors will be sent to the file. | |
// ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); | |
// | |
// Enter the FTP (or HTTP) URL of your data file below. | |
$url = "ftp://username:password@hostname.com/full/path/to/file.csv"; |
<?php | |
/* | |
* Totally simple way to dump an Airtable to CSV. | |
* Uses https://github.com/sleiman/airtable-php | |
*/ | |
// When true, first field is the row number (starting with 1) | |
define("NUMBER_OUTPUT_ROWS", true); |
When an image is imported, the name used in the media library is derived from the URL "basename". This can cause problems, especially when using the option "Search through the Media Library for existing images before importing new images". For example, even though they are different images, these URLs all have the same "basename" (in bold). They will generate the same file my-image.jpg
in the WordPress library:
http:// example.com/ my-image.jpg
http:// example.com/ my-image?id=1
http:// example.com/subfolder/ my-image.jpg
The solution is to put this PHP code in your function editor:
function fix_img_url($url){
Here are some example WP All Import [IF] statements. The criteria for an IF statment is written in XPath 1.0 syntax and can use XPath functions. Although powerful, XPath syntax can be quite complex. In many cases it might be easier to use a PHP function as shown here.
Note: The [ELSE]<something>
part is optional
[IF({price[.=0]})]Zero[ELSE]Not Zero[ENDIF]