返信先: 会員情報ページのカスタマイズ
フォーラム › 使い方全般 › 会員情報ページのカスタマイズ › 返信先: 会員情報ページのカスタマイズ
2014年11月8日 11:13 PM
#72681
参加者
nanbu様、ご返信ありがとうございます。
ご教示いただいたフックで、テーマのfunctions.phpに下記のように書いて、不要な数量の削除を試みたのですが、変更が反映されません。
どこが間違っているのでしょうか?
add_filter( 'usces_filter_history_cart_row', 'my_filter_history_cart_row' );
function my_filter_history_cart_row( $html ) {
for($i=0; $i<count($cart); $i++) {
$cart_row = $cart[$i];
$ordercart_id = $cart_row['cart_id'];
$post_id = $cart_row['post_id'];
$sku = urldecode($cart_row['sku']);
$quantity = $cart_row['quantity'];
$options = $cart_row['options'];
$itemCode = $usces->getItemCode($post_id);
$itemName = $usces->getItemName($post_id);
$cartItemName = $usces->getCartItemName($post_id, $sku);
$skuPrice = $cart_row['price'];
$pictid = (int)$usces->get_mainpictid($itemCode);
$optstr = '';
if( is_array($options) && count($options) > 0 ){
$optstr = '';
foreach($options as $key => $value){
if( !empty($key) ) {
$key = urldecode($key);
$value = maybe_unserialize($value);
if(is_array($value)) {
$c = '';
$optstr .= esc_html($key) . ' : ';
foreach($value as $v) {
$optstr .= $c.nl2br(esc_html(urldecode($v)));
$c = ', ';
}
$optstr .= "<br />\n";
} else {
$optstr .= esc_html($key) . ' : ' . nl2br(esc_html(urldecode($value))) . "<br />\n";
}
}
}
$optstr = apply_filters( 'usces_filter_option_history', $optstr, $options);
}
$optstr = apply_filters( 'usces_filter_option_info_history', $optstr, $umhs, $cart_row, $i );
$history_cart_row = '<tr>
<td>' . ($i + 1) . '</td>
<td>';
$cart_thumbnail = '<a href="' . get_permalink($post_id) . '">' . wp_get_attachment_image( $pictid, array(60, 60), true ) . '</a>';
$history_cart_row .= apply_filters('usces_filter_cart_thumbnail', $cart_thumbnail, $post_id, $pictid, $i, $cart_row);
$history_cart_row .= '</td>
<td class="aleft"><a href="' . get_permalink($post_id) . '">' . esc_html($cartItemName) . '<br />' . $optstr . '</a>' . apply_filters('usces_filter_history_item_name', NULL, $umhs, $cart_row, $i) . '</td>
<td class="rightnum">' . usces_crform($skuPrice * $cart_row['quantity'], true, false, 'return') . '</td>
</tr>';
$materials = compact( 'cart_thumbnail', 'post_id', 'pictid', 'cartItemName', 'optstr' );
}
return $html;
}
ご教示のほど何卒よろしくお願いいたします。