워드프레스홈페이지

우커머스의 관련상품(woo commerce – related products)의 갯수를 수정하는 방법 Ver 2.1

01_05
워드 프레스 홈페이지 우커머스 2.1에서 또 많은 부분이 바뀌었습니다. 
이전 버젼에서는 /plugins/woocommerce/woocommerce-template.php 에 있었던 function이 이번에는
/www/wp-content/plugins/woocommerce/includes/wc-template-functions.php로 바뀌었습니다.
if ( ! function_exists( ‘woocommerce_output_related_products’ ) ) {
/**
* Output the related products.
*
* @access public
* @subpackage Product
* @return void
*/
function woocommerce_output_related_products() {
$args = array(
‘posts_per_page’ => 2,
‘columns’ => 2,
‘orderby’ => ‘rand’
);
woocommerce_related_products( apply_filters( ‘woocommerce_output_related_products_args’, $args ) );
}
}
/* 우커머스 2.1 버젼에서는 관련 상품 갯수 지정이 변경되었다. 따라서 아래와 같이 수정한다. */
if ( ! function_exists( ‘woocommerce_related_products’ ) ) {
/**
* Output the related products.
*
* @access public
* @param array Provided arguments
* @param bool Columns argument for backwards compat
* @param bool Order by argument for backwards compat
* @return void
*/
function woocommerce_related_products( $args = array(), $columns = false, $orderby = false ) {
if ( ! is_array( $args ) ) {
_deprecated_argument( __FUNCTION__, ‘2.1’, __( ‘Use $args argument as an array instead. Deprecated argument will be removed in WC 2.2.’, ‘woocommerce’ ) );
$argsvalue = $args;
$args = array(
‘posts_per_page’ => $argsvalue,
‘columns’ => $columns,
‘orderby’ => $orderby,
);
}
$defaults = array(
‘posts_per_page’ => 3, //이것을 2->3으로 고침.
‘columns’ => 3, //이것을 2->3으로 고침.
‘orderby’ => ‘rand’
);
$args = wp_parse_args( $args, $defaults );
wc_get_template( ‘single-product/related.php’, $defaults );
}
}
 
상기 내용중  숫자로 된 부분을 수정하면 상품의 갯수가 바뀝니다

뿔미디어-워드프레스 쇼핑몰 제작

48
[box type=”success” ]아래는 비 워드프레스 쇼핑몰 제작 사이트 중 유명 사이트 모음 입니다. 비 워드프레스 쇼핑몰과 워드프레스 쇼핑몰에 대한 비교와 신뢰감 제고를 위해 만든 페이지이므로 워드프레스 쇼핑몰 제작 결정을 위해 참고하시기 바랍니다.[/box] [tabs type=”horizontal”] [tabs_head] [tab_title]오픈마켓 쇼핑몰[/tab_title] [tab_title]일반 유명 쇼핑몰[/tab_title][/tabs_head] [tabs] [tab] 1. http://www.11st.co.kr/html/main.html | 11번가
2. http://www.incuber.kr/ | 인큐버
3. http://search.gmarket.co.kr/ | G마켓
4. http://www.auction.co.kr/?redirect=1 | 옥션
5. http://www.ktm.or.kr/main/main.html | 케이티엠
[/tab] [tab] 1. http://www.ebbysory.com/ | 매생이총각네
2. http://oasystem.co.kr/ | 프린트OA시스템
3. http://imorys.com/ | 필모리스
4. http://biozoa.kimhi99.gethompy.com/ | 생물나라
5. http://sym21.com/ | 신영제어기(주)
[/tab] [/tabs]

문의하기견적의뢰지금 연락 주십시요!