Basic usage procedures

Basic usage procedures

Interesting extensions

How to purge data

There are plugins that can do this:

but they are very slow as they are NOT using direct SQL commands.

Importing CSV or XML data

Using WP All Import plugin

Importing / Taxt Classes

Use Woocommerce slugs for Tax Classes: standard, reduced-rate or zero-rate.

Importing / Images

I decided to make a SEO friendly image filenames, so I needed an extra function to create unique filename:

<?php

function slugify($text, $delimiter = '-') {
  $url = iconv('UTF-8', 'ASCII//TRANSLIT', $text);
  $url = preg_replace("/[^a-zA-Z0-9\/_|+ -]/", '', $url);
  $url = strtolower(trim($url, '-'));
  $url = preg_replace("/[\/_|+ -]+/", $delimiter, $url);
  return $url;
}

function slugify_product_image_filename($title, $sku) {
  return slugify($title) . '_' . slugify($sku);
}

?>
date 19. Oct 2015 | modified 10. Jun 2024
filename: Woo » Usage