function show_votes($product_id) { echo ps_reviews::allvotes($product_id); }
$product_name .= " (" . $VM_LANG->_('CMN_UNPUBLISHED', false) . ")"; } if (empty($product_name) && $product_parent_id != 0) { $product_name = $dbp->f("product_name"); // Use product_name from Parent Product } $product_s_desc = $db_browse->f("product_s_desc"); if (empty($product_s_desc) && $product_parent_id != 0) { $product_s_desc = $dbp->f("product_s_desc"); // Use product_s_desc from Parent Product } $product_details = $VM_LANG->_('PHPSHOP_FLYPAGE_LBL'); if (PSHOP_ALLOW_REVIEWS == '1' && @$_REQUEST['output'] != "pdf") { // Average customer rating: xxxxx // Total votes: x $product_rating = ps_reviews::allvotes($db_browse->f("product_id")); } else { $product_rating = ""; } // Add-to-Cart Button if (USE_AS_CATALOGUE != '1' && $product_price != "" && !stristr($product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL')) && !ps_product::product_has_attributes($db_browse->f('product_id'), true) && $tpl->get_cfg('showAddtocartButtonOnProductList')) { $tpl->set('i', $i); $tpl->set('product_id', $db_browse->f('product_id')); $tpl->set('product_in_stock', $db_browse->f('product_in_stock')); $tpl->set('ps_product_attribute', $ps_product_attribute); $products[$i]['form_addtocart'] = $tpl->fetch('browse/includes/addtocart_form.tpl.php'); $products[$i]['has_addtocart'] = true; } else { $products[$i]['form_addtocart'] = ''; $products[$i]['has_addtocart'] = false; }
$buttons_header = $tpl->fetch('common/buttons.tpl.php'); $tpl->set('buttons_header', $buttons_header); // AVAILABILITY // This is the place where it shows: Availability: 24h, In Stock: 5 etc. // You can make changes to this functionality in the file: classes/ps_product.php $product_availability = $ps_product->get_availability($product_id); } $product_availability_data = $ps_product->get_availability_data($product_id); /** Ask seller a question **/ $ask_seller_href = $sess->url($_SERVER['PHP_SELF'] . '?page=shop.ask&flypage=' . @$_REQUEST['flypage'] . "&product_id={$product_id}&category_id={$category_id}"); $ask_seller_text = $VM_LANG->_('VM_PRODUCT_ENQUIRY_LBL'); $ask_seller = '<a class="button" href="' . $ask_seller_href . '">' . $ask_seller_text . '</a>'; /* SHOW RATING */ $product_rating = ""; if (PSHOP_ALLOW_REVIEWS == '1') { $product_rating = ps_reviews::allvotes($product_id); } $product_reviews = $product_reviewform = ""; /* LIST ALL REVIEWS **/ if (PSHOP_ALLOW_REVIEWS == '1') { /*** Show all reviews available ***/ $product_reviews = ps_reviews::product_reviews($product_id); /*** Show a form for writing a review ***/ if ($auth['user_id'] > 0) { $product_reviewform = ps_reviews::reviewform($product_id); } } /* LINK TO VENDOR-INFO POP-UP **/ $vend_id = $ps_product->get_vendor_id($product_id); $vend_name = $ps_product->get_vendorname($product_id); $link = "{$mosConfig_live_site}/index2.php?page=shop.infopage&vendor_id={$vend_id}&output=lite&option=com_virtuemart&Itemid=" . $Itemid;