• Resolved nukurt

    (@kurtnuimage)


    We’re trying to do some attribute mapping. We need to map some custom fields to some Google for WooCommerce fields.

    Using your guide as a reference: https://woocommerce.com/document/google-for-woocommerce/attribute-mapping/use-cases/#mapping-custom-fields

    So i have custom fields added to my products using the hook “woocommerce_product_options_inventory_product_data”, this means the custom fields are displayed in the Inventory tab for each product.

    My field ids are: barcode, part_number, and _backorder_availability_date.

    barcode should map to GTIN, part_number should map to MPN, _backorder_availability_date should map to the Availability Date field.

    I’ve used the filter in your guide above (woocommerce_gla_attribute_mapping_sources_custom_attributes) to add the field keys to the mapping sources, so they do now appear in the dropdown list & I’ve created the mapping rules.

    However, I’m not sure the mapping is working as expected. If i update one of my Barcode values, it doesn’t seem to correctly update the GTIN field. Same for the part_number field, it doesn’t update the MPN field.

    i was expecting the target attribute to be updated in line with the data source but this doesn’t happen. do you have any ideas why? Am i missing something or misunderstanding how the mapping should work?

    Also, why i can’t select Availability Date as a target attribute? It means i can’t add my mapping rule from the data source _backorder_availability_date.

    Finally, does the mapping also work for variable products? My field keys for simple / variable products are the same but i don’t see any documentation about mapping variable products.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there!

    I can understand your conern, please note that we do not provide support for customization, If you need more in-depth support or want to consider professional assistance for customization, I can recommend?WooExperts?and?Codeable.io?as options for getting professional help. Alternatively, you can also ask your development questions in the??WooCommerce Community Slack?as custom code falls outside our usual?scope of support

    Thank you for your cooperation and understanding

    Thread Starter nukurt

    (@kurtnuimage)

    Hi @shahzeenfarooq,

    Thank for the response, I’m not really sure you quite understand though.

    It’s not customisation. We’re just trying to use the existing filter that you provide via your documentation here – https://woocommerce.com/document/google-for-woocommerce/attribute-mapping/use-cases/#mapping-custom-fields – It doesn’t seem to work as expected.

    As stated, we’ve used the filter to add mapping between custom fields to the Google for Woocommerce fields doesn’t seem to be working. e.g. I update my field, and the mapped GTIN / MPN fields aren’t updated. Plus, why the Availability Date field isn’t available as a Mapping attribute option?

    Also, you didn’t answer my query about whether this setup works for variable products?

    • This reply was modified 3 months, 3 weeks ago by nukurt.
    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello nukurt,

    Thank you for your the clarification.

    For better understanding, could you share screenshots of the:
    – Snippet you have added.
    – Attribute rule.

    I want to review the configuration and guide you further.
    Looking forward to your response. ??

    Best regards.

    Thread Starter nukurt

    (@kurtnuimage)

    Hi, sorry for the delay on this. Some screenshots for you:

    So this is the filter I’m using: https://ibb.co/Br74VBR

    And this is the mapping rules I’ve added: https://ibb.co/7KJVNFV

    So the values seem to line up. These also mirror to my custom field keys of “barcode” & “part_number”.

    But despite having these rules, my GTIN / MPN fields aren’t auto populated with the values from the barcode & part_number fields.

    • This reply was modified 3 months, 2 weeks ago by nukurt.
    Thread Starter nukurt

    (@kurtnuimage)

    Following on from this, i actually think my problem might be caused by how your plugin behaves with variable products. I’ve noticed some errors on the Product Feed page:

    “There was an error loading the Overview Stats. Click to retry. “

    Automattic\WooCommerce\GoogleListingsAndAds\MerchantCenter\MerchantStatuses::parse_presync_issue_text(): Argument #1 ($text) must be of type string, array given, called in .../wp-content/plugins/google-listings-and-ads/src/MerchantCenter/MerchantStatuses.php on line 613

    I guess this loops me back to my first post. “Does the mapping also work for variable products?”

    So the reason it’s an array of data instead of a string is because variable products have the “barcode” field added to each individual variation. So your plugin seems to be querying the “barcode” meta key on the Product Object, not the Product Variation Object, which means it’s returning barcode values for every variation as an array of data. When it should ideally return a string from a single Variation.

    Shouldn’t the plugin be setup to only query meta data of specific variations before trying to sync?

    • This reply was modified 3 months, 2 weeks ago by nukurt.
    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello nukurt,

    Thank you for your reply.

    I understand you’ve reviewed the snippet and configuration, and everything seems fine.
    The mapping should also work with variable products.

    Could you edit the global attributes and provide screenshots of the Part Number and Barcode attributes?

    Have you tried mapping any existing attributes?
    I want to confirm if this issue is only occurring with custom attributes.

    Additionally, please share your site’s System Status Report.
    You can find it under WooCommerce > Status.

    Looking forward to your response. ??

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