Support » Plugin: Media Library Assistant » Populating WooCommerce Fields when Uploading Media

  • Resolved MrPhil

    (@mrphil)


    I am successfully mapping IPTC and XMP fields to the WordPress fields (e.g., Alt Category, Title, etc) when uploading media to my site OK.

    Is it possible to be able to map fields to WooCommerce fields in the same way?

    I am assuming not, as the WooCommerce product is mostly created after an image is uploaded; but I am wondering if there is a way to map the fields when assigning a Featured Image to the Product?

    Hope this make sense

    Phil

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author David Lingren

    (@dglingren)

    Good to hear from you again, and thanks for the question.

    In general, MLA mapping rules won’t update WooCommerce products or use products as a data source. However, I developed an MLA example plugin to perform some update tasks based on earlier support topics.

    To install (or update) and activate (or update) the example plugin. Navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “woocommerce” in the text box and click “Search Plugins” to filter the table.

    You are looking for the “WooCommerce Fixit” example plugin. Find that plugin and hover over the title in the left-most column. Click the “Install” (or “Update”) rollover action, then go to the WordPress Plugins/Installed Plugins submenu and verify or activate the example plugin as you would any other plugin. Make sure you have the latest version, 2.05, installed.

    You can look through the tools in the example plugin to see if they are useful for your application. If not, you can give me more specific information on your goal and I can see if it’s feasible to enhance the example plugin to give you some help.

    I am marking this topic resolved, but please update it if you have any problems or further questions regarding the WooCommerce Fixit example plugin. Thanks for your continued interest in the plugin.

    Thanks David; I have installed FixIt and I am not sure I can see the actions I need. What I am trying to do is: –

    For each WooCommerce Product that has a “Featured Image”, load/update the products fields using the fields from the linked image; these being: –

    Image Alt Text -> Product Name
    Image Description -> Product Description
    Image Description -> Product Short Description
    Image Alt Categories -> Product Categories
    Image File Name -> Product SKU

    I suppose, I am looking for a field mapping option in the Plug-in, that allows the various Image fields to be mapped to specific WooCommerce fields. Once the mapping is set-up, it is simply a click of a button to update/refresh all the product fields.

    This would be a massive time-saver for me as I would be able to have a Product Template(s) that I can duplicate, add a Featured Image and then click a button in FixIt to update all the fields.

    Is this possible ?

    Thanks

    Phil

    Plugin Author David Lingren

    (@dglingren)

    Thanks for taking the time to install and investigate the “WooCommerce Fixit” example plugin. Thanks as well for adding the details of your application task; very helpful.

    I agree that the existing example plugin does not have a tool for your application. A general “mapping rule” engine for WooCommerce products is more work than I can take on, but I might be able to enhance the example plugin along the specific lines you described.

    If I understand your notation, you want to, for example, copy the ALT Text value from the Featured Image to the Product Name field in the WooCommerce product; is that right?

    You have given five value/field examples in your post; is this the complete list?

    You wrote “Image File Name -> Product SKU“. Do you want to include the file extension in the value or just the name portion of the file name?

    I could create a new tool to copy values from the Featured Image to the Product. You could apply the tool to all Products or restrict the work to one or more Products using the “First Product” and optional “Last Product” boxes at the top of the tool page.

    You mentioned “Product Template(s)“. Do you mean simply creating one or more product records and then using the “Duplicate” or “Copy to a new draft” links WooCommerce provides? Is there some other template feature I haven’t become aware of?

    I imagine a two-step process. First, create a new product from your template and assign a Product Image to it. Record or remember the post= value from the URL at the top of the Edit Product page; that’s the Product ID. Then, go to the Woo Fixit page, enter the Product ID in the “First product” box, scroll down to the new tool and click the button, populating the Product fields from the Product Image.

    I can’t promise a delivery date but I can investigate further if you think the proposed solution is useful. Let me know what you think.

    Hi David

    Sorry for the delay, but I have been trying to work out some of the smaller details / issues with my approach.

    No extension; just the file name.

    You are correct in that I would create a “Template” from an existing Product by using the Duplicate function.

    Then I would update the Product Image and then it is that Post ID that I would need to feed into your Plugin to copy the fields across from the Images metadata.

    Hopefully this makes sense?

    Phil

    Plugin Author David Lingren

    (@dglingren)

    Thanks for confirming the approach and application details. As I wrote, I can’t promise a delivery date but I will work on this as time permits. I will post an update here when I have progress to report.

    Thanks for your understanding and your patience.

    Plugin Author David Lingren

    (@dglingren)

    Thank you for your patience in awaiting progress on this topic. I have uploaded a new MLA Development Version dated 20191211 that includes an updated “WooCommerce Fixit” example plugin. You can find step-by-step instructions for using the Development Version in this earlier topic:

    PHP Warning on media upload with Polylang

    Once the Development Version is installed you must update and verify the example plugin. Navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “woocommerce” in the text box and click “Search Plugins” to filter the table.

    You are looking for the “WooCommerce Fixit” plugin. Find that plugin and hover over the title in the left-most column. Click the “Update” rollover action, then go to the WordPress Plugins/Installed Plugins submenu and verify the example plugin as you would any other plugin. Make sure you have the latest version, 2.06, installed.

    Once the Development Version and updated example plugin are installed and active you can try the new tools. Navigate to the Tools/Woo Fixit screen and scroll to the bottom. You will see the new “Populate Product from Product Image” section with five text boxes populated with the default templates I created from your earlier post.

    I suggest you start with one or a small number of Products for your testing. Find the Product ID value in the URL at the top of a Product/Edit Product screen and enter it in the “First Product” text box to limit the tool to a single product, then scroll down and click “Populate Products” to run the tool. If you make changes to the default templates you can save your new values, reload the saved values or restore the defaults using the other tools in the section.

    It would be great if you can install the Development Version and updated Woo Fixit plugin and let me know how they work for you. Thanks for inspiring this MLA improvement.

    Thanks David – installed and it works very well 🙂

    I assume I can leave the Development build in now until you next full update?

    Phil

    One addition – I don’t suppose it is possible for you to hook into the Add Product Image action and run the “Fix” when a Product Image is added ?

    Phil

    Plugin Author David Lingren

    (@dglingren)

    Thanks for installing and testing the enhanced WooCommerce Fixit example plugin. I am happy to see it’s working well for you.

    Yes, you can leave the Development Version installed until the next MLA update. There are a few other changes but it is stable as far as I know. Of course, if you have a problem let me know so I can address it quickly.

    You asked “I don’t suppose it is possible for you to hook into the Add Product Image action and run the “Fix” when a Product Image is added ?” I have developed a new version, 2.07, of the example plugin that adds this ability. If you go through the update process I outlined above and install the new version you will see two new checkboxes in the “Populate Product from Product Image” section below the templates. Check one or both boxes, then click “Save Templates” to activate the new feature.

    It would be great if you can install the new Development Version dated 20191214 and updated Woo Fixit plugin and let me know how they work for you. Thanks for suggesting this enhancement.

    Hi David

    Downloading the Development version seems to still download 2.06. How do I get 2.07 or am I doing something wrong?

    Thanks

    Phil

    Plugin Author David Lingren

    (@dglingren)

    Thanks for downloading the new Development Version. I just went through the process myself and the 20191214 version includes Woo Fixit v2.07. Did you do the second part of the process:

    Once the Development Version is installed you must update and verify the example plugin. Navigate to the Settings/Media library Assistant Documentation tab and click the “Example Plugins” button. Type “woocommerce” in the text box and click “Search Plugins” to filter the table.

    You are looking for the “WooCommerce Fixit” plugin. Find that plugin and hover over the title in the left-most column. Click the “Update” rollover action, then go to the WordPress Plugins/Installed Plugins submenu and verify the example plugin as you would any other plugin

    Let me know if there’s still a problem after both process steps are completed.

    My bad – forgot to update WooFixit.

    Working now 🙂

    Phil

    Hi David

    Whilst I got v2.07 working I have only just tried the “Product Image” options you added.

    The first observation is that selecting the two new checkboxes, the selection is not saved.

    Second, which may be related to the first, when I add a new product and then add the “Product Image” to the product, no fields are being copied across.

    I may be doing something wrong, or could something not be working?

    Thanks

    Phil

    Plugin Author David Lingren

    (@dglingren)

    Good to see the new version is up and running.

    Template changes and checking the new “Update on…” boxes must be explicitly saved to the options database; they are not automatically recorded. Check one or both boxes, then click “Save Templates” to activate the new feature.

    Did you take that last step and click “Save Templates”?

    Hi David

    Yes; I made the changes – ticked the checkboxes – and saved the templates. When the page refreshes after the save, the checkboxes are still checked.

    If I go out of the WooFixit page and then back in the boxes are unticked again

    Phil

Viewing 15 replies - 1 through 15 (of 21 total)
  • You must be logged in to reply to this topic.