توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : فونت و لينك در ويرچومارت
با سلام مي خواستم ببينم اندازه فونتها را در ويرچومارت چگونه ميشه تغيير داد مثلا قيمت يا عنوان كالا و اينكه وقتي روي يك كالا كليك مي كنيم چگونه _blank باز شود . ممنون
firoozmandan
01-05-2010, 01:23 PM
سلام
باید چک کنید ببینید این قسمت از چه کلاسی در css استفاده میکنه.
بعد از فهمیدن این موضوع میتونید سایز فونت را افزایش بدید
برای باز شدن لینک ها در صفحه جدید از
target="_blank"
استفاده کنید ( البته باید کد ها را ویرایش کنید . )
یا علی
با سلام مجدد من مي خواستم در صفحه اصلي ويرچومارت در سايت كه همه محصولات وجود دارد براي رفتن به جزئيات محصولات وقتي روي آن كليك مي كنيم در يك صفحه جديد باز بشه (_blank) .ممنون
لطفا اگر کسی میتونه کمک کنه . ممنون
** دو پست شما یکی شد
سلام
آدرس سایتتون رو لطف کنید تا برای تغییر سایز فونت راهنماییتون کنم.
مورد دوم نیاز به ویرایش کدها داره.
یا علی
با سلام فونت رو درست کردم اگه ممکن است برای مورد دوم توضیح بدید . ممنون
سلام
شما باید فایل php که حاوی کدهای سازنده ی صفحه ی نمایش محصولات هستند رو در پوشه ی کامپوننت پیدا کنید و سپس در فایل بدنبال دستوری که لینک محصولات رو میسازه بگردید و به تگ <a> مقدار target="_blank" رو اضافه کنید.
یا علی
با سلام هر کجا که می گذارم جواب نمیده اینم کدش . ببخشید مزاحم میشم
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
*
* @version $Id: shop.product_details.php 1839 2009-06-29 20:25:44Z soeren_nb $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2009 soeren - All rights reserved.
* @license <b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b> GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* <b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b>
*/
mm_showMyFileName( __FILE__ );
require_once(CLASSPATH . 'ps_product_files.php' );
require_once(CLASSPATH . 'imageTools.class.php' );
require_once(CLASSPATH . 'ps_product.php' );
$ps_product = $GLOBALS['ps_product'] = new ps_product;
require_once(CLASSPATH . 'ps_product_category.php' );
$ps_product_category = new ps_product_category;
require_once(CLASSPATH . 'ps_product_attribute.php' );
$ps_product_attribute = new ps_product_attribute;
require_once(CLASSPATH . 'ps_product_type.php' );
$ps_product_type = new ps_product_type;
require_once(CLASSPATH . 'ps_reviews.php' );
$product_id = intval( vmGet($_REQUEST, "product_id", null) );
$product_sku = $db->getEscaped( vmGet($_REQUEST, "sku", '' ) );
$category_id = vmGet($_REQUEST, "category_id", null);
$pop = (int)vmGet($_REQUEST, "pop", 0);
$manufacturer_id = vmGet($_REQUEST, "manufacturer_id", null);
$Itemid = $sess->getShopItemid();
$db_product = new ps_DB;
// Get the product info from the database
$q = "SELECT * FROM `#__{vm}_product` WHERE ";
if( !empty($product_id)) {
$q .= "`product_id`=$product_id";
}
elseif( !empty($product_sku )) {
$q .= "`product_sku`='$product_sku'";
}
else {
vmRedirect( $sess->url( $_SERVER['PHP_SELF']."?keyword=".urlencode($keyword)."&category_id={$_ SESSION['session_userstate']['category_id']}&limitstart={$_SESSION['limitstart']}&page=shop.browse", false, false ), $VM_LANG->_('PHPSHOP_PRODUCT_NOT_FOUND') );
}
if( !$perm->check("admin,storeadmin") ) {
$q .= " AND `product_publish`='Y'";
if( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
$q .= " AND `product_in_stock` > 0 ";
}
}
$db_product->query( $q );
// Redirect back to Product Browse Page on Error
if( !$db_product->next_record() ) {
$vmLogger->err( $VM_LANG->_('PHPSHOP_PRODUCT_NOT_FOUND',false) );
return;
}
if( empty($product_id)) {
$product_id = $db_product->f('product_id');
}
$product_parent_id = (int)$db_product->f("product_parent_id");
if ($product_parent_id != 0) {
$dbp= new ps_DB;
$dbp->query('SELECT * FROM `#__{vm}_product` WHERE `product_id`='.$product_parent_id );
$dbp->next_record();
}
// Create the template object
$tpl = vmTemplate::getInstance();
// Let's have a look wether the product has related products.
$q = "SELECT product_sku, related_products FROM #__{vm}_product,#__{vm}_product_relations ";
$q .= "WHERE #__{vm}_product_relations.product_id='$product_id' AND product_publish='Y' ";
$q .= "AND FIND_IN_SET(#__{vm}_product.product_id, REPLACE(related_products, '|', ',' )) LIMIT 0, 4";
$db->query( $q );
/*// This shows randomly selected products from the products table
// if you don't like to set up related products for each product
$q = "SELECT product_sku FROM #__{vm}_product ";
$q .= "WHERE product_publish='Y' AND product_id != $product_id ";
$q .= "ORDER BY RAND() LIMIT 0, 4";
$db->query( $q );*/
$related_products = '';
if( $db->num_rows() > 0 ) {
$tpl->set( 'ps_product', $ps_product );
$tpl->set( 'products', $db );
$related_products = $tpl->fetch( '/common/relatedProducts.tpl.php' );
}
// GET THE PRODUCT NAME
$product_name = shopMakeHtmlSafe( $db_product->f("product_name") );
if( $db_product->f("product_publish") == "N" ) {
$product_name .= " (".$VM_LANG->_('CMN_UNPUBLISHED').")";
}
$product_description = $db_product->f("product_desc");
if( (str_replace("<br />", "" , $product_description)=='') && ($product_parent_id!=0) ) {
$product_description = $dbp->f("product_desc"); // Use product_desc from Parent Product
}
$product_description = vmCommonHTML::ParseContentByPlugins( $product_description );
// Get the CATEGORY NAVIGATION
$navigation_pathway = "";
$navigation_childlist = "";
$pathway_appended = false;
$flypage = vmGet($_REQUEST, "flypage" );
// Each Product is assigned to one or more Categories, if category_id was omitted, we must fetch it here
if (empty($category_id) || empty( $flypage )) {
$q = "SELECT cx.category_id, category_flypage FROM #__{vm}_category c, #__{vm}_product_category_xref cx WHERE product_id = '$product_id' AND c.category_id=cx.category_id LIMIT 0,1";
$db->query( $q );
$db->next_record();
if( !$db->f("category_id") ) {
// The Product Has no category entry and must be a Child Product
// So let's get the Parent Product
$q = "SELECT product_id FROM #__{vm}_product WHERE product_id = '".$db_product->f("product_parent_id")."' LIMIT 0,1";
$db->query( $q );
$db->next_record();
$q = "SELECT cx.category_id, category_flypage FROM #__{vm}_category c, #__{vm}_product_category_xref cx WHERE product_id = '".$db->f("product_id")."' AND c.category_id=cx.category_id LIMIT 0,1";
$db->query( $q );
$db->next_record();
}
$_GET['category_id'] = $category_id = $db->f("category_id");
}
if( empty( $flypage )) {
$flypage = $db->f('category_flypage') ? $db->f('category_flypage') : FLYPAGE;
}
// Flypage Parameter has old page syntax: shop.flypage
// so let's get the second part - flypage
$flypage = str_replace( 'shop.', '', $flypage);
$flypage = stristr( $flypage, '.tpl') ? $flypage : $flypage . '.tpl';
// Set up the pathway
// Retrieve the pathway items for this product's category
$category_list = array_reverse( $ps_product_category->get_navigation_list( $category_id ) );
$pathway = $ps_product_category->getPathway( $category_list );
// Add this product's name to the pathway, with no link
$item = new stdClass();
$item->name = $product_name;
$item->link = '';
$pathway[] = $item;
// Set the CMS pathway
$vm_mainframe->vmAppendPathway( $pathway );
// Set the pathway for our template
$tpl->set( 'pathway', $pathway );
$tpl->set( 'product_name', $product_name );
// Get the neighbor Products to allow navigation on product level
$neighbors = $ps_product->get_neighbor_products( !empty( $product_parent_id ) ? $product_parent_id : $product_id );
$next_product = $neighbors['next'];
$previous_product = $neighbors['previous'];
$next_product_url = $previous_product_url = '';
if( !empty($next_product) ) {
$url_parameters = 'page=shop.product_details&product_id='.$next_prod uct['product_id'].'&flypage='.$ps_product->get_flypage($next_product['product_id']).'&pop='.$pop;
if( $manufacturer_id ) {
$url_parameters .= "&amp;manufacturer_id=" . $manufacturer_id;
}
if( $keyword != '') {
$url_parameters .= "&amp;keyword=".urlencode($keyword);
}
if( $pop == 1 ) {
$next_product_url = $sess->url( $_SERVER['PHP_SELF'].'?'.$url_parameters );
} else {
$next_product_url = str_replace("index2","index",$sess->url( $url_parameters ));
}
}
if( !empty($previous_product) ) {
$url_parameters = 'page=shop.product_details&product_id='.$previous_ product['product_id'].'&flypage='.$ps_product->get_flypage($previous_product['product_id']).'&pop='.$pop;
if( $manufacturer_id ) {
$url_parameters .= "&amp;manufacturer_id=" . $manufacturer_id;
}
if( $keyword != '') {
$url_parameters .= "&amp;keyword=".urlencode($keyword);
}
if( $pop == 1 ) {
$previous_product_url = $sess->url( $_SERVER['PHP_SELF'].'?'.$url_parameters );
} else {
$previous_product_url = str_replace("index2","index",$sess->url( $url_parameters ));
}
}
$tpl->set( 'next_product', $next_product );
$tpl->set( 'next_product_url', $next_product_url );
$tpl->set( 'previous_product', $previous_product );
$tpl->set( 'previous_product_url', $previous_product_url );
$parent_id_link = $db_product->f("product_parent_id");
$return_link = "";
if ($parent_id_link <> 0 ) {
$q = "SELECT product_name FROM #__{vm}_product WHERE product_id = '$product_parent_id' LIMIT 0,1";
$db->query( $q );
$db->next_record();
$product_parent_name = $db->f("product_name");
$return_link = "&nbsp;<a class=\"pathway\" href=\"";
$return_link .= $sess->url($_SERVER['PHP_SELF'] . "?page=shop.product_details&product_id=$parent_id_ link");
$return_link .= "\">";
$return_link .= $product_parent_name;
$return_link .= "</a>";
$return_link .= " ".vmCommonHTML::pathway_separator()." ";
}
$tpl->set( 'return_link', $return_link );
// Create the pathway for our template
$navigation_pathway = $tpl->fetch( 'common/pathway.tpl.php');
if ($ps_product_category->has_childs($category_id) ) {
$category_childs = $ps_product_category->get_child_list($category_id);
$tpl->set( 'categories', $category_childs );
$navigation_childlist = $tpl->fetch( 'common/categoryChildlist.tpl.php');
}
// Set Dynamic Page Title
if( function_exists('mb_substr')) {
$page_title = mb_substr($product_name, 0, 64, vmGetCharset() );
} else {
$page_title = substr($product_name, 0, 64 );
}
$vm_mainframe->setPageTitle( html_entity_decode( $page_title, ENT_QUOTES, vmGetCharset() ));
// Prepend Product Short Description Meta Tag "description"
if( vmIsJoomla('1.5')) {
$document = JFactory::getDocument();
$document->setDescription(strip_tags( $db_product->f("product_s_desc")));
} else {
$mainframe->prependMetaTag( "description", strip_tags( $db_product->f("product_s_desc")) );
}
// Show an "Edit PRODUCT"-Link
if ($perm->check("admin,storeadmin")) {
$edit_link = '<a href="'. $sess->url( 'index2.php?page=product.product_form&next_page=sh op.product_details&product_id='.$product_id).'">
<img src="images/M_images/edit.png" alt="'. $VM_LANG->_('PHPSHOP_PRODUCT_FORM_EDIT_PRODUCT') .'" border="0" /></a>';
}
else {
$edit_link = "";
}
// LINK TO MANUFACTURER POP-UP
$manufacturer_id = $ps_product->get_manufacturer_id($product_id);
$manufacturer_name = $ps_product->get_mf_name($product_id);
$manufacturer_link = "";
if( $manufacturer_id && !empty($manufacturer_name) ) {
$link = "$mosConfig_live_site/index2.php?page=shop.manufacturer_page&amp;manufac turer_id=$manufacturer_id&amp;output=lite&amp;opti on=com_virtuemart&amp;Itemid=".$Itemid;
$text = '( '.$manufacturer_name.' )';
$manufacturer_link .= vmPopupLink( $link, $text );
// Avoid JavaScript on PDF Output
if( @$_REQUEST['output'] == "pdf" )
$manufacturer_link = "<a href=\"$link\" target=\"_blank\" title=\"$text\">$text</a>";
}
// PRODUCT PRICE
if (_SHOW_PRICES == '1') {
if( $db_product->f("product_unit") && VM_PRICE_SHOW_PACKAGING_PRICELABEL) {
$product_price_lbl = "<strong>". $VM_LANG->_('PHPSHOP_CART_PRICE_PER_UNIT').' ('.$db_product->f("product_unit")."):</strong>";
}
else {
$product_price_lbl = "<strong>". $VM_LANG->_('PHPSHOP_CART_PRICE'). ": </strong>";
}
$product_price = $ps_product->show_price( $product_id );
}
else {
$product_price_lbl = "";
$product_price = "";
}
// @var array $product_price_raw The raw unformatted Product Price in Float Format
$product_price_raw = $ps_product->get_adjusted_attribute_price($product_id);
// Change Packaging - Begin
// PRODUCT PACKAGING
if ( $db_product->f("product_packaging") ) {
$packaging = $db_product->f("product_packaging") & 0xFFFF;
$box = ($db_product->f("product_packaging") >> 16) & 0xFFFF;
$product_packaging = "";
if ( $packaging ) {
$product_packaging .= $VM_LANG->_('PHPSHOP_PRODUCT_PACKAGING1').$packaging;
if( $box ) $product_packaging .= "<br/>";
}
if ( $box ) {
$product_packaging .= $VM_LANG->_('PHPSHOP_PRODUCT_PACKAGING2').$box;
}
$product_packaging = str_replace("{unit}",$db_product->f("product_unit")?$db_product->f("product_unit") : $VM_LANG->_('PHPSHOP_PRODUCT_FORM_UNIT_DEFAULT'),$product_p ackaging);
}
else {
$product_packaging = "";
}
// Change Packaging - End
// PRODUCT IMAGE
$product_full_image = $product_parent_id!=0 && !$db_product->f("product_full_image") ?
$dbp->f("product_full_image") : $db_product->f("product_full_image"); // Change
$product_thumb_image = $product_parent_id!=0 && !$db_product->f("product_thumb_image") ?
$dbp->f("product_thumb_image") : $db_product->f("product_thumb_image"); // Change
/* MORE IMAGES ??? */
$files = ps_product_files::getFilesForProduct( $product_id );
$more_images = "";
if( !empty($files['images']) ) {
$more_images = $tpl->vmMoreImagesLink( $files['images'] );
}
// Does the Product have files?
$file_list = ps_product_files::get_file_list( $files['product_id'] );
$product_availability = '';
if( @$_REQUEST['output'] != "pdf" ) {
// Show the PDF, Email and Print buttons
// 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&amp;flypage='.@$_REQUEST['flypage ']."&amp;product_id=$product_id&amp;category_id=$cat egory_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&amp;vendor_id=$vend_ id&amp;output=lite&amp;option=com_virtuemart&amp;I temid=".$Itemid;
$text = $VM_LANG->_('PHPSHOP_VENDOR_FORM_INFO_LBL');
$vendor_link = vmPopupLink( $link, $text );
// Avoid JavaScript on PDF Output
if( @$_REQUEST['output'] == "pdf" )
$vendor_link = "<a href=\"$link\" target=\"_blank\" title=\"$text\">$text</a>";
if ($product_parent_id!=0 && !$ps_product_type->product_in_product_type($product_id)) {
$product_type = $ps_product_type->list_product_type($product_parent_id);
}
else {
$product_type = $ps_product_type->list_product_type($product_id);
}
/**
* This has changed since VM 1.1.0
* Now we have a template object that can use all variables
* that we assign here.
*
* Example: If you run
* $tpl->set( "product_name", $product_name );
* The variable "product_name" will be available in the template under this name
* with the value of $product_name
*
* */
// This part allows us to copy ALL properties from the product table
// into the template
$productData = $db_product->get_row();
$productArray = get_object_vars( $productData );
$productArray["product_id"] = $product_id;
$productArray["product_full_image"] = $product_full_image; // to display the full image on flypage
$productArray["product_thumb_image"] = $product_thumb_image;
$productArray["product_name"] = shopMakeHtmlSafe($productArray["product_name"]);
$tpl->set( 'productArray', $productArray );
foreach( $productArray as $property => $value ) {
$tpl->set( $property, $value);
}
// Assemble the thumbnail image as a link to the full image
// This function is defined in the theme (theme.php)
$product_image = $tpl->vmBuildFullImageLink( $productArray );
$tpl->set( "product_id", $product_id );
$tpl->set( "product_name", $product_name );
$tpl->set( "product_image", $product_image );
$tpl->set( "more_images", $more_images );
$tpl->set( "images", $files['images'] );
$tpl->set( "files", $files['files'] );
$tpl->set( "file_list", $file_list );
$tpl->set( "edit_link", $edit_link );
$tpl->set( "manufacturer_link", $manufacturer_link );
$tpl->set( "product_price", $product_price );
$tpl->set( "product_price_lbl", $product_price_lbl );
$tpl->set( 'product_price_raw', $product_price_raw );
$tpl->set( "product_description", $product_description );
/* ADD-TO-CART */
$tpl->set( 'manufacturer_id', $manufacturer_id );
$tpl->set( 'flypage', $flypage );
$tpl->set( 'ps_product_attribute', $ps_product_attribute );
$addtocart = $tpl->fetch('product_details/includes/addtocart_form.tpl.php' );
$tpl->set( "addtocart", $addtocart );
// Those come from separate template files
$tpl->set( "navigation_pathway", $navigation_pathway );
$tpl->set( "navigation_childlist", $navigation_childlist );
$tpl->set( "product_reviews", $product_reviews );
$tpl->set( "product_reviewform", $product_reviewform );
$tpl->set( "product_availability", $product_availability );
$tpl->set( "product_availability_data", $product_availability_data );
$tpl->set( "related_products", $related_products );
$tpl->set( "vendor_link", $vendor_link );
$tpl->set( "product_type", $product_type ); // Changed Product Type
$tpl->set( "product_packaging", $product_packaging ); // Changed Packaging
$tpl->set( "ask_seller_href", $ask_seller_href ); // Product Enquiry!
$tpl->set( "ask_seller_text", $ask_seller_text ); // Product Enquiry!
$tpl->set( "ask_seller", $ask_seller ); // Product Enquiry!
$tpl->set( "recent_products", $recent_products); // Recent products
/* Finish and Print out the Page */
echo $tpl->fetch( '/product_details/'.$flypage . '.php' );
?>
** تگ کد اضافه شد
سلام
کد زیر رو جایگزین کنید ببینید مشکل حل میشه یا خیر:
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
*
* @version $Id: shop.product_details.php 1839 2009-06-29 20:25:44Z soeren_nb $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2009 soeren - All rights reserved.
* @license <b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b> GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* <b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b>
*/
mm_showMyFileName( __FILE__ );
require_once(CLASSPATH . 'ps_product_files.php' );
require_once(CLASSPATH . 'imageTools.class.php' );
require_once(CLASSPATH . 'ps_product.php' );
$ps_product = $GLOBALS['ps_product'] = new ps_product;
require_once(CLASSPATH . 'ps_product_category.php' );
$ps_product_category = new ps_product_category;
require_once(CLASSPATH . 'ps_product_attribute.php' );
$ps_product_attribute = new ps_product_attribute;
require_once(CLASSPATH . 'ps_product_type.php' );
$ps_product_type = new ps_product_type;
require_once(CLASSPATH . 'ps_reviews.php' );
$product_id = intval( vmGet($_REQUEST, "product_id", null) );
$product_sku = $db->getEscaped( vmGet($_REQUEST, "sku", '' ) );
$category_id = vmGet($_REQUEST, "category_id", null);
$pop = (int)vmGet($_REQUEST, "pop", 0);
$manufacturer_id = vmGet($_REQUEST, "manufacturer_id", null);
$Itemid = $sess->getShopItemid();
$db_product = new ps_DB;
// Get the product info from the database
$q = "SELECT * FROM `#__{vm}_product` WHERE ";
if( !empty($product_id)) {
$q .= "`product_id`=$product_id";
}
elseif( !empty($product_sku )) {
$q .= "`product_sku`='$product_sku'";
}
else {
vmRedirect( $sess->url( $_SERVER['PHP_SELF']."?keyword=".urlencode($keyword)."&category_id={$_ SESSION['session_userstate']['category_id']}&limitstart={$_SESSION['limitstart']}&page=shop.browse", false, false ), $VM_LANG->_('PHPSHOP_PRODUCT_NOT_FOUND') );
}
if( !$perm->check("admin,storeadmin") ) {
$q .= " AND `product_publish`='Y'";
if( CHECK_STOCK && PSHOP_SHOW_OUT_OF_STOCK_PRODUCTS != "1") {
$q .= " AND `product_in_stock` > 0 ";
}
}
$db_product->query( $q );
// Redirect back to Product Browse Page on Error
if( !$db_product->next_record() ) {
$vmLogger->err( $VM_LANG->_('PHPSHOP_PRODUCT_NOT_FOUND',false) );
return;
}
if( empty($product_id)) {
$product_id = $db_product->f('product_id');
}
$product_parent_id = (int)$db_product->f("product_parent_id");
if ($product_parent_id != 0) {
$dbp= new ps_DB;
$dbp->query('SELECT * FROM `#__{vm}_product` WHERE `product_id`='.$product_parent_id );
$dbp->next_record();
}
// Create the template object
$tpl = vmTemplate::getInstance();
// Let's have a look wether the product has related products.
$q = "SELECT product_sku, related_products FROM #__{vm}_product,#__{vm}_product_relations ";
$q .= "WHERE #__{vm}_product_relations.product_id='$product_id' AND product_publish='Y' ";
$q .= "AND FIND_IN_SET(#__{vm}_product.product_id, REPLACE(related_products, '|', ',' )) LIMIT 0, 4";
$db->query( $q );
/*// This shows randomly selected products from the products table
// if you don't like to set up related products for each product
$q = "SELECT product_sku FROM #__{vm}_product ";
$q .= "WHERE product_publish='Y' AND product_id != $product_id ";
$q .= "ORDER BY RAND() LIMIT 0, 4";
$db->query( $q );*/
$related_products = '';
if( $db->num_rows() > 0 ) {
$tpl->set( 'ps_product', $ps_product );
$tpl->set( 'products', $db );
$related_products = $tpl->fetch( '/common/relatedProducts.tpl.php' );
}
// GET THE PRODUCT NAME
$product_name = shopMakeHtmlSafe( $db_product->f("product_name") );
if( $db_product->f("product_publish") == "N" ) {
$product_name .= " (".$VM_LANG->_('CMN_UNPUBLISHED').")";
}
$product_description = $db_product->f("product_desc");
if( (str_replace("<br />", "" , $product_description)=='') && ($product_parent_id!=0) ) {
$product_description = $dbp->f("product_desc"); // Use product_desc from Parent Product
}
$product_description = vmCommonHTML::ParseContentByPlugins( $product_description );
// Get the CATEGORY NAVIGATION
$navigation_pathway = "";
$navigation_childlist = "";
$pathway_appended = false;
$flypage = vmGet($_REQUEST, "flypage" );
// Each Product is assigned to one or more Categories, if category_id was omitted, we must fetch it here
if (empty($category_id) || empty( $flypage )) {
$q = "SELECT cx.category_id, category_flypage FROM #__{vm}_category c, #__{vm}_product_category_xref cx WHERE product_id = '$product_id' AND c.category_id=cx.category_id LIMIT 0,1";
$db->query( $q );
$db->next_record();
if( !$db->f("category_id") ) {
// The Product Has no category entry and must be a Child Product
// So let's get the Parent Product
$q = "SELECT product_id FROM #__{vm}_product WHERE product_id = '".$db_product->f("product_parent_id")."' LIMIT 0,1";
$db->query( $q );
$db->next_record();
$q = "SELECT cx.category_id, category_flypage FROM #__{vm}_category c, #__{vm}_product_category_xref cx WHERE product_id = '".$db->f("product_id")."' AND c.category_id=cx.category_id LIMIT 0,1";
$db->query( $q );
$db->next_record();
}
$_GET['category_id'] = $category_id = $db->f("category_id");
}
if( empty( $flypage )) {
$flypage = $db->f('category_flypage') ? $db->f('category_flypage') : FLYPAGE;
}
// Flypage Parameter has old page syntax: shop.flypage
// so let's get the second part - flypage
$flypage = str_replace( 'shop.', '', $flypage);
$flypage = stristr( $flypage, '.tpl') ? $flypage : $flypage . '.tpl';
// Set up the pathway
// Retrieve the pathway items for this product's category
$category_list = array_reverse( $ps_product_category->get_navigation_list( $category_id ) );
$pathway = $ps_product_category->getPathway( $category_list );
// Add this product's name to the pathway, with no link
$item = new stdClass();
$item->name = $product_name;
$item->link = '';
$pathway[] = $item;
// Set the CMS pathway
$vm_mainframe->vmAppendPathway( $pathway );
// Set the pathway for our template
$tpl->set( 'pathway', $pathway );
$tpl->set( 'product_name', $product_name );
// Get the neighbor Products to allow navigation on product level
$neighbors = $ps_product->get_neighbor_products( !empty( $product_parent_id ) ? $product_parent_id : $product_id );
$next_product = $neighbors['next'];
$previous_product = $neighbors['previous'];
$next_product_url = $previous_product_url = '';
if( !empty($next_product) ) {
$url_parameters = 'page=shop.product_details&product_id='.$next_prod uct['product_id'].'&flypage='.$ps_product->get_flypage($next_product['product_id']).'&pop='.$pop;
if( $manufacturer_id ) {
$url_parameters .= "&amp;manufacturer_id=" . $manufacturer_id;
}
if( $keyword != '') {
$url_parameters .= "&amp;keyword=".urlencode($keyword);
}
if( $pop == 1 ) {
$next_product_url = $sess->url( $_SERVER['PHP_SELF'].'?'.$url_parameters );
} else {
$next_product_url = str_replace("index2","index",$sess->url( $url_parameters ));
}
}
if( !empty($previous_product) ) {
$url_parameters = 'page=shop.product_details&product_id='.$previous_ product['product_id'].'&flypage='.$ps_product->get_flypage($previous_product['product_id']).'&pop='.$pop;
if( $manufacturer_id ) {
$url_parameters .= "&amp;manufacturer_id=" . $manufacturer_id;
}
if( $keyword != '') {
$url_parameters .= "&amp;keyword=".urlencode($keyword);
}
if( $pop == 1 ) {
$previous_product_url = $sess->url( $_SERVER['PHP_SELF'].'?'.$url_parameters );
} else {
$previous_product_url = str_replace("index2","index",$sess->url( $url_parameters ));
}
}
$tpl->set( 'next_product', $next_product );
$tpl->set( 'next_product_url', $next_product_url );
$tpl->set( 'previous_product', $previous_product );
$tpl->set( 'previous_product_url', $previous_product_url );
$parent_id_link = $db_product->f("product_parent_id");
$return_link = "";
if ($parent_id_link <> 0 ) {
$q = "SELECT product_name FROM #__{vm}_product WHERE product_id = '$product_parent_id' LIMIT 0,1";
$db->query( $q );
$db->next_record();
$product_parent_name = $db->f("product_name");
$return_link = "&nbsp;<a class=\"pathway\" href=\"";
$return_link .= $sess->url($_SERVER['PHP_SELF'] . "?page=shop.product_details&product_id=$parent_id_ link");
$return_link .= "\">";
$return_link .= $product_parent_name;
$return_link .= "</a>";
$return_link .= " ".vmCommonHTML::pathway_separator()." ";
}
$tpl->set( 'return_link', $return_link );
// Create the pathway for our template
$navigation_pathway = $tpl->fetch( 'common/pathway.tpl.php');
if ($ps_product_category->has_childs($category_id) ) {
$category_childs = $ps_product_category->get_child_list($category_id);
$tpl->set( 'categories', $category_childs );
$navigation_childlist = $tpl->fetch( 'common/categoryChildlist.tpl.php');
}
// Set Dynamic Page Title
if( function_exists('mb_substr')) {
$page_title = mb_substr($product_name, 0, 64, vmGetCharset() );
} else {
$page_title = substr($product_name, 0, 64 );
}
$vm_mainframe->setPageTitle( html_entity_decode( $page_title, ENT_QUOTES, vmGetCharset() ));
// Prepend Product Short Description Meta Tag "description"
if( vmIsJoomla('1.5')) {
$document = JFactory::getDocument();
$document->setDescription(strip_tags( $db_product->f("product_s_desc")));
} else {
$mainframe->prependMetaTag( "description", strip_tags( $db_product->f("product_s_desc")) );
}
// Show an "Edit PRODUCT"-Link
if ($perm->check("admin,storeadmin")) {
$edit_link = '<a href="'. $sess->url( 'index2.php?page=product.product_form&next_page=sh op.product_details&product_id='.$product_id).'" target=\"_blank\">
<img src="images/M_images/edit.png" alt="'. $VM_LANG->_('PHPSHOP_PRODUCT_FORM_EDIT_PRODUCT') .'" border="0" /></a>';
}
else {
$edit_link = "";
}
// LINK TO MANUFACTURER POP-UP
$manufacturer_id = $ps_product->get_manufacturer_id($product_id);
$manufacturer_name = $ps_product->get_mf_name($product_id);
$manufacturer_link = "";
if( $manufacturer_id && !empty($manufacturer_name) ) {
$link = "$mosConfig_live_site/index2.php?page=shop.manufacturer_page&amp;manufac turer_id=$manufacturer_id&amp;output=lite&amp;opti on=com_virtuemart&amp;Itemid=".$Itemid;
$text = '( '.$manufacturer_name.' )';
$manufacturer_link .= vmPopupLink( $link, $text );
// Avoid JavaScript on PDF Output
if( @$_REQUEST['output'] == "pdf" )
$manufacturer_link = "<a href=\"$link\" target=\"_blank\" title=\"$text\">$text</a>";
}
// PRODUCT PRICE
if (_SHOW_PRICES == '1') {
if( $db_product->f("product_unit") && VM_PRICE_SHOW_PACKAGING_PRICELABEL) {
$product_price_lbl = "<strong>". $VM_LANG->_('PHPSHOP_CART_PRICE_PER_UNIT').' ('.$db_product->f("product_unit")."):</strong>";
}
else {
$product_price_lbl = "<strong>". $VM_LANG->_('PHPSHOP_CART_PRICE'). ": </strong>";
}
$product_price = $ps_product->show_price( $product_id );
}
else {
$product_price_lbl = "";
$product_price = "";
}
// @var array $product_price_raw The raw unformatted Product Price in Float Format
$product_price_raw = $ps_product->get_adjusted_attribute_price($product_id);
// Change Packaging - Begin
// PRODUCT PACKAGING
if ( $db_product->f("product_packaging") ) {
$packaging = $db_product->f("product_packaging") & 0xFFFF;
$box = ($db_product->f("product_packaging") >> 16) & 0xFFFF;
$product_packaging = "";
if ( $packaging ) {
$product_packaging .= $VM_LANG->_('PHPSHOP_PRODUCT_PACKAGING1').$packaging;
if( $box ) $product_packaging .= "<br/>";
}
if ( $box ) {
$product_packaging .= $VM_LANG->_('PHPSHOP_PRODUCT_PACKAGING2').$box;
}
$product_packaging = str_replace("{unit}",$db_product->f("product_unit")?$db_product->f("product_unit") : $VM_LANG->_('PHPSHOP_PRODUCT_FORM_UNIT_DEFAULT'),$product_p ackaging);
}
else {
$product_packaging = "";
}
// Change Packaging - End
// PRODUCT IMAGE
$product_full_image = $product_parent_id!=0 && !$db_product->f("product_full_image") ?
$dbp->f("product_full_image") : $db_product->f("product_full_image"); // Change
$product_thumb_image = $product_parent_id!=0 && !$db_product->f("product_thumb_image") ?
$dbp->f("product_thumb_image") : $db_product->f("product_thumb_image"); // Change
/* MORE IMAGES ??? */
$files = ps_product_files::getFilesForProduct( $product_id );
$more_images = "";
if( !empty($files['images']) ) {
$more_images = $tpl->vmMoreImagesLink( $files['images'] );
}
// Does the Product have files?
$file_list = ps_product_files::get_file_list( $files['product_id'] );
$product_availability = '';
if( @$_REQUEST['output'] != "pdf" ) {
// Show the PDF, Email and Print buttons
// 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&amp;flypage='.@$_REQUEST['flypage ']."&amp;product_id=$product_id&amp;category_id=$cat egory_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&amp;vendor_id=$vend_ id&amp;output=lite&amp;option=com_virtuemart&amp;I temid=".$Itemid;
$text = $VM_LANG->_('PHPSHOP_VENDOR_FORM_INFO_LBL');
$vendor_link = vmPopupLink( $link, $text );
// Avoid JavaScript on PDF Output
if( @$_REQUEST['output'] == "pdf" )
$vendor_link = "<a href=\"$link\" target=\"_blank\" title=\"$text\">$text</a>";
if ($product_parent_id!=0 && !$ps_product_type->product_in_product_type($product_id)) {
$product_type = $ps_product_type->list_product_type($product_parent_id);
}
else {
$product_type = $ps_product_type->list_product_type($product_id);
}
/**
* This has changed since VM 1.1.0
* Now we have a template object that can use all variables
* that we assign here.
*
* Example: If you run
* $tpl->set( "product_name", $product_name );
* The variable "product_name" will be available in the template under this name
* with the value of $product_name
*
* */
// This part allows us to copy ALL properties from the product table
// into the template
$productData = $db_product->get_row();
$productArray = get_object_vars( $productData );
$productArray["product_id"] = $product_id;
$productArray["product_full_image"] = $product_full_image; // to display the full image on flypage
$productArray["product_thumb_image"] = $product_thumb_image;
$productArray["product_name"] = shopMakeHtmlSafe($productArray["product_name"]);
$tpl->set( 'productArray', $productArray );
foreach( $productArray as $property => $value ) {
$tpl->set( $property, $value);
}
// Assemble the thumbnail image as a link to the full image
// This function is defined in the theme (theme.php)
$product_image = $tpl->vmBuildFullImageLink( $productArray );
$tpl->set( "product_id", $product_id );
$tpl->set( "product_name", $product_name );
$tpl->set( "product_image", $product_image );
$tpl->set( "more_images", $more_images );
$tpl->set( "images", $files['images'] );
$tpl->set( "files", $files['files'] );
$tpl->set( "file_list", $file_list );
$tpl->set( "edit_link", $edit_link );
$tpl->set( "manufacturer_link", $manufacturer_link );
$tpl->set( "product_price", $product_price );
$tpl->set( "product_price_lbl", $product_price_lbl );
$tpl->set( 'product_price_raw', $product_price_raw );
$tpl->set( "product_description", $product_description );
/* ADD-TO-CART */
$tpl->set( 'manufacturer_id', $manufacturer_id );
$tpl->set( 'flypage', $flypage );
$tpl->set( 'ps_product_attribute', $ps_product_attribute );
$addtocart = $tpl->fetch('product_details/includes/addtocart_form.tpl.php' );
$tpl->set( "addtocart", $addtocart );
// Those come from separate template files
$tpl->set( "navigation_pathway", $navigation_pathway );
$tpl->set( "navigation_childlist", $navigation_childlist );
$tpl->set( "product_reviews", $product_reviews );
$tpl->set( "product_reviewform", $product_reviewform );
$tpl->set( "product_availability", $product_availability );
$tpl->set( "product_availability_data", $product_availability_data );
$tpl->set( "related_products", $related_products );
$tpl->set( "vendor_link", $vendor_link );
$tpl->set( "product_type", $product_type ); // Changed Product Type
$tpl->set( "product_packaging", $product_packaging ); // Changed Packaging
$tpl->set( "ask_seller_href", $ask_seller_href ); // Product Enquiry!
$tpl->set( "ask_seller_text", $ask_seller_text ); // Product Enquiry!
$tpl->set( "ask_seller", $ask_seller ); // Product Enquiry!
$tpl->set( "recent_products", $recent_products); // Recent products
/* Finish and Print out the Page */
echo $tpl->fetch( '/product_details/'.$flypage . '.php' );
?>
یا علی
سلام
آیا مطمئنید که فایل php رو درست تشخیص دادید و تغییرات باید در این فایل صورت بگیره؟
اگر بله، به احتمال زیاد این کار نیاز به بررسی بیشتر و اعمال تغییرات مشابه در چندین فایل داره.
یا علی
با سلام مجدد كسي ميتونه به من كمك كنه . ببينيد اين صفحه نيست. ممنون
<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
* This is the Main Product Listing File!
*
* @version $Id: shop.browse.php 1847 2009-07-11 13:15:14Z tkahl $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2009 soeren - All rights reserved.
* @license <b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b> GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* <b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b>
*/
mm_showMyFileName( __FILE__ );
// load important class files
require_once (CLASSPATH."ps_product.php");
$ps_product = new ps_product;
require_once (CLASSPATH."ps_product_category.php");
$ps_product_category = new ps_product_category;
require_once (CLASSPATH."ps_product_files.php");
require_once (CLASSPATH."ps_reviews.php");
require_once (CLASSPATH."imageTools.class.php");
require_once (CLASSPATH."PEAR/Table.php");
require_once(CLASSPATH . 'ps_product_attribute.php' );
$ps_product_attribute = new ps_product_attribute;
$Itemid = $sess->getShopItemid();
$keyword1 = $vmInputFilter->safeSQL( urldecode(vmGet( $_REQUEST, 'keyword1', null )));
$keyword2 = $vmInputFilter->safeSQL( urldecode(vmGet( $_REQUEST, 'keyword2', null )));
$search_op= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_op', null ));
$search_limiter= $vmInputFilter->safeSQL( vmGet( $_REQUEST, 'search_limiter', null ));
if (empty($category_id)) $category_id = $search_category;
$default['category_flypage'] = FLYPAGE;
$db_browse = new ps_DB;
$dbp = new ps_DB;
// NEW: Include the query section from an external file
// If settings are loaded, extended Classes are allowed and the user_class/shop_browse_queries.php exisits...
if (!defined('VM_ALLOW_EXTENDED_CLASSES') && file_exists(dirname(__FILE__).'/../virtuemart.cfg.php')) include_once(dirname(__FILE__).'/../virtuemart.cfg.php');
if (defined('VM_ALLOW_EXTENDED_CLASSES') && defined('VM_THEMEPATH') && VM_ALLOW_EXTENDED_CLASSES && file_exists(VM_THEMEPATH.'user_class/shop_browse_queries.php')) {
// Load the theme-user_class shop_browse_queries.php
require_once( VM_THEMEPATH.'user_class/shop_browse_queries.php' );
} else {
require_once( PAGEPATH. "shop_browse_queries.php" );
}
$db_browse->query( $count );
$num_rows = $db_browse->f("num_rows");
if( $limitstart > 0 && $limit >= $num_rows) {
$list = str_replace( 'LIMIT '.$limitstart, 'LIMIT 0', $list );
}
if( $category_id ) {
/**
* CATEGORY DESCRIPTION
*/
$db->query( "SELECT category_id, category_name FROM #__{vm}_category WHERE category_id='$category_id'");
$db->next_record();
$category_name = shopMakeHtmlSafe( $db->f('category_name') );
// Set Dynamic Page Title
$vm_mainframe->setPageTitle( $db->f("category_name") );
$desc = $ps_product_category->get_description($category_id);
$desc = vmCommonHTML::ParseContentByPlugins( $desc );
// Prepend Product Short Description Meta Tag "description" when applicable
$mainframe->prependMetaTag( "description", substr(strip_tags($desc ), 0, 255) );
}
// when nothing has been found we tell this here and say goodbye
if ($num_rows == 0 && (!empty($keyword)||!empty($keyword1))) {
echo $VM_LANG->_('PHPSHOP_NO_SEARCH_RESULT');
}
elseif( $num_rows == 0 && empty($product_type_id) && !empty($child_list)) {
echo $VM_LANG->_('EMPTY_CATEGORY');
}
elseif( $num_rows == 1 && ( !empty($keyword) || !empty($keyword1) ) ) {
// If just one product has been found, we directly show the details page of it
$db_browse->query( $list );
$db_browse->next_record();
$flypage = $db_browse->sf("category_flypage") ? $db_browse->sf("category_flypage") : FLYPAGE;
$url_parameters ="page=shop.product_details&amp;flypage=$flypage&a mp;product_id=" . $db_browse->f("product_id") . "&amp;category_id=" . $db_browse->f("category_id");
vmRedirect( $sess->url($url_parameters, true, false ) );
}
else {
// NOW START THE PRODUCT LIST
$tpl = vmTemplate::getInstance();
if( $category_id ) {
/**
* CATEGORY DESCRIPTION
*/
$browsepage_lbl = $category_name;
$tpl->set( 'browsepage_lbl', $browsepage_lbl );
$tpl->set( 'desc', $desc );
$category_childs = $ps_product_category->get_child_list($category_id);
$tpl->set( 'categories', $category_childs );
$navigation_childlist = $tpl->fetch( 'common/categoryChildlist.tpl.php');
$tpl->set( 'navigation_childlist', $navigation_childlist );
// Set up the CMS pathway
$category_list = array_reverse( $ps_product_category->get_navigation_list($category_id) );
$pathway = $ps_product_category->getPathway( $category_list );
$vm_mainframe->vmAppendPathway( $pathway );
$tpl->set( 'category_id', $category_id );
$tpl->set( 'category_name', $category_name );
$browsepage_header = $tpl->fetch( 'browse/includes/browse_header_category.tpl.php' );
}
elseif( $manufacturer_id) {
$db->query( "SELECT manufacturer_id, mf_name, mf_desc FROM #__{vm}_manufacturer WHERE manufacturer_id='$manufacturer_id'");
$db->next_record();
$mainframe->setPageTitle( $db->f("mf_name") );
$browsepage_lbl = shopMakeHtmlSafe( $db->f("mf_name") );
$tpl->set( 'browsepage_lbl', $browsepage_lbl );
$browsepage_lbltext = $db->f("mf_desc");
$tpl->set( 'browsepage_lbltext', $browsepage_lbltext );
$browsepage_header = $tpl->fetch( 'browse/includes/browse_header_manufacturer.tpl.php' );
}
elseif( $keyword ) {
$mainframe->setPageTitle( $VM_LANG->_('PHPSHOP_SEARCH_TITLE',false) );
$browsepage_lbl = $VM_LANG->_('PHPSHOP_SEARCH_TITLE') .': '.shopMakeHtmlSafe( $keyword );
$tpl->set( 'browsepage_lbl', $browsepage_lbl );
$browsepage_header = $tpl->fetch( 'browse/includes/browse_header_keyword.tpl.php' );
}
else {
$mainframe->setPageTitle( $VM_LANG->_('PHPSHOP_BROWSE_LBL',false) );#
$browsepage_lbl = $VM_LANG->_('PHPSHOP_BROWSE_LBL');
$tpl->set( 'browsepage_lbl', $browsepage_lbl );
$browsepage_header = $tpl->fetch( 'browse/includes/browse_header_all.tpl.php' );
}
$tpl->set( 'browsepage_header', $browsepage_header );
if (!empty($product_type_id) && @$_REQUEST['output'] != "pdf") {
$tpl->set( 'ps_product_type', $ps_product_type);
$tpl->set( 'product_type_id', $product_type_id);
$parameter_form = $tpl->fetch( 'browse/includes/browse_searchparameter_form.tpl.php' );
}
else {
$parameter_form = '';
}
$tpl->set( 'parameter_form', $parameter_form );
// Decide whether to show the limit box
$show_limitbox = ( $num_rows > 5 && @$_REQUEST['output'] != "pdf" );
$tpl->set( 'show_limitbox', $show_limitbox );
// Decide whether to show the top navigation
$show_top_navigation = ( PSHOP_SHOW_TOP_PAGENAV =='1' && $num_rows > $limit );
$tpl->set( 'show_top_navigation', $show_top_navigation );
// Prepare Page Navigation
require_once( CLASSPATH . 'pageNavigation.class.php' );
$pagenav = new vmPageNav( $num_rows, $limitstart, $limit );
$tpl->set( 'pagenav', $pagenav );
$search_string = '';
if ( $num_rows > 1 && @$_REQUEST['output'] != "pdf") {
if ( $num_rows > 5 ) { // simplified logic
$search_string = $mm_action_url."index.php?option=com_virtuemart&am p;Itemid=$Itemid&amp;category_id=$category_id&amp; page=$modulename.browse";
$search_string .= empty($manufacturer_id) ? '' : "&amp;manufacturer_id=$manufacturer_id";
$search_string .= empty($keyword) ? '' : '&amp;keyword='.urlencode( $keyword );
if (!empty($keyword1)) {
$search_string.="&amp;keyword1=".urlencode($keywor d1);
$search_string.="&amp;search_category=".urlencode( $search_category);
$search_string.="&amp;search_limiter=$search_limit er";
if (!empty($keyword2)) {
$search_string.="&amp;keyword2=".urlencode($keywor d2);
$search_string.="&amp;search_op=".urlencode($searc h_op);
}
}
if (!empty($product_type_id)){
foreach($_REQUEST as $key => $value){
if (substr($key, 0,13) == "product_type_"){
$val = vmGet($_REQUEST, $key );
if( is_array( $val )) {
foreach( $val as $var ) {
$search_string .="&".$key."[]=".urlencode($var);
}
} else {
$search_string .="&".$key."=".urlencode($val);
}
}
}
}
}
$tpl->set( 'VM_BROWSE_ORDERBY_FIELDS', $VM_BROWSE_ORDERBY_FIELDS);
if ($DescOrderBy == "DESC") {
$icon = "sort_desc.png";
$selected = Array( "selected=\"selected\"", "" );
$asc_desc = Array( "DESC", "ASC" );
}
else {
$icon = "sort_asc.png";
$selected = Array( "", "selected=\"selected\"" );
$asc_desc = Array( "ASC", "DESC" );
}
$tpl->set( 'orderby', $orderby );
$tpl->set( 'icon', $icon );
$tpl->set( 'selected', $selected );
$tpl->set( 'asc_desc', $asc_desc );
$tpl->set( 'category_id', $category_id );
$tpl->set( 'manufacturer_id', $manufacturer_id );
$tpl->set( 'keyword', urlencode( $keyword ) );
$tpl->set( 'keyword1', urlencode( $keyword1 ) );
$tpl->set( 'keyword2', urlencode( $keyword2 ) );
$tpl->set( 'Itemid', $Itemid );
if( $show_top_navigation ) {
$tpl->set( 'search_string', $search_string );
}
$orderby_form = $tpl->fetch( 'browse/includes/browse_orderbyform.tpl.php' );
$tpl->set( 'orderby_form', $orderby_form );
}
else {
$tpl->set( 'orderby_form', '' );
}
$db_browse->query( $list );
$db_browse->next_record();
$products_per_row = (!empty($category_id)) ? $db_browse->f("products_per_row") : PRODUCTS_PER_ROW;
if( $products_per_row < 1 ) {
$products_per_row = 1;
}
$buttons_header = '';
/**
* Start caching all product details for a later loop
*
**/
if(@$_REQUEST['output'] != "pdf") {
// Show the PDF, Email and Print buttons
$tpl->set('option', $option);
$tpl->set('category_id', $category_id );
$tpl->set('product_id', $product_id );
$buttons_header = $tpl->fetch( 'common/buttons.tpl.php' );
$templatefile = (!empty($category_id)) ? $db_browse->f("category_browsepage") : CATEGORY_TEMPLATE;
if( $templatefile == 'managed' ) {
// automatically select the browse template with the best match for the number of products per row
$templatefile = file_exists(VM_THEMEPATH.'templates/browse/browse_'.$products_per_row.'.php' )
? 'browse_'.$products_per_row
: 'browse_5';
} elseif( !file_exists(VM_THEMEPATH.'templates/browse/'.$templatefile.'.php')) {
$templatefile = 'browse_5';
}
}
else {
$templatefile = "browse_lite_pdf";
}
$tpl->set( 'buttons_header', $buttons_header );
$tpl->set('products_per_row', $products_per_row );
$tpl->set('templatefile', $templatefile );
$db_browse->reset();
$products = array();
$counter = 0;
/*** Start printing out all products (in that category) ***/
while ($db_browse->next_record()) {
// If it is item get parent:
$product_parent_id = $db_browse->f("product_parent_id");
if ($product_parent_id != 0) {
$dbp->query("SELECT product_full_image,product_thumb_image,product_nam e,product_s_desc FROM #__{vm}_product WHERE product_id='$product_parent_id'" );
$dbp->next_record();
}
// Set the flypage for this product based on the category.
// If no flypage is set then use the default as set in virtuemart.cfg.php
$flypage = $db_browse->sf("category_flypage");
if (empty($flypage)) {
$flypage = FLYPAGE;
}
$url_parameters = "page=shop.product_details&amp;flypage=$flypage&am p;product_id=" . $db_browse->f("product_id") . "&amp;category_id=" . $db_browse->f("category_id");
if( $manufacturer_id ) {
$url_parameters .= "&amp;manufacturer_id=" . $manufacturer_id;
}
if( $keyword != '') {
$url_parameters .= "&amp;keyword=".urlencode($keyword);
}
$url = $sess->url( $mm_action_url.'?'.$url_parameters );
// Price: xx.xx EUR
if (_SHOW_PRICES == '1' && $auth['show_prices']) {
$product_price = $ps_product->show_price( $db_browse->f("product_id") );
}
else {
$product_price = "";
}
// @var array $product_price_raw The raw unformatted Product Price in Float Format
$product_price_raw = $ps_product->get_adjusted_attribute_price($db_browse->f('product_id'));
// i is the index for the array holding all products, we need to show. to allow sorting by discounted price,
// we need to use the price as first part of the index name!
$i = $product_price_raw['product_price'] . '_' . ++$counter;
if( $db_browse->f("product_thumb_image") ) {
$product_thumb_image = $db_browse->f("product_thumb_image");
}
else {
if( $product_parent_id != 0 ) {
$product_thumb_image = $dbp->f("product_thumb_image"); // Use product_thumb_image from Parent Product
}
else {
$product_thumb_image = 0;
}
}
if( $product_thumb_image ) {
if( substr( $product_thumb_image, 0, 4) != "<b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b> ) {
if(PSHOP_IMG_RESIZE_ENABLE == '1') {
$product_thumb_image = $mosConfig_live_site."/components/com_virtuemart/show_image_in_imgtag.php?filename=".urlencode($pro duct_thumb_image)."&amp;newxsize=".PSHOP_IMG_WIDTH ."&amp;newysize=".PSHOP_IMG_HEIGHT."&amp;fileout=" ;
}
elseif( !file_exists( IMAGEPATH."product/".$product_thumb_image )) {
$product_thumb_image = VM_THEMEURL.'images/'.NO_IMAGE;
}
}
}
else {
$product_thumb_image = VM_THEMEURL.'images/'.NO_IMAGE;
}
// Get the full image path, or URL if set, or the no_image
if( $db_browse->f("product_full_image") ) {
$product_full_image = $db_browse->f("product_full_image");
} elseif( $product_parent_id != 0 ) {
$product_full_image = $dbp->f("product_full_image"); // Use product_full_image from Parent Product
}
else {
$product_full_image = VM_THEMEURL . 'images/' . NO_IMAGE;
// Get the size information for the no_image
if( file_exists( VM_THEMEPATH . 'images/' . NO_IMAGE ) ) {
$full_image_info = getimagesize( VM_THEMEPATH . 'images/' . NO_IMAGE );
$full_image_width = $full_image_info[0]+40;
$full_image_height = $full_image_info[1]+40;
}
}
// Get image size information and add the full URL
if( substr( $product_full_image, 0, 4) != '<b><font color=red>فقط کاربران عضو انجمن می توانند لینک ها را مشاهده کنند</font></b>; ) {
// This is a local image
if( file_exists( IMAGEPATH . 'product/' . $product_full_image ) ) {
$full_image_info = getimagesize( IMAGEPATH . 'product/' . $product_full_image );
$full_image_width = $full_image_info[0]+40;
$full_image_height = $full_image_info[1]+40;
}
$product_full_image = IMAGEURL . 'product/' . $product_full_image;
} elseif( !isset( $full_image_width ) || !isset( $full_image_height ) ) {
// This is a URL image
$full_image_info = @getimagesize( $product_full_image );
$full_image_width = $full_image_info[0]+40;
$full_image_height = $full_image_info[1]+40;
}
$files = ps_product_files::getFilesForProduct( $db_browse->f('product_id') );
$products[$i]['files'] = $files['files'];
$products[$i]['images'] = $files['images'];
$product_name = $db_browse->f("product_name");
if( $db_browse->f("product_publish") == "N" ) {
$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 != ""
&& $tpl->get_cfg( 'showAddtocartButtonOnProductList' )
&& !stristr( $product_price, $VM_LANG->_('PHPSHOP_PRODUCT_CALL') )
&& !ps_product::product_has_attributes( $db_browse->f('product_id'), true )) {
$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;
}
$products[$i]['product_flypage'] = $url;
$products[$i]['product_thumb_image'] = $product_thumb_image;
$products[$i]['product_full_image'] = $product_full_image;
$products[$i]['full_image_width'] = $full_image_width;
$products[$i]['full_image_height'] = $full_image_height;
// Unset these for the next product
unset($full_image_width);
unset($full_image_height);
$products[$i]['product_name'] = shopMakeHtmlSafe( $product_name );
$products[$i]['product_s_desc'] = $product_s_desc;
$products[$i]['product_details'] = $product_details;
$products[$i]['product_rating'] = $product_rating;
$products[$i]['product_price'] = $product_price;
$products[$i]['product_price_raw'] = $product_price_raw;
$products[$i]['product_sku'] = $db_browse->f("product_sku");
$products[$i]['product_weight'] = $db_browse->f("product_weight");
$products[$i]['product_weight_uom'] = $db_browse->f("product_weight_uom");
$products[$i]['product_length'] = $db_browse->f("product_length");
$products[$i]['product_width'] = $db_browse->f("product_width");
$products[$i]['product_height'] = $db_browse->f("product_height");
$products[$i]['product_lwh_uom'] = $db_browse->f("product_lwh_uom");
$products[$i]['product_in_stock'] = $db_browse->f("product_in_stock");
$products[$i]['product_available_date'] = $VM_LANG->convert( vmFormatDate($db_browse->f("product_available_date"), $VM_LANG->_('DATE_FORMAT_LC') ));
$products[$i]['product_availability'] = $db_browse->f("product_availability");
$products[$i]['cdate'] = $VM_LANG->convert( vmFormatDate($db_browse->f("cdate"), $VM_LANG->_('DATE_FORMAT_LC') ));
$products[$i]['mdate'] = $VM_LANG->convert( vmFormatDate($db_browse->f("mdate"), $VM_LANG->_('DATE_FORMAT_LC') ));
$products[$i]['product_url'] = $db_browse->f("product_url");
} // END OF while loop
// Need to re-order here, because the browse query doesn't fetch discounts
if( $orderby == 'product_price' ) {
if ($DescOrderBy == "DESC") {
// using krsort when the Array must be sorted reverse (Descending Order)
krsort($products, SORT_NUMERIC);
} else {
// using ksort when the Array must be sorted in ascending order
ksort($products, SORT_NUMERIC);
}
}
$tpl->set( 'products', $products );
$tpl->set( 'search_string', $search_string );
if ( $num_rows > 1 ) {
$browsepage_footer = $tpl->fetch( 'browse/includes/browse_pagenav.tpl.php' );
$tpl->set( 'browsepage_footer', $browsepage_footer );
} else {
$tpl->set( 'browsepage_footer', '' );
}
$recent_products = $ps_product->recentProducts(null,$tpl->get_cfg('showRecent', 5));
$tpl->set('recent_products',$recent_products);
$tpl->set('ps_product',$ps_product);
echo $tpl->fetch( $tpl->config->get( 'productListStyle' ) );
}
?>
** تگ کد اضافه شد
سلام
خیر این صفحه نیست چون هیچ تگ <a> ای در کد وجود نداره.
یا علی
با سلام مجدد اين لينك توي سورس هست
<a href="/index.php?page=shop.product_details&amp;flypage=ga rden_flypage.tpl&amp;product_id=56&amp;category_id =1&amp;option=com_virtuemart&amp;Itemid=59">[جزئيات ...]</a>
حالا نميدونم كدام يكي از صفحات است . ممنون
سلام
دوست خوبم با این کد html نمیشه پی برد کد php در کدوم صفحه هست چون این کدی است که تفسیر شده است.
شما تمام صفحاتی که شک دارید کد php مربوطه درشون باش برای یافتن تگ <a> جستجو کنید. سپس دقیقا محتویات تگ رو بررسی کنید که آیا به صفحه ی جزئیات محصول لینک شده یا خیر.
یا علی
ehsa2009
01-30-2010, 06:59 AM
من مشکلمو نتونستم حل کنم . هر جوری که میشه خواهشا کمک کنید
vBulletin® v4.2.5, Copyright ©2000-2026, Jelsoft Enterprises Ltd.