「usces_the_item」の検索結果
-
検索結果
-
いつもお世話になります。
テンプレートをカスタマイズしていて気が付いたので、投稿させていただきます。
usces_error_message関数やusces_singleitem_error_message関数など、テンプレート各所にエラーを表示する関数が記述されておりますが、エラーがない時にも空のDIVタグが出力されてしまうようです。
<div class="error_message">エラーメッセージ</div>
これですと、エラー発生時にエラーを目立たせて表示するために、DIVタグをborderで囲ったり、背景色を付けてしまうと、エラー発生時以外にも、枠や背景色が表示されてしまいます。
例をあげますと、次のようにエラーメッセージがあるときだけ、DIVタグを含めて表示するように分岐処理をテンプレートに入れるように変更すると良いのではないでしょうか?
wc_item_single.php
<div class="error_message"><?php usces_singleitem_error_message($post->ID, usces_the_itemSku('return')); ?></div>
↓
<?php $error_msg = usces_singleitem_error_message($post->ID, usces_the_itemSku('return')); ?>
<?php if ( !empty($error_msg) ): ?>
<div class="error_message"><?php echo $error_msg; ?></div>
<?php endif; ?>wc_login_page.php
<div class="error_message"><?php usces_error_message(); ?></div>
↓
<?php $error_msg = usces_error_message("return"); ?>
<?php if ( !empty($error_msg) ): ?>
<div class="error_message"><?php echo $error_msg; ?></div>
<?php endif; ?>細かい点なのですが、要望として取り上げていただければ幸いです。
動作に関するご質問の場合は必ずご記入ください。
Welcart のバージョン:
症状を確認したブラウザ:
サーバー(会社名、サービス名):
SSLの利用: 無し | 専用SSL | 共用SSL
WordPress のパーマリンク設定:
WordPress自体とWelcartを最新版にバージョンアップしたところ、商品のメイン画像が表示されなくなりました。
ページのソースコードをみると
<div class=”itemimg”>
</div>
のように空の状態です。
ローカルに保存してあったバージョンアップ前の
usc-e-shop/templates/
のファイルに戻して戻してみましたが表示されませんでした。
(バージョンアップ前は同ファイルで表示されていた。)
該当箇所のコードは引数のみをかえたデフォルトのままで
$html .= ‘<div class=”itemimg”>’.”n”;
$html .= ‘<a href=”‘ . usces_the_itemImageURL(0, ‘return’) . ‘”‘;
$html = apply_filters(‘usces_itemimg_anchor_rel’, $html);
$html .= ‘>’;
$itemImage = usces_the_itemImage(0, 200, 250, $post, ‘return’);
$html .= apply_filters(‘usces_filter_the_itemImage’, $itemImage, $post);
$html .= ”.”n”;
の箇所です。
バージョンアップで何か変更になったのでしょうか。
どうすればメインイメージを表示(ソースコードの吐き出し)ができますでしょうか。
Welcart のバージョン:1.0.6
症状を確認したブラウザ:Firefox 3.6
サーバー(会社名、サービス名):さくら共用スタンダード
SSLの利用: 無し
WordPress のパーマリンク設定:
WordPressのバージョン 3.2.1
welcartを利用させていただいております、厚く感謝申し上げます。
さて、
商品詳細ページに表示されているメイン画像を、マウスでクリックしてサブイメージと画像の切り替え変更が可能なように、imgのパラメータにnameタグを新たに追加したいのですが、スキルが無いためタグの追加方法がよくわかりません。
たぶんimgデータは下の
pluginsusc-e-shopfunctionstemplate_func.php
にて、商品のimgデータが書き出されているかと思いますが、imgデータに”name”のタグの追加方法についてお教えいただければありがたく存じます。
商品詳細ページに書き出されている現在の状態
<a href=”http://www.hoge.jp/shop/wp-content/uploads/photo.jpg”><img src=”http://www.hoge.jp/shop/wp-content/uploads/photo.jpg” alt=”hoge” title=”hogehogephoto” /></a>
修正後に以下のようにnameを追加したのですが(この場合nameに代入する値は適当な固定の名称exampleのままで構わないですが・・)
<div class=”itemimg”>
<a href=”http://www.hoge.jp/shop/wp-content/uploads/photo.jpg”><img src=”http://www.hoge.jp/shop/wp-content/uploads/photo.jpg” alt=”hoge” title=”hogehogephoto” name=”example”/></a> </div>
修正部分は、たぶん
pluginsusc-e-shopfunctionstemplate_func.phpに記載されている以下の部分を修正するかと思いますがスキルがなく記述の仕方がよくわかりません、よろしくお願いいたします。
function usces_the_itemImage($number = 0, $width = 60, $height = 60, $post = ”, $out = ”, $media = ‘item’ ) {
global $usces;
if($post == ”) global $post;
$post_id = $post->ID;
$code = get_post_custom_values(‘_itemCode’, $post_id);
if(!$code) return false;
$name = get_post_custom_values(‘_itemName’, $post_id);
if( 0 == $number ){
$pictid = $usces->get_mainpictid($code[0]);
$html = wp_get_attachment_image( $pictid, array($width, $height), false );//’
‘;
if( ‘item’ == $media ){
$alt = ‘alt=”‘.esc_attr($code[0]).'”‘;
$alt = apply_filters(‘usces_filter_img_alt’, $alt, $post_id, $pictid);
$html = preg_replace(‘/alt=”[^”]*”/’, $alt, $html);
$title = ‘title=”‘.esc_attr($name[0]).'”‘;
$title = apply_filters(‘usces_filter_img_title’, $title, $post_id, $pictid);
$html = preg_replace(‘/title=”[^”]+”/’, $title, $html);
}
}else{
$pictids = $usces->get_pictids($code[0]);
$html = wp_get_attachment_image( $pictids[$number], array($width, $height), false );//’
‘;
if( ‘item’ == $media ){
$alt = ‘alt=”‘.esc_attr($code[0]).'”‘;
$alt = apply_filters(‘usces_filter_img_alt’, $alt, $post_id, $pictids[$number]);
$html = preg_replace(‘/alt=”[^”]*”/’, $alt, $html);
$title = ‘title=”‘.esc_attr($name[0]).'”‘;
$title = apply_filters(‘usces_filter_img_title’, $title, $post_id, $pictids[$number]);
$html = preg_replace(‘/title=”[^”]+”/’, $title, $html);
}
}
if($out == ‘return’){
return $html;
}else{
echo $html;
Welcart のバージョン:1.06β
症状を確認したブラウザ:
サーバー(会社名、サービス名):xserver
SSLの利用: 無し | 専用SSL | 共用SSL
WordPress のパーマリンク設定: