어떤부분이 문제인지 해결 방법을 알고 싶습니다.
오류메시지
Warning: sprintf(): Too few arguments in /home/arkmo/html/wp-content/plugins/woocommerce/includes/shipping/flat-rate/includes/settings-flat-rate.php on line 47
settings-flat-rate.php의 47라인 입니다.
'description' => sprintf( __( 'These costs can optionally be added based on the <a href="%s">product shipping class</a>.', 'woocommerce' ), admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=classes' ) ),
전체내용
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
$cost_desc = __( 'Enter a cost (excl. tax) or sum, e.g. <code>10.00 * [qty]</code>.', 'woocommerce' ) . '<br/><br/>' . __( 'Use <code>[qty]</code> for the number of items, <br/><code>[cost]</code> for the total cost of items, and <code>[fee percent="10" min_fee="20" max_fee=""]</code> for percentage based fees.', 'woocommerce' );
/**
* Settings for flat rate shipping.
*/
$settings = array(
'title' => array(
'title' => __( 'Method title', 'woocommerce' ),
'type' => 'text',
'description' => __( 'This controls the title which the user sees during checkout.', 'woocommerce' ),
'default' => __( 'Flat rate', 'woocommerce' ),
'desc_tip' => true,
),
'tax_status' => array(
'title' => __( 'Tax status', 'woocommerce' ),
'type' => 'select',
'class' => 'wc-enhanced-select',
'default' => 'taxable',
'options' => array(
'taxable' => __( 'Taxable', 'woocommerce' ),
'none' => _x( 'None', 'Tax status', 'woocommerce' ),
),
),
'cost' => array(
'title' => __( 'Cost', 'woocommerce' ),
'type' => 'text',
'placeholder' => '',
'description' => $cost_desc,
'default' => '0',
'desc_tip' => true,
),
);
$shipping_classes = WC()->shipping->get_shipping_classes();
if ( ! empty( $shipping_classes ) ) {
$settings['class_costs'] = array(
'title' => __( 'Shipping class costs', 'woocommerce' ),
'type' => 'title',
'default' => '',
'description' => sprintf( __( 'These costs can optionally be added based on the <a href="%s">product shipping class</a>.', 'woocommerce' ), admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=classes' ) ),
);
foreach ( $shipping_classes as $shipping_class ) {
if ( ! isset( $shipping_class->term_id ) ) {
continue;
}
$settings[ 'class_cost_' . $shipping_class->term_id ] = array(
/* translators: %s: shipping class name */
'title' => sprintf( __( '"%s" shipping class cost', 'woocommerce' ), esc_html( $shipping_class->name ) ),
'type' => 'text',
'placeholder' => __( 'N/A', 'woocommerce' ),
'description' => $cost_desc,
'default' => $this->get_option( 'class_cost_' . $shipping_class->slug ), // Before 2.5.0, we used slug here which caused issues with long setting names
'desc_tip' => true,
);
}
$settings['no_class_cost'] = array(
'title' => __( 'No shipping class cost', 'woocommerce' ),
'type' => 'text',
'placeholder' => __( 'N/A', 'woocommerce' ),
'description' => $cost_desc,
'default' => '',
'desc_tip' => true,
);
$settings['type'] = array(
'title' => __( 'Calculation type', 'woocommerce' ),
'type' => 'select',
'class' => 'wc-enhanced-select',
'default' => 'class',
'options' => array(
'class' => __( 'Per class: Charge shipping for each shipping class individually', 'woocommerce' ),
'order' => __( 'Per order: Charge shipping for the most expensive shipping class', 'woocommerce' ),
),
);
}
return $settings;
안녕하세요~^^
올려주신 코드상에 문제는 없어 보입니다.
다만 의심되는 건 번역된 메시지에 문제가 있을 듯합니다.
번역을 제거하고 아래처럼 영문으로 출력되게 해보시겠어요?
'description' => sprintf( 'These costs can optionally be added based on the <a href="%s">product shipping class</a>.', admin_url( 'admin.php?page=wc-settings&tab=shipping§ion=classes' ) ),
원하시면 한글로 직접 단어를 수정해주셔도 됩니다.
고맙습니다.