• 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 6 replies - 16 through 21 (of 21 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for confirming your process. There is a small defect in the example plugin you have that prevents the checkbox values from initializing correctly. The options are correct in the database, however, and the “Active for…” options should be working for product adds and updates.

    I should note that the “Populate Product from Product Image” code only runs when you click “Publish” or “Save Draft”. It does not run when you add the product image.\ because WordPress doesn’t actually add the Product Image until you “Publish” or “Save Draft”.

    In my testing I found that you must put something (such as “x”) in the “Product name” field before assigning the Product Image and Publishing the product or saving a draft. If the name is blank when you click “Publish” or “Save Draft”, the population code is not activated by the WordPress hooks.

    Thread Starter MrPhil

    (@mrphil)

    Thanks David; that explains it.

    It was the requirement to ensure something was in the product name before publishing that threw me. Now sorted ??

    How can I find out what template terms are available (for example what ddo I use for the Alt Text field)?

    Phil

    Plugin Author David Lingren

    (@dglingren)

    Thanks for the good news. Yes, the Product Name requirement was a bit of a surprise for me, too. WordPress generates the permalink from the Product Name so I guess it makes sense. You should look into the permalink and see if it meets your needs.

    You can find more information about the templates and data sources in the “Content Templates” and “Field-level Substitution Parameters” sections of the Settings/Media Library Assistant Documentation tab. In particular, the “Field-level data sources” are available to you.

    The “WooCommerce Fixit” example plugin adds “product:” and “product_terms:” custom substitution prefixes to the standard list. Note, however, that any of the product: elements will have whatever value they contained BEFORE the population rules are executed.

    Post an update if you have problems or further questions about the above suggestions.

    Plugin Author David Lingren

    (@dglingren)

    I have uploaded a new MLA Development Version dated 20191217 that includes the updated Woo Fixit example plugin, version 2.08. The update resolved the defect in populating the “Active for…” checkboxes that you reported.

    If you get a chance to try the new version, let me know how it works for you. Thanks for your patience.

    Hey David – jumping on this thread here. I’m looking to do a similar job of mapping Media EXIF/Tax to a Custom Post Type (Image); is there any way to modify this plugin to work with any CPT?

    Plugin Author David Lingren

    (@dglingren)

    @visualsuplex

    Thanks for your question. It would be best if you started a new support topic, since this topic is specific to WooCommerce and the example plugin for working with products.

    I am not sure I understand what you mean by “a similar job of mapping Media EXIF/Tax to a Custom Post Type (Image)“. In general, the MLA mapping logic is used to extract metadata from the attached file and updating values in the WordPress item that represents the file in the Media Library. If you can give me more details on the application you have in mind I can give you more specific guidance.

    Of course, the “example plugins” are intended to show what can be done with the many hooks MLA provides for working with Media Library items. The general answer is “with the hooks provided and some PHP code you can do almost anything” using the code in the examples as a starting point. Again, if you start a new topic and give me more to go on I can be more helpful. Thanks for your interest in the plugin.

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Populating WooCommerce Fields when Uploading Media’ is closed to new replies.