我一直在尝试研究如何将链接包裹在 div 容器周围,以便可以使产品列表框成为产品信息页面的链接。我尝试过使用主页上显示的特价商品,但无济于事。
这是代码
$list_box_contents = array();
while (!$specials_index->EOF) {
$products_price = zen_get_products_display_price($specials_index->fields['products_id']);
$products_description = zen_trunc_string(zen_clean_html(stripslashes(zen_get_products_description($specials_index->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION); //To Display Product Desc
$products_description = ltrim(substr($products_description, 0, 39) . '...'); //Trims and Limits the desc
if (!isset($productsInCategory[$specials_index->fields['products_id']])) $productsInCategory[$specials_index->fields['products_id']] = zen_get_generated_category_path_rev($specials_index->fields['master_categories_id']);
$specials_index->fields['products_name'] = zen_get_products_name($specials_index->fields['products_id']);
$list_box_contents[$row][$col] = array('params' => 'class="centerBoxContentsSpecials centeredContent back"' . ' ' . 'style="width:' . $col_width . '%;"',
'text' => (($specials_index->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) ? '' : ' <div class="imagename"><div class="product_image">
<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . (int)$specials_index->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $specials_index->fields['products_image'], $specials_index->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a></div><div class="product_name">') . '<a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . $specials_index->fields['products_id']) . '">' . $specials_index->fields['products_name'] . '</a></div><div class="product_desc"><p class="s_desc">' . $products_description .'</p></div></div><div class="propricemain"><div class="prodprice">' . $products_price . '</div><div class="productbtn"><div class="mj-productdetailimage"><a href="' . zen_href_link(zen_get_info_page($specials_index->fields['products_id']), 'cPath=' . $productsInCategory[$specials_index->fields['products_id']] . '&products_id=' . (int)$specials_index->fields['products_id']) . '">More</a></div></div></div>');
我很高兴使用 css 或 jquery 来完成此任务。