The code for that page is in /includes/modules/YOUR_TEMPLATE_NAME/product_listing.php
This code will differ from the previous.
The code for that page is in /includes/modules/YOUR_TEMPLATE_NAME/product_listing.php
This code will differ from the previous.
got it, the file is too long paste it in this message but I think I found the part that needs to be changed, I thank you again, here is the part that needs to be changed.
// qty box with add to cart button
if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
$lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
} else {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
}
}
}
$the_button = $lc_button;
$products_link = '<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']) . '">' . MORE_INFO_TEXT . '</a>';
$lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
$lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
// bof: add date available
$products_date_available = zen_products_lookup($listing->fields['products_id'], 'products_date_available');
if ($products_date_available > date('Y-m-d H:i:s')) {
$lc_text .= '<br /><div class="pl-shipping">' . 'Pre Order</div>';
}elseif ($listing->fields['products_quantity'] > 0){
$lc_text .= '<br />' . '<div class="pl-shipping">In Stock<br />Ships in 1 - 3 Business Days</div>';
}else{
$lc_text .= '<br />' . '<div class="pl-shipping">Out of Stock</div>';
}
// eof: add date available
just replace
with:PHP Code:$lc_text .= '<br /><div class="pl-shipping">' . 'Pre Order</div>';
PHP Code:$lc_text .= '<br /><div class="pl-shipping">' . TEXT_PRE_ORDER_BOF . zen_date_long($products_date_available) . TEXT_PRE_ORDER_EOF . '<br/>Pre-Order</div>';
it works but looks like the height of the cell needs to be adjusted, any idea how to fix it, http://www.aydincoins.com/buy-silver/silver-rounds
thank you
in stylesheet.css
find
.pl-shipping{margin-top:105px;width:200px;line-height:22px;margin-left:-205px;}
change to
.pl-shipping{margin-top:105px;width:220px;line-height:11px;margin-left:-205px;}
Thank you for your help, one more request, how can I add the 'Write Review' or Read the Reviews link next to the stars on this page: http://www.aydincoins.com/buy-silver/silver-rounds it only shows the stars, below is the code I think for the stars:
// I've adapted the following table style from my custom tpl_modules_product_quantity_discounts, I've made it more vertical to make it fit better, if you want the original horizontal layout you can find the code in tpl_modules_product_quantity_discounts
//NB the TEXT_HEADER below is for ACTUAL PRICE DISCOUNTS it could be replaced with the alternatives: TEXT_HEADER_DISCOUNT_PRICES_AMOUNT_OFF or TEXT_HEADER_DISCOUNT_PRICES_PERCENTAGE.
$lc_text = '<center><table class="pl-qd-table" cellspacing="0" cellpadding="3">
<tr style="background: #ECF8FD; font-weight: bold">
<!--<td colspan="2" align="center">Quantity Price</font></td> </tr>-->
<tr><td align="left">' . $show_qty . '</td><td>' . $currencies->display_price($show_price, zen_get_tax_rate($products_tax_class_id)) . '</td></tr>
<tr><td align="left">' . $discount_level_1['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_1['discounted_price'], zen_get_tax_rate($products_tax_class_id)) . '</td></tr>
<tr><td align="left">'. $discount_level_2['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_2['discounted_price'], zen_get_tax_rate($products_tax_class_id)) .'</td></tr>
<tr><td align="left">'. $discount_level_3['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_3['discounted_price'], zen_get_tax_rate($products_tax_class_id)) .'</td></tr>
<tr><td align="left">'. $discount_level_4['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_4['discounted_price'], zen_get_tax_rate($products_tax_class_id)) .'</td></tr>
<!--<tr><td align="left">'. $discount_level_5['show_qty'] . '</td><td>' . $currencies->display_price($discount_level_5['discounted_price'], zen_get_tax_rate($products_tax_class_id)) .'</td></tr>--></table></center>' ;
} else {
$lc_text ='<div class="no-qd"></div>';
}
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($listi ng->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($listi ng->fields['products_id'], $_SESSION['languages_id']))), PRODUCT_LIST_DESCRIPTION) . '</div><center><div class="product_detail"><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']) . '">' .zen_image_button(BUTTON_IMAGE_GOTO_PROD_DETAILS , BUTTON_GOTO_PROD_DETAILS_ALT).'</a></div></center><div id="askQuestion" class="biggerText"><a href="' . zen_href_link(FILENAME_ASK_A_QUESTION, 'products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_ASK_A_QUESTION, BUTTON_ASK_A_QUESTION_ALT) . '</a></div>';
// 2P added BOF - Average Product Rating
$reviews_query = "select count(*) as count from " . TABLE_REVIEWS . " r, "
. TABLE_REVIEWS_DESCRIPTION . " rd
where r.products_id = '" . (int)$listing->fields['products_id'] . "'
and r.reviews_id = rd.reviews_id
and rd.languages_id = '" . (int)$_SESSION['languages_id'] . "'" .
$review_status;
$reviews = $db->Execute($reviews_query);
$reviews_average_rating_query = "select avg(reviews_rating) as average_rating from " . TABLE_REVIEWS . " r, "
. TABLE_REVIEWS_DESCRIPTION . " rd
where r.products_id = '" . (int)$listing->fields['products_id'] . "'
and r.reviews_id = rd.reviews_id
and rd.languages_id = '" . (int)$_SESSION['languages_id'] . "'" .
$review_status;
$reviews_average_rating = $db->Execute($reviews_average_rating_query);
// 2P added EOF - Average Product Rating
if ($reviews->fields['count'] > 0 ) {
//$lc_text .= TEXT_CURRENT_REVIEWS . ' <strong>' . $reviews->fields['count'] . '</strong><br />';
$stars_image_suffix = str_replace('.', '_', zen_round($reviews_average_rating->fields['average_rating'] * 2, 0) / 2); // for stars_0_5.gif, stars_1.gif, stars_1_5.gif etc.
$average_rating = zen_round($reviews_average_rating->fields['average_rating'], 2);
$lc_text .= '<div class="stars-rating">' . zen_image(DIR_WS_TEMPLATE_IMAGES . 'stars_' . $stars_image_suffix . '.gif', sprintf(BOX_REVIEWS_TEXT_OF_5_STARS, $average_rating)) . '</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':
$our_new_variable = zen_products_lookup($listing->fields['products_id'], $what_field = 'products_discount_type');
if ($our_new_variable == 1) {
$lc_price = '<div class="pl-price1" style="position:relative;left:150px;top:10px;">' . zen_get_products_display_price($listing->fields['products_id']) . '</div><br />';
}
else {
$lc_price = '<div class="pl-price">' . zen_get_products_display_price($listing->fields['products_id']) . '</div><br />';
}
$lc_align = 'right';
$lc_text = $lc_price;
// more info in place of buy now
$lc_button = '';
if (zen_has_product_attributes($listing->fields['products_id']) or PRODUCT_LIST_PRICE_BUY_NOW == '0') {
$lc_button = '<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 ? $_GET['cPath'] : zen_get_generated_category_path_rev($listing->fields['master_categories_id']))) . '&products_id=' . $listing->fields['products_id']) . '">' . MORE_INFO_TEXT . '</a>';
} else {
if (PRODUCT_LISTING_MULTIPLE_ADD_TO_CART != 0) {
if (
// not a hide qty box product
$listing->fields['products_qty_box_status'] != 0 &&
// product type can be added to cart
zen_get_products_allow_add_to_cart($listing->fields['products_id']) != 'N'
&&
// product is not call for price
$listing->fields['product_is_call'] == 0
&&
// product is in stock or customers may add it to cart anyway
($listing->fields['products_quantity'] > 0 || SHOW_PRODUCTS_SOLD_OUT_IMAGE == 0) ) {
$how_many++;
}
// hide quantity box
if ($listing->fields['products_qty_box_status'] == 0) {
$lc_button = 'hello<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
} else {
if ($our_new_variable >= 2) {
$lc_button = '<div class="pl-input" style="position:relative;top:170px;left:170px;">' . TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" /></div>";
}
else {
$lc_button = '<div class="pl-input1">' . TEXT_PRODUCT_LISTING_MULTIPLE_ADD_TO_CART . "<input type=\"text\" name=\"products_id[" . $listing->fields['products_id'] . "]\" value=\"0\" size=\"4\" /></div>";
}
}
} else {
// qty box with add to cart button
if (PRODUCT_LIST_PRICE_BUY_NOW == '2' && $listing->fields['products_qty_box_status'] != 0) {
$lc_button= zen_draw_form('cart_quantity', zen_href_link(zen_get_info_page($listing->fields['products_id']), zen_get_all_get_params(array('action')) . 'action=add_product&products_id=' . $listing->fields['products_id']), 'post', 'enctype="multipart/form-data"') . '<input type="text" name="cart_quantity" value="' . (zen_get_buy_now_qty($listing->fields['products_id'])) . '" maxlength="6" size="4" /><br />' . zen_draw_hidden_field('products_id', $listing->fields['products_id']) . zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT) . '</form>';
} else {
$lc_button = '<a href="' . zen_href_link($_GET['main_page'], zen_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $listing->fields['products_id']) . '">' . zen_image_button(BUTTON_IMAGE_BUY_NOW, BUTTON_BUY_NOW_ALT, 'class="listingBuyNowButton"') . '</a>';
}
}
}
$the_button = $lc_button;
$products_link = '<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']) . '">' . MORE_INFO_TEXT . '</a>';
$lc_text .= '<br />' . zen_get_buy_now_button($listing->fields['products_id'], $the_button, $products_link) . '<br />' . zen_get_products_quantity_min_units_display($listing->fields['products_id']);
$lc_text .= '<br />' . (zen_get_show_product_switch($listing->fields['products_id'], 'ALWAYS_FREE_SHIPPING_IMAGE_SWITCH') ? (zen_get_product_is_always_free_shipping($listing->fields['products_id']) ? TEXT_PRODUCT_FREE_SHIPPING_ICON . '<br />' : '') : '');
// bof: add date available
$products_date_available = zen_products_lookup($listing->fields['products_id'], 'products_date_available');
if ($products_date_available > date('Y-m-d H:i:s')) {
$lc_text .= '<br /><div class="pl-shipping">' . TEXT_PRE_ORDER_BOF . zen_date_long($products_date_available) . TEXT_PRE_ORDER_EOF . '<br/><br/>Pre-Order</div>';
}elseif ($listing->fields['products_quantity'] > 0){
$lc_text .= '<br />' . '<div class="pl-shipping">In Stock<br />Ships in 1 - 3 Business Days</div>';
}else{
$lc_text .= '<br />' . '<div class="pl-shipping">Out of Stock</div>';
}
The stock code for that mod actually did something similar to just that.
As the code sits right now:
if a review exists it shows the stars otherwise it doesn't
Do you want a write a review or read reviews next to it no matter what or if review exist a read reviews link and if no reviews exist a write a review link?
Do you want the Average Rating to appear as it should?
Do you want the # of reviews to appear as it should?