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 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
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
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. 🙂
Out of the box
Product Importer Deluxe detects the
WooCommerce Brands Addon,
WooCommerce 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
View Code