• Hello, thank you for your great plugin.
    I have an issue
    I use this code:

    add_filter('aepc_feed_item', function($fields, \PixelCaffeine\ProductCatalog\FeedMapper $item) {
        if ($product = wc_get_product($item->get_item()->get_id())) {
            if(!empty($product->get_attribute('pa_seasons')))
            {
                $fields['g:custom_label_0'] = $product->get_attribute('pa_seasons');
            }
        }
             return $fields;
    
    }, 10, 2);
    

    in order to include on my catalogue a field that is called Season.

    in xml the result is:
    </g:google_product_category>
    <g:custom_label_0/>
    </entry>
    <entry>

    XML

    Is something wrong?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    sorry for the late response!

    You see an empty field <g:custom_label_0/> most probably because the value is empty, that value you get from $product->get_attribute('pa_seasons');

    Please, make sure this attribute is existing and is called in that way.

    Hello Antonino,
    First of all thanks for the great plugin. I am using the following code to define the “Store Code” attribute in the product feed.

    add_filter('aepc_feed_item', function($fields, \PixelCaffeine\ProductCatalog\FeedMapper $item) {
        if ($product = wc_get_product($item->get_item()->get_id())) {
            if(!empty($product->get_attribute('storecode')))
            {
                $fields['g:custom_label_0'] = $product->get_attribute('storecode');
            }
        }
             return $fields;
    
    }, 10, 2);

    I can get the value of that attribute in my product feed which is “1” as following :

    <g:google_product_category>Clothing & Accessories</g:google_product_category>
    <g:custom_label_0>1</g:custom_label_0>

    So How do I change
    <g:custom_label_0>1</g:custom_label_0> to <g:Store code>1</g:Store code>

    Thank you in advance.

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi @palkhifashion,

    you cannot change the tag item <g:custom_label_0>. It should be in that way and it’s standard. There are other standard tags for custom label from custom_label_0 to custom_label_4 and they are there to give you ability to add additional information about the item.

    Here the reference:
    https://developers.facebook.com/docs/marketing-api/reference/product-item/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Label 0 problem’ is closed to new replies.