Importing Queries – Help

Closed

Import WP Addon - WooCommerce Updated 3 months ago 2 Replies

Callum asked 4 months ago on August 2, 2024 at 6:05 pm

Hi James, can get the dataset from the XML file to upload absolutely fine although I’m in a bit of pickle with two specifics.

Categories/Taxonomies

Product Range

The hierarchical brands of the product on Taylors, parent terms are separated with “>”. Product will only be assigned to a single brand hierarchy. e.g. “Football>Premier League>Liverpool FC”

Product Brand

The hierarchical range (category) of the product on Taylors, parent terms are separated with “>”. Product may be assigned to multiple ranges. Multiple ranges are separated with a “|” e.g. “Clothing & Accessories>Hats | Clothing & Accessories>Headwear”

I think I’m doing the range and brand right, but I still get some categories where it’s ‘Product Brand|Other Level’ if that makes sense. I just want to make sure there’s no duplicated categories or one’s where it has that ‘|’ divider which often causes the duplication.

Shipping Classes from Strings

My other issues is separating the data that has ‘LargeLetter’ or ‘DDOversize’ as ‘yes’ to go into the shipping class that I’ve created for both categories. The rest will just go in a main shipping class that I created originally which all product data went into since it’s from a dropship wholesale. I fell into a problem with shipping as some products were too big for their ‘letter’ service so now I need to separate this data into other shipping classes as mentioned above.

How do I go about making sure that all data will go into my main shipping class ‘class 1’ and then those with ‘yes’ against Large Letter or DDOversize goes into either ‘class 2’ and ‘class 3’.

Returns Yes if Large Letter else is empty Useful for calculating shipping

Returns Yes if DD Oversize else is empty Useful for calculating shipping 

 

I hope this makes sense! Much thanks for your help!

J

James replied Support Agent

4 months ago on August 5, 2024 at 8:34 pm

Hi Callum,

Shipping Classes

In this example lets say you have the LargeLetter column with the csv selector {4} and the DDOversize selector as {5}, using this and combining it with the following custom function:

function iwphd_797_shipping_class($largeLetter = '', $ddOversize = '')
{
if(trim($largeLetter) == 'yes'){
$output = 'class 2';
}elseif(trim($ddOversize) == 'yes'){
$output = 'class 3';
}else{
$output = 'class 1';
}

return $output;
}

Which can be used in the importer like so:

[iwphd_797_shipping_class("{4}","{5}")]

This will if the large letter is yes return class 2, if ddOversize is yes will return class 3, otherwise it will return class 1.

A guide to adding custom code to your website using a wordpress plugin, or writing a custom plugin can be found here: https://www.importwp.com/docs/using-code-snippets-in-wordpress/

Product Range / Brand

The importer should be able to handle this as long as you have set the fields delimiter to | and the hierarchy character to > (as shown in the attached screenshots).

James

J

James replied Support Agent

3 months ago on August 15, 2024 at 12:17 pm

Hello Callum

This ticket is being marked as closed due to inactivity.

If this is not the case, please reply to this ticket to re-open it.

James