Search Documentation

Code snippets allow you to override the default behavior of Product Importer Deluxe by hooking into the Plugin code.

Adding a custom Product import field to Product Importer Deluxe

Adding a custom Product import field to Product Importer Deluxe is a little more complex than adding a custom Product export field like in Store Exporter Deluxe but it's still doable. Note: I've made a task to make it as easy to add custom Product import fields to Product Importer Deluxe as we do in Store Exporter Deluxe. This will be introduced as part of the new Store Importer Deluxe Plugin (replacing Product Importer Deluxe as a free upgrade to existing customers) and after support for this new Plugin has stabilised. First we need to add the custom Product import field to the initial import screen and then inform Product Importer Deluxe of how to prepare that data for saving against new Products if present. Add the following PHP snippet to your current WordPress Theme’s functions.php file: View Code

Convert custom Product Type values to standard Product Types in Product Importer Deluxe

It may be necessary to take a custom Product Type value out of an import file and convert it to a WooCommerce accepted Product Type (e.g. Simple Product, External, Virtual, Variable, Variation, etc.). We can do this by making use of the exposed WordPress Filter woo_pd_is_valid_product_type that runs during the import process. Add the following PHP snippet to your current WordPress Theme’s functions.php file: View Code

Link custom Product Types to WooCommerce Product Types when importing

To link a custom Product Type (e.g. "Variabile" to "Variable" or "Simple Product" to "Simple") so that Product Importer Deluxe can correctly set the Product Type add the following PHP snippet to your current WordPress Theme's functions.php file: View Code Note: This will be the last code snippet published on the Visser Labs Blog, code snippets will be moving to a Custom Post Type in the near future; existing links will remain intact. 🙂

Override the default Product Brand Term Taxonomy detection in Product Importer Deluxe

Out of the box Product Importer Deluxe detects the WooCommerce Brands AddonWooCommerce Brands Plugin or 'product_brand' Term Taxonomy slug and unlocks the Brands import type and Brand filters. Where we get stuck is detecting the Brands import type within WordPress Theme's that do not make use of the WordPress standard 'product_brand' Term Taxonomy slug. You can override the default Term Taxonomy that we check for Product Brands by adding the following PHP snippet to your current WordPress Theme’s functions.php file: View Code

Override the imported image filename when dealing with dynamic URL's and replace the file extension

View Code