サイドバーの新着商品にも商品説明文を表示。
サイドバーの新着商品(What’s new)にも紹介文や価格を表示したい。紹介文は36文字程度で切る。
includes/templates/テンプレート名のフォルダ/templates/tpl_whats_new.php
13行目(</div>より手前)あたりに、
$content .= ‘<p class=”price”>’ . $whats_new_price . ‘</p>’;
$content .= ‘<p class=”description”>’ . mb_substr(strip_tags($random_whats_new_sidebox_product->fields['products_description']),0,36) .’…</p>’;
と追加。
includes/modules/sideboxes/テンプレート名のフォルダ/whats_new.php
15~18行目のSQL文を下記のように書き換える。
—
$random_whats_new_sidebox_product_query = “select p.products_id, p.products_image, p.products_tax_class_id, p.products_price, pd.products_description
from (” . TABLE_PRODUCTS . ” p
left join ” . TABLE_PRODUCTS_DESCRIPTION . ” pd on p.products_id = pd.products_id )
where p.products_id = pd.products_id
and pd.language_id = ‘” . (int)$_SESSION['languages_id'] . “‘
and p.products_status = 1 ” . $display_limit . ”
limit ” . MAX_RANDOM_SELECT_NEW;
—
以上。