• Resolved wp_edu

    (@alemao2k6)


    Hi,

    I have selected my custom brand taxonomies in Facebook for Woocommerce, but the products sync to facebook using the store name as the brand attribute.

    I changed fbproduct.php file at line 568 to:

    $brand = get_the_term_list( $id, 'pa_marca', '', ', ' );

    as opposed to

    $brand = get_the_term_list( $id, 'product_brand', '', ', ' );

    And it seems to be working. How can I add this change to my child theme, so when I update Facebook for Woocommerce I don’t lose this change?

    Also, I can choose my custom taxonomy “Marca (pa_marca)” in Admin (at ‘wp-admin/admin.php?page=wpseo_woo’) for Manufacturer and Brand options, but the plugin does not use that option for syncing products to facebook?

    Thank you

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi @alemao2k6!

    Great questions here. Can I ask which plugin version you’re using? That’ll be helpful as I try to gather information here to answer your questions.

    Thanks so much!

    Julie ??
    SkyVerge

    Thread Starter wp_edu

    (@alemao2k6)

    Hi, thanks

    I’m using version 2.0.0

    Hey @alemao2k6,

    Tamara here, stepping in for Julie. I’m sorry for the delay in getting back to you over the weekend!

    Thanks for confirming the plugin version here. It looks like you are using a custom attribute for the brand while our plugin defaults to reading the “product_brand” taxonomy used by plugins like WooCommerce Brands.

    The best way to change this in an upgrade safe way would be to use the facebook_for_woocommerce_integration_prepare_product filter with code something like this:

    
    function sv_facebook_for_wc_change_product_brand( $product_data, $product_id ) {
    
       $brand = get_the_term_list( $id, 'pa_marca', '', ', ' );
       $brand = is_wp_error( $brand ) || ! $brand ? wp_strip_all_tags( WC_Facebookcommerce_Utils::get_store_name() ) : WC_Facebookcommerce_Utils::clean_string( $brand );
    
       $product_data['brand'] = $brand; // NOTE: you will have to truncate this string to 100 characters
    
       return $product_data;
    }
    add_filter( 'facebook_for_woocommerce_integration_prepare_product', 'sv_facebook_for_wc_change_product_brand', 10, 2 ); 
    

    Please note that I didn’t test this code and it’s just written here quickly to give you an idea for how you could go about this customization.

    I hope that’s helpful! Could I help you with any other questions?

    Thanks,
    Tamara

    • This reply was modified 4 years, 3 months ago by tamarazuk. Reason: missing $ in return statement

    Hey @alemao2k6,

    It has been a long time since we heard from you, so I’m going to mark this topic as resolved.

    If you’re still experiencing issues please take a look at our documentation for more information and create a new thread if you have further questions.

    Thanks,
    Tamara ??

    Thread Starter wp_edu

    (@alemao2k6)

    Hi,

    I tried the suggested filter by adding it with the code snippets plugin, but it doesn’t work.

    Would you have another suggestion?

    Hey @alemao2k6 ,

    This is Pit, stepping in for Tamara as she isn’t available today.

    Thank you very much for your response. Taking a look at the previous responses in this thread, it seems that the snippet that Tamara shared with you wasn’t tested and was instead created as an example on how you can proceed with this change. That means that you may need to make adjustments to the snippet in order to achieve the desired outcome.

    That being said, our team cannot help directly with implementing any customizations to our plugin as per our support policy. I’m really sorry for not being able to provide you with further assistance on this one. ??

    Would you please let me know if there are more questions I can help you with?

    Best regards,

    Pit
    SkyVerge

    Thread Starter wp_edu

    (@alemao2k6)

    Hi, I just wanted some help to apply this customization as I mentioned:

    I changed fbproduct.php file at line 568 to:

    $brand = get_the_term_list( $id, ‘pa_marca’, ”, ‘, ‘ );

    as opposed to

    $brand = get_the_term_list( $id, ‘product_brand’, ”, ‘, ‘ );

    And keeping it working in future updates, is it possible to help me out with this, as this is a solution for my problem?

    I just know how to modify the original file, is there a way to put this in my child theme?

    Thank you for your response, @alemao2k6 , and for providing me with more clarifications. ??

    Unfortunately, custom work isn’t part of our support policy so I’m afraid I can’t directly assist you on further implementing this. The sample snippet created by Tamara is a great starting point for making this change, however, if you’re unsure how to proceed, I’d recommend consulting with a developer experienced in WooCommerce and WordPress.

    Sorry for not being able to share better news with you on this one.

    Would you please let me know if there’s any other question I can help you with?

    Best regards,

    Pit
    SkyVerge

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Not syncing brands’ is closed to new replies.