忍者ブログ
01 May

[PR]

×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

22 January

検索結果ページのレイアウト welcart

welcartでは検索結果の the_content(); が制御されており、編集するならフックを使う必要がある。blogと共存するための制御だろうけど、すげーうざい。
functions.phpにて $html .= とか使ってhtmlを出力するんだが、
長々やるとあってんだか間違ってんだかわかんなくなる

[解決済み] 検索結果の表示内容の変更


http://www.welcart.com/community/forums/topic/%E8%A7%A3%E6%B1%BA%E6%B8%88%E3%81%BF-%E6%A4%9C%E7%B4%A2%E7%B5%90%E6%9E%9C%E3%81%AE%E8%A1%A8%E7%A4%BA%E5%86%85%E5%AE%B9%E3%81%AE%E5%A4%89%E6%9B%B4

add_filter( 'usces_filter_item_list_loopimg', 'my_filter_searchpage', 10, 2);
function my_filter_searchpage($html, $content){
global $post , $usces;
$html = '<div class="mysearch_box"><a href="' . get_permalink($post->ID) . '">' . usces_the_itemImage(0, 150, 150, $post, 'return');
$html .= '<div class="mysearch_title">' . usces_the_itemName( 'return' ) . '</div></a>';
if (usces_the_itemZaiko('return') == '売切れ'){
$html .= '<div class="price">';
$html .= usces_the_itemZaiko('return') . '</div>';
}else{
if (usces_the_firstCprice('return') > 0) {
$html .= '<div class="reg_price">';
if( function_exists('usces_crform') ){
$html .= usces_crform( usces_the_firstCprice('return'), true, false, 'return' );
}else{
$html .= __('$', 'usces') . number_format(usces_the_firstCprice('return'));
}
$html .= $usces->getGuidTax() . '</div>';
}
$html .= '<div class="price">' . usces_crform( usces_the_firstPrice('return'), true, false , 'return' );
$html .= $usces->getGuidTax() . '</div>' . '</div>';
}
return $html; }

これを丸ごとコピペして改変していってなんとかできた。
しかしここに抜粋のせたいとか色々やろうとしたけど、全然うまくいかないのであきらめた。

PR