2014-04-09 4 views
0

이것은 내 문제입니다. 저는 wordpress에서 datafeedr woocommerce 가져 오기 도구를 사용하여 datafeedr에서 woocomemerce로 제품을 가져옵니다. 새 제품 세트를 추가하면 브랜드에 대한 정보를 얻을 수 있지만 woocommerce 제품에서는 브랜드가 표시되지 않습니다. 브랜드를 가져올 수 있고 브랜드로 제품에 대한 필터를 만들 수있는 방법이 있습니까? 또한 판매자가 필터를 만들고 싶습니다.woocommerce에 필터 만들기

+0

플러그인 작성자에게 문의하십시오. – Sam

+0

고마워 라파엘, 나는 당신이 내가 미국에서 새롭다는 것을 알기를 원한다. 나는 몇 달 전에 이사했다. 나는 영어를 배우고있다. 사실 나는 프랑스어로 말하고, 나는 실수를한다. 정말 도움이된다. – ryan

답변

0

브랜드 속성을 제품에 추가 한 다음 해당 속성으로 브랜드를 가져와야합니다 (예 :

<?php 
/* Add Brand attribute to the product */ 
add_filter('dfrpswc_product_attributes', 'mycode_add_brand_attribute', 20, 5); 
function mycode_add_brand_attribute($attributes, $post, $product, $set, $action) { 
    if (isset($product['brand'])) { 
     $attr = 'Brand'; 
     if (!isset($attributes[sanitize_title($attr)])) { 
      $attributes[$attr]['name'] = $attr; 
     } 
    } 
    return $attributes; 
} 

/** 
* Set value for "Brand" attribute. 
*/ 
add_filter('dfrpswc_filter_attribute_value', 'mycode_set_brand_attribute_value', 30, 6); 
function mycode_set_brand_attribute_value($value, $attribute, $post, $product, $set, $action) { 
    if (isset($product['brand'])) { 
     $attr = 'Brand'; 
     if ($attribute == $attr) { 
      $value = $product['brand']; 
     } 
    } 
    return $value; 
} 
관련 문제