[Tep-j-general] Re: new_products.phpで特価プライスと通常プライスの

Back to archive index

bisuk****@spyma***** bisuk****@spyma*****
2004年 8月 3日 (火) 13:11:07 JST


自己れすです。

product_info.php


   if ( (!isset($new_products_category_id)) || 
($new_products_category_id == '0') ) {
     $new_products_query = tep_db_query("select p.products_id, 
p.products_image, p.products_price, p.products_tax_class_id from " . 
TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on 
p.products_id = s.products_id where products_status = '1' order by 
p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
   } else {
     $new_products_query = tep_db_query("select distinct p.products_id, 
p.products_image, p.products_price, p.products_tax_class_id from " . 
TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on 
p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " 
p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id 
and p2c.categories_id = c.categories_id and c.parent_id = '" . 
$new_products_category_id . "' and p.products_status = '1' order by 
p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
   }


     if ($new_price = 
tep_get_products_special_price($new_products['products_id'])) {
       $products_price = '<s>' . 
$currencies->display_price($new_products['products_price'], 
tep_get_tax_rate($new_products['products_tax_class_id'])) . '</s> <span 
class="productSpecialPrice">' . $currencies->display_price($new_price, 
tep_get_tax_rate($new_products['products_tax_class_id'])) . '</span>';
     } else {
       $products_price = 
$currencies->display_price($new_products['products_price'], 
tep_get_tax_rate($new_products['products_tax_class_id']));
     }
	
$info_box_contents[$row][$col] = array('align' => 'center',
                                              'params' => 
'class="smallText" width="33%" valign="bottom"',
                                              'text' => '<a href="' . 
tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . 
$new_products['products_id']) . '"><img src="'. 
$thumbnail_path_new_products .'" title="'. 
$new_products['products_name'] .'" width="'. 
$thumbnail_image_width_m_new_products .'" height="'. 
$thumbnail_image_height_m_new_products .'" border="0" /></a><br><a 
href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . 
$new_products['products_id']) . '">' . $new_products['products_name'] . 
'</a><br>' . $products_price);

と書き換えてみました。

一応目的どうり動作しているようですが、
変更はこんな感じで問題ないのでしょうか?

うーん。難しですね。

----------------------------------------------------------------------
    Homepage to : http://www14.plala.or.jp/bisuke/
    Mail to: bisuk****@spyma*****
       "Think different."  from bisuke φ(^^*)




Tep-j-general メーリングリストの案内
Back to archive index