Tagged: extra metadata, field, metadata, SKU, WooCommerce
-
AuthorPosts
-
September 12, 2016 at 2:59 pm #27894
Hi,
In order to optimize and automate my workflow, I would like to read extra metadata from uploaded images.
I can get “Software” field in image metadata and populate a new field “meta:ss_exif_Software” in my database.I would like now to use this content to write it in woocommerce “SKU” field.
I tried to look into “symbiostock-pro/tools-ftp.php” file and to edit “function ss_read_extra_exif($postid,$metadata=”)” part but can’t manage to write this value in SKU field.Thanks for your help…
October 26, 2016 at 9:53 pm #28579Finally found a solution :
Edit “symbiostock-pro/tools-ftp.php” file
replace if ($value) ss_update_post_meta($postid, ‘ss_exif_’.$value, $metadata->$value);
by if ($value) ss_update_post_meta($postid, ‘_sku’, $metadata->$value);
PS: you’ll need to re-edit this php file after each Symbiostock upgrade…
It would be nice if we could choose the name of the field updated by Extra metadata in Symbiostock media settings.
Could this be implemented in a future Symbiostock version ?October 27, 2016 at 7:09 pm #28585Hey Chris – sorry I missed this post from earlier.
The problem with your code is if you have more than one extra exif field, it will always put the last one read as the SKU field, which is definitely what you don’t want. Here is code I have added to the core that will be in the next release – you can implement it manually:
foreach ($fields as $key => $value) {
if ($value) ss_update_post_meta($postid, ‘ss_exif_’.$value, $metadata->$value);
do_action(“ss_read_extra_exif_end”,$postid,$value,$metadata->$value);
}
Then in your theme’s functions.php add this:
add_action(‘ss_read_extra_exif_end’,’_my_custom_function_writeskufield’,10,3);
function _my_custom_function_writeskufield($postid,$fieldname,$value) {
if ($fieldname == “Software”) ss_update_post_meta($postid, ‘_sku’, $value);
}
Try it out and let me know.
October 27, 2016 at 7:10 pm #28586October 27, 2016 at 7:54 pm #28587October 28, 2016 at 12:27 am #28588It’s perfect, Robin !
Ive added four extra metadata to specific Exif fields with Exiftool and used also supplementalCategories to directly assign categories to my products.
Here is my workflow:
I use a LibreOffice Calc file as template for my fonts images indexation.
All I need to do in this file is to enter Category, SKU, and informations related to font texture, font color and font matter.
Formulas in my calc sheet use these informations to generate automatically for each letter and signs :– An appropriate and unique Yoast focus Keywords.
– A SEO friendly product Title and product description optimized for this focus Keyword.
– Related product tags.When required informations are filled, a Calc macro execute the following actions :
– Generation of ExifTool-indexation.csv file which will be used on my computer by ExifTool to process images.
– Generation of Exiftool.bat command file which will be launched by the macro to fill Exif fields on my images with the following command :c:\windows\exiftool -csv=”s:\Indexation\131-Seychelles-letter\ExifTool-indexation.csv” . -overwrite_original
When all images are processed (in less than 10 secondes), I can now upload them on my website where all required product informations will be collected by symbiostock.
A complete alphabet of 67 letters, numbers and signs is now indexed, optimized for SEO and uploaded in less than 15 minutes.
Thanks a lot Robin, you saved my life !
-
AuthorPosts
You must be logged in to reply to this topic.