• We are using Perfect Woocommerce brands plugin from www.ads-software.com for products on our store. Although when we are trying to create product catalog, there is no option shown to use the variable in the feed.

    Can you help or guide on how to achieve this?

    Regards

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

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

    (@antoscarface)

    Hi,

    sorry for the late response here.

    Unfortunately, there isn’t any easy way to integrate that plugin to Pixel Caffeine and there isn’t any integration already built-in in Pixel Caffeine.

    Anyway, you can take advantage of the hook by code, but it needs some code development. Here the hook that you can add at the end of the functions.php file inside your current theme (or better in a child theme):

    
    add_filter('aepc_feed_item', function($fields, $item) {
    	$product_id = $item->get_id();
    	
    	// EDIT HERE
    	$fields['g:brand'] = '';
    	// END EDIT HERE
    	
    	return $fields;
    }, 10, 2);
    

    Edit that $fields['g:brand'] = ''; by replace '' with the brand value retrieved from the plugin. I don’t know the plugin, so I cannot tell you how to retrieve it. If you need help, you can ask to the support of the plugin the way to retrieve the value for the $product_id.

    Hi Antonino, can you help me?
    I use the Pixel Caffeine plugin to produce a Feed and the “Perfect WooCommerce Brands” plugin to assign a brand to each product in my warehouse. Now I need to insert this information in the feed that I produce with Pixel Caffeine. The “Perfect WooCommerce Brands” plugin creates a row in the WP_TERMS table by assigning a term_id to each brand, this term_id is then associated with the product (defined in the WP_POSTS table with its own ID) using the WP_TERMS_RELATIONSHIP table.
    So I need to retrieve the brand name starting from the product (in the WP_POSTS table) and going through the WP_TERMS_RELATIONSHIP table until I reach the WP_TERMS table where the information resides.

    Thank you very much

    Alex

    Plugin Author Antonino Scarfì

    (@antoscarface)

    Hi,

    sorry for the late response!

    I don’t know the plugin that you are using, but if it’s as you explained, you can use the function get_the_term_list().

    I don’t know what taxonomy it is, but anyway you could you use this code, therefore:

    
    add_filter('aepc_feed_item', function($fields, $item) {
    	$product_id = $item->get_id();
    	
    	// EDIT HERE
            $taxonomy = ''; // <-- change with the exactly taxonomy name
    
    	$fields['g:brand'] = implode( ', ', array_map(function($term) {
    	    return $term->name;
            }, get_the_terms( $product_id, $taxonomy )));
    	// END EDIT HERE
    	
    	return $fields;
    }, 10, 2);
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Brands to be included from Perfect Woocommerce brands plugin’ is closed to new replies.