アプリ版:「スタンプのみでお礼する」機能のリリースについて

いつもお世話になっております!
初心者な質問で申し訳ないのですが、
下記のPHPは、商品名のところに指定される、リンク先を
定義しているものなのですが、このとき、
商品IDが35と36番のときだけ、別のURLに飛ばしたいのです。
http://domainname.com/hogehoge/item1.html など)

IFで定義しないといけないと思うのですが、
何分初心者のため、どのように挿入すればいいかがわかりません。

ご教授お願いいたします!!!

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
$lc_align = '';
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_align = '';
$lc_text = $listing->fields['products_model'];
break;
case 'PRODUCT_LIST_NAME':
$lc_align = '';
if (isset($_GET['manufacturers_id'])) {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>' ;
} else {
$lc_text = '<h3 class="itemTitle"><a href="' . zen_href_link(zen_get_info_page($listing->fields['products_id']), 'cPath=' . (($_GET['manufacturers_id'] > 0 and $_GET['filter_id']) > 0 ? zen_get_generated_category_path_rev($_GET['filter_id']) : ($_GET['cPath'] > 0 ? zen_get_generated_category_path_rev($_GET['cPath']) : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . $listing->fields['products_name'] . '</a></h3><div class="listingDescription">' . zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($listing->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div>';
}
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
break;
case 'PRODUCT_LIST_PRICE':
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
$lc_align = 'right';
$lc_text = $lc_price;

A 回答 (1件)

Zen Cart?は分からないのであてずっぽうで。



case 'PRODUCT_LIST_NAME':
  $lc_align = '';
  if ($listing->fields['products_id'] == 35) {
    $lc_text = '<h3 class="itemTitle">' .
      '<a href="#hoge1">' . $listing->fields['products_name'] . '</a>' .
      '</h3>' .
      '<div class="listingDescription">...</div>';
  } else if ($listing->fields['products_id'] == 36) {
    $lc_text = '<h3 class="itemTitle">' .
      '<a href="#hoge2">' . $listing->fields['products_name'] . '</a>' .
      '</h3>' .
      '<div class="listingDescription">...</div>';
  } else if (isset($_GET['manufacturers_id'])) {
    $lc_text = '...';
  } else {
    $lc_text = '...';
  }
  break;

この回答への補足

下記のように設定してみたのですが、
うまくいきませんでした…。

どこかおかしいところはありますでしょうか。
お分かりになるようでしたら、ご教授頂ければ幸いです!

<?php

for ($col=0, $n=sizeof($column_list); $col<$n; $col++) {
switch ($column_list[$col]) {
case 'PRODUCT_LIST_MODEL':
$lc_text = TABLE_HEADING_MODEL;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_NAME':
$lc_text = TABLE_HEADING_PRODUCTS;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_MANUFACTURER':
$lc_text = TABLE_HEADING_MANUFACTURER;
$lc_align = '';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_PRICE':
$lc_text = TABLE_HEADING_PRICE;
$lc_align = 'right' . (PRODUCTS_LIST_PRICE_WIDTH > 0 ? '" width="' . PRODUCTS_LIST_PRICE_WIDTH : '');
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_QUANTITY':
$lc_text = TABLE_HEADING_QUANTITY;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_WEIGHT':
$lc_text = TABLE_HEADING_WEIGHT;
$lc_align = 'right';
$zc_col_count_description++;
break;
case 'PRODUCT_LIST_IMAGE':
$lc_text = TABLE_HEADING_IMAGE;
$lc_align = 'center';
$zc_col_count_description++;
break;

/*とび先指定*/
case 'PRODUCT_LIST_NAME':
  $lc_align = '';
  if ($listing->fields['products_id'] == 35) {
    $lc_text = '<h3 class="itemTitle">' .
      '<a href="hogehoge.html">' . $listing->fields['products_name'] . '</a>' .
      '</h3>' .
      '<div class="listingDescription">...</div>';
  } else if ($listing->fields['products_id'] == 36) {
    $lc_text = '<h3 class="itemTitle">' .
      '<a href="hogehoge.html">' . $listing->fields['products_name'] . '</a>' .
      '</h3>' .
      '<div class="listingDescription">...</div>';
  } else if (isset($_GET['manufacturers_id'])) {
    $lc_text = '...';
  } else {
    $lc_text = '...';
  }
  break;
}
/*ここまで*/


case 'PRODUCT_LIST_MANUFACTURER':
$lc_align = '';
$lc_text = '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $listing->fields['manufacturers_id']) . '">' . $listing->fields['manufacturers_name'] . '</a>';
break;
case 'PRODUCT_LIST_PRICE':
$lc_price = zen_get_products_display_price($listing->fields['products_id']) . '<br />';
$lc_align = 'right';
$lc_text = $lc_price;


?>

補足日時:2009/09/29 04:10
    • good
    • 0
この回答へのお礼

お礼が遅くなり申し訳ありません!
早速教えていただいたスクリプトを加えて
テストしてみようと思います!

本当にありがとうございました!

お礼日時:2009/09/22 17:41

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!