Новости Joomla

0 Пользователей и 1 Гость просматривают эту тему.
  • 24 Ответов
  • 3798 Просмотров
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
Проблема такая:
virtuemart 2. Есть товары в подкатегории.
Делаю модуль произвольного HTML, его в позицию right.
Нужно чтобы модуль отображался только у товаров, но не в категории.
как это сделать? создаль меню VirtueMart вручную. но не делать же отдельный пункт меню для каждого товара в отдельности.
*

vtx

  • Захожу иногда
  • 221
  • 19 / 0
грузите модуль через карточку.
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
грузите модуль через карточку.
это как?
*

vtx

  • Захожу иногда
  • 221
  • 19 / 0
loadposition plug-in
*

flyingspook

  • Moderator
  • 3590
  • 247 / 9
В шаблоне оберни в условие модуль

<?php
$option = JRequest::getCmd('option');
$page = JRequest::getCmd('page');
if (($option == 'com_virtuemart') and ($page == 'shop.product_details')) : ?> 

Свой модуль

<?php endif; ?>
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
В шаблоне оберни в условие модуль

<?php
$option = JRequest::getCmd('option');
$page = JRequest::getCmd('page');
if (($option == 'com_virtuemart') and ($page == 'shop.product_details')) : ?> 

Свой модуль

<?php endif; ?>

Че то не получается. Ничего не выводит.
вот что вставил в шаблон default.php
<?php
$option = JRequest::getCmd('option');
$page = JRequest::getCmd('page');
if (($option == 'com_virtuemart') and ($page == 'shop.product_details')) : ?>
{loadposition razmer}
<?php endif; ?>

пробовал отдельно в описание товара вставить {loadposition razmer}
выводит эту надпись только.
Хотя вставлял в материал - все ок там.
*

Efanych

  • Глобальный модератор
  • 4684
  • 644 / 0
  • Меняю свою жизнь на 360°!
Это плагин контента. Он в вирте работать не будет. Вставляйте в шаблон, только вместо {loadposition razmer} пишите <jdoc:include type="modules" name="razmer" style="xhtml" />
Создание сайтов, шаблонов, помощь в решении проблем.
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
Это плагин контента. Он в вирте работать не будет. Вставляйте в шаблон, только вместо {loadposition razmer} пишите <jdoc:include type="modules" name="razmer" style="xhtml" />

вставил. вот так

<?php
$option = JRequest::getCmd('option');
$page = JRequest::getCmd('page');
if (($option == 'com_virtuemart') and ($page == 'shop.product_details')) : ?>
<jdoc:include type="modules" name="razmer" style="xhtml" />
<?php endif; ?>

тоже самое (ничего)
*

flyingspook

  • Moderator
  • 3590
  • 247 / 9
ну слюней много)))

модуль то в позиции razmer назначен? включен?
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
ну слюней много)))

модуль то в позиции razmer назначен? включен?
да назначен и включен. в статье то показывается.
включен показ во всех меню и прочим.
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
Код
<?php

// Check to ensure this file is included in Joomla!
defined ( '_JEXEC' ) or die ( 'Restricted access' );

// addon for Joomla modal Box
JHTML::_ ( 'behavior.modal' );
JHTML::_('behavior.tooltip');
$url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&task=askquestion&virtuemart_product_id='.$this->product->virtuemart_product_id.'&virtuemart_category_id='.$this->product->virtuemart_category_id.'&tmpl=component');
$document = &JFactory::getDocument();
$document->addScriptDeclaration("
jQuery(document).ready(function($) {
$('a.ask-a-question').click( function(){
$.facebox({
iframe: '".$url."',
rev: 'iframe|550|550'
});
return false ;
});
});
");
/* Let's see if we found the product */
if (empty ( $this->product )) {
echo JText::_ ( 'COM_VIRTUEMART_PRODUCT_NOT_FOUND' );
echo '<br /><br />  ' . $this->continue_link_html;
return;
}
?>

<div class="productdetails-view">

<?php // Product Navigation
if (VmConfig::get ( 'product_navigation', 1 )) { ?>
<div class="product-neighbours">
<?php
if (! empty ( $this->product->neighbours ['previous'] )) {
$prev_link = JRoute::_ ( 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['previous'] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id );
echo JHTML::_ ( 'link', $prev_link, $this->product->neighbours ['previous'] ['product_name'], array ('class' => 'previous-page' ) );
}
if (! empty ( $this->product->neighbours ['next'] )) {
$next_link = JRoute::_ ( 'index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['next'] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id );
echo JHTML::_ ( 'link', $next_link, $this->product->neighbours ['next'] ['product_name'], array ('class' => 'next-page' ) );
}
?>
<div class="clear"></div>
</div>
<?php } // Product Navigation END ?>

<?php // Product Title ?>
<h1><?php echo $this->product->product_name ?></h1>
<?php // Product Title END ?>

<?php // Product Edit Link
echo $this->edit_link;
// Product Edit Link END ?>

<?php // PDF - Print - Email Icon
if ( VmConfig::get('show_emailfriend', 1) == '1' || VmConfig::get('show_printicon', 1) == '1') { ?>
<div class="icons">
<?php $link = (VmConfig::isJ15())? 'index2.php' : 'index.php';
$link .= '?tmpl=component&option=com_virtuemart&view=productdetails&virtuemart_product_id='.$this->product->virtuemart_product_id;
$pdflink= JRoute::_ ('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$this->product->virtuemart_product_id.'&format=pdf');
// echo shopFunctionsF::PdfIcon($pdflink );
echo shopFunctionsF::PrintIcon($link.'&print=1');
echo shopFunctionsF::EmailIcon($this->product->virtuemart_product_id); ?>
<div class="clear"></div>
</div>
<?php } // PDF - Print - Email Icon END ?>

<?php // Product Short Description
if (!empty($this->product->product_s_desc)) { ?>
<div class="product-short-description">
<?php /** @todo Test if content plugins modify the product description */
echo $this->product->product_s_desc; ?>
</div>
<?php } // Product Short Description END ?>

<div>
<div class="width50 floatleft">

<?php // Product Main Image
if (!empty($this->product->images[0])) { ?>
<div class="main-image">
<?php echo $this->product->images[0]->displayMediaFull('class="product-image"',false,"class='modal'",true); ?>
</div>
<?php } // Product Main Image END ?>

<?php // Showing The Additional Images
if(!empty($this->product->images) && count($this->product->images)>1) { ?>
<div class="additional-images">
<?php // List all Images
foreach ($this->product->images as $image) {
echo $image->displayMediaThumb('class="product-image"',true,'class="modal"',true,true); //'class="modal"'
} ?>
</div>
<?php } // Showing The Additional Images END ?>

</div>


<div class="width50 floatright">
<div class="spacer-buy-area">

<?php // TO DO in Multi-Vendor not needed at the moment and just would lead to confusion
/* $link = JRoute::_('index2.php?option=com_virtuemart&view=virtuemart&task=vendorinfo&virtuemart_vendor_id='.$this->product->virtuemart_vendor_id);
$text = JText::_('COM_VIRTUEMART_VENDOR_FORM_INFO_LBL');
echo '<span class="bold">'. JText::_('COM_VIRTUEMART_PRODUCT_DETAILS_VENDOR_LBL'). '</span>'; ?><a class="modal" href="<?php echo $link ?>"><?php echo $text ?></a><br />
*/ ?>

<?php
if($this->showRating){
    $maxrating = VmConfig::get('vm_maximum_rating_scale',5);
$rating = empty($this->rating)? JText::_('COM_VIRTUEMART_RATING').' '.JText::_('COM_VIRTUEMART_UNRATED'):JText::_('COM_VIRTUEMART_RATING'). round($this->rating->rating, 2). '/'. $maxrating;
echo   $rating;
}

// Product Price
if ($this->show_prices) { ?>
<div class="product-price" id="productPrice<?php echo $this->product->virtuemart_product_id ?>">
<?php
if ($this->product->product_unit && VmConfig::get ( 'price_show_packaging_pricelabel' )) {
echo "<strong>" . JText::_ ( 'COM_VIRTUEMART_CART_PRICE_PER_UNIT' ). ' (' . $this->product->product_unit . "):</strong>";
} else {
echo "<strong>" . JText::_ ( 'COM_VIRTUEMART_CART_PRICE' ). "</strong>";
}

if ($this->showBasePrice) {
echo $this->currency->createPriceDiv ( 'basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $this->product->prices );
echo $this->currency->createPriceDiv ( 'basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $this->product->prices );
}

echo $this->currency->createPriceDiv ( 'variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $this->product->prices );
echo $this->currency->createPriceDiv ( 'basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $this->product->prices );
echo $this->currency->createPriceDiv ( 'discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_DISCOUNTED_PRICE', $this->product->prices );
echo $this->currency->createPriceDiv ( 'salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $this->product->prices );
echo $this->currency->createPriceDiv ( 'salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $this->product->prices );
echo $this->currency->createPriceDiv ( 'priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $this->product->prices );
echo $this->currency->createPriceDiv ( 'discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $this->product->prices );
echo $this->currency->createPriceDiv ( 'taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $this->product->prices ); ?>
</div>
<?php } ?>

<?php // Add To Cart Button
if (!VmConfig::get('use_as_catalog',0)) { ?>
<div class="addtocart-area">

<form method="post" class="product js-recalculate" action="index.php" >
<?php // Product custom_fields
if (!empty($this->product->customfieldsCart)) {  ?>
<div class="product-fields">
<?php foreach ($this->product->customfieldsCart as $field)
{ ?><div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field_type ?>">
<span class="product-fields-title" ><b><?php echo  JText::_($field->custom_title)?></b></span>
<?php if ($field->custom_tip) echo JHTML::tooltip($field->custom_tip,  JText::_($field->custom_title), 'tooltip.png'); ?>
<span class="product-field-display"><?php echo $field->display ?></span>

<span class="product-field-desc"><?php echo $field->custom_field_desc ?></span>
</div><br />
<?php
}
?>
</div>
<?php }
/* Product custom Childs
  * to display a simple link use $field->virtuemart_product_id as link to child product_id
  * custom_value is relation value to child
  */

if (!empty($this->product->customsChilds)) {  ?>
<div class="product-fields">
<?php foreach ($this->product->customsChilds as $field) {  ?>
<div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field->field_type ?>">
<span class="product-fields-title" ><b><?php echo JText::_($field->field->custom_title)?></b></span>
<span class="product-field-desc"><?php echo JText::_($field->field->custom_value)?></span>
<span class="product-field-display"><?php echo $field->display ?></span>

</div><br />
<?php
} ?>
</div>
<?php } ?>

<div class="addtocart-bar">

<?php // Display the quantity box ?>
<!-- <label for="quantity<?php echo $this->product->virtuemart_product_id;?>" class="quantity_box"><?php echo JText::_('COM_VIRTUEMART_CART_QUANTITY'); ?>: </label> -->
<span class="quantity-box">
<input type="text" class="quantity-input" name="quantity[]" value="<?php if(isset($this->product->min_order_level) && (int) $this->product->min_order_level > 0){echo $this->product->min_order_level;} else{ echo '1'; } ?>" />
</span>
<span class="quantity-controls">
<input type="button" class="quantity-controls quantity-plus" />
<input type="button" class="quantity-controls quantity-minus" />
</span>
<?php // Display the quantity box END ?>

<?php // Add the button
$button_lbl = JText::_('COM_VIRTUEMART_CART_ADD_TO');
$button_cls = 'addtocart-button'; //$button_cls = 'addtocart_button';
$button_name = 'addtocart'; //$button_cls = 'addtocart_button';


// Display the add to cart button
$stockhandle = VmConfig::get('stockhandle','none');
if(($stockhandle=='disableit' or $stockhandle=='disableadd') and ($this->product->product_in_stock - $this->product->product_ordered)<1){
$button_lbl = JText::_('COM_VIRTUEMART_CART_NOTIFY');
$button_cls = 'notify-button';
$button_name = 'notifycustomer';
}
vmdebug('$stockhandle '.$stockhandle.' and stock '.$this->product->product_in_stock.' ordered '.$this->product->product_ordered);
?>
<span class="addtocart-button">
<input type="submit" name="<?php echo $button_name ?>"  class="<?php echo $button_cls ?>" value="<?php echo $button_lbl ?>" title="<?php echo $button_lbl ?>" />
</span>

<div class="clear"></div>
</div>

<?php // Display the add to cart button END ?>
<input type="hidden" class="pname" value="<?php echo $this->product->product_name ?>" />
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="view" value="cart" />
<noscript><input type="hidden" name="task" value="add" /></noscript>
<input type="hidden" name="virtuemart_product_id[]" value="<?php echo $this->product->virtuemart_product_id ?>" />
<?php /** @todo Handle the manufacturer view */ ?>
<input type="hidden" name="virtuemart_manufacturer_id" value="<?php echo $this->product->virtuemart_manufacturer_id ?>" />
<input type="hidden" name="virtuemart_category_id[]" value="<?php echo $this->product->virtuemart_category_id ?>" />
</form>

<div class="clear"></div>
</div>
<?php }  // Add To Cart Button END ?>

<?php // Availability Image
/* TO DO add width and height to the image */
if (!empty($this->product->product_availability)) {
$stockhandle = VmConfig::get('stockhandle','none');
if($stockhandle=='risetime' and ($this->product->product_in_stock - $this->product->product_ordered)<1){
?> <div class="availability">
<?php echo JHTML::image(JURI::root().VmConfig::get('assets_general_path').'images/availability/'.VmConfig::get('rised_availability','7d.gif'), VmConfig::get('rised_availability','7d.gif'), array('class' => 'availability')); ?>
</div>
<?php } else {
?>
<div class="availability">
<?php echo JHTML::image(JURI::root().VmConfig::get('assets_general_path').'images/availability/'.$this->product->product_availability, $this->product->product_availability, array('class' => 'availability')); ?>
</div>
<?php }
}

// Ask a question about this product ?>

<div class="ask-a-question">
<a class="ask-a-question" href="<?php echo $url ?>" ><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL')?></a>
<!--<a class="ask-a-question modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $url ?>"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL')?></a>-->
</div>

<?php // Manufacturer of the Product
if(VmConfig::get('show_manufacturers', 1) && !empty($this->product->virtuemart_manufacturer_id)) { ?>
<div class="manufacturer">
<?php
$link = JRoute::_('index.php?option=com_virtuemart&view=manufacturer&virtuemart_manufacturer_id='.$this->product->virtuemart_manufacturer_id.'&tmpl=component');
$text = $this->product->mf_name;

/* Avoid JavaScript on PDF Output */
if (strtolower(JRequest::getWord('output')) == "pdf"){
echo JHTML::_('link', $link, $text);
} else { ?>
<span class="bold"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DETAILS_MANUFACTURER_LBL')?></span><a class="modal" rel="{handler: 'iframe', size: {x: 700, y: 550}}" href="<?php echo $link ?>"><?php echo $text ?></a>
<?PHP } ?>
</div>
<?php } ?>

</div>
</div>
<div class="clear"></div>
</div>




<?php // Product Description
if (!empty($this->product->product_desc)) { ?>
<div class="product-description">
<?php /** @todo Test if content plugins modify the product description */ ?>
<span class="title"><?php echo JText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE')?></span>
<?php echo $this->product->product_desc; ?>
</div>
<?php } // Product Description END



if (!empty($this->product->customfields)) { ?>
   
   
<?php
$option = JRequest::getCmd('option');
$page = JRequest::getCmd('page');
if (($option == 'com_virtuemart') and ($page == 'shop.product_details')) : ?>
<jdoc:include type="modules" name="razmer" style="xhtml" />
<?php endif; ?>

<div class="product-fields">
<?php
$custom_title = null ;
foreach ($this->product->customfields as $field){
?><div class="product-field product-field-type-<?php echo $field->field_type ?>">
<?php if ($field->custom_title != $custom_title) { ?>
<span class="product-fields-title" ><?php echo JText::_($field->custom_title); ?></span>
<?php if ($field->custom_tip) echo JHTML::tooltip($field->custom_tip,  JText::_($field->custom_title), 'tooltip.png');
} ?>
<span class="product-field-display"><?php echo $field->display ?></span>
<span class="product-field-desc"><?php echo jText::_($field->custom_field_desc)?></span>
</div>
<?php
$custom_title = $field->custom_title;
} ?>
</div>
<?php
} // Product custom_fields END

// Product Packaging
$product_packaging = '';
if ($this->product->packaging || $this->product->box) { ?>
<div class="product-packaging">

<?php
if ($this->product->packaging) {
$product_packaging .= JText::_('COM_VIRTUEMART_PRODUCT_PACKAGING1').$this->product->packaging;
if ($this->product->box) $product_packaging .= '<br />';
}
if ($this->product->box) $product_packaging .= JText::_('COM_VIRTUEMART_PRODUCT_PACKAGING2').$this->product->box;
echo str_replace("{unit}",$this->product->product_unit ? $this->product->product_unit : JText::_('COM_VIRTUEMART_PRODUCT_FORM_UNIT_DEFAULT'), $product_packaging); ?>
</div>
<?php } // Product Packaging END ?>

<?php // Product Files
// foreach ($this->product->images as $fkey => $file) {
// Todo add downloadable files again
// if( $file->filesize > 0.5) $filesize_display = ' ('. number_format($file->filesize, 2,',','.')." MB)";
// else $filesize_display = ' ('. number_format($file->filesize*1024, 2,',','.')." KB)";

/* Show pdf in a new Window, other file types will be offered as download */
// $target = stristr($file->file_mimetype, "pdf")? "_blank" : "_self";
// $link = JRoute::_('index.php?view=productdetails&task=getfile&virtuemart_media_id='.$file->virtuemart_media_id.'&virtuemart_product_id='.$this->product->virtuemart_product_id);
// echo JHTMl::_('link', $link, $file->file_title.$filesize_display, array('target' => $target));
// }
if (!empty($this->product->customfieldsRelatedProducts)) { ?>
<div class="product-related-products">
<h4><?php echo JText::_('COM_VIRTUEMART_RELATED_PRODUCTS'); ?></h4>

<?php
foreach ($this->product->customfieldsRelatedProducts as $field){
?><div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field_type ?>">
<span class="product-field-display"><?php echo $field->display ?></span>
<span class="product-field-desc"><?php echo jText::_($field->custom_field_desc)?></span>
</div>
<?php
} ?>
</div>
<?php
} // Product customfieldsRelatedProducts END

if (!empty($this->product->customfieldsRelatedCategories)) { ?>
<div class="product-related-categories">
<h4><?php echo JText::_('COM_VIRTUEMART_RELATED_CATEGORIES'); ?></h4>
<?php foreach ($this->product->customfieldsRelatedCategories as $field){ ?>
<div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field_type ?>">
<span class="product-field-display"><?php echo $field->display ?></span>
<span class="product-field-desc"><?php echo jText::_($field->custom_field_desc)?></span>
</div>
<?php
} ?>
</div>
<?php
} // Product customfieldsRelatedCategories END

// Show child categories
if ( VmConfig::get('showCategory',1) ) {
if ($this->category->haschildren) {
$iCol = 1;
$iCategory = 1;
$categories_per_row = VmConfig::get ( 'categories_per_row', 3 );
$category_cellwidth = ' width'.floor ( 100 / $categories_per_row );
$verticalseparator = " vertical-separator"; ?>

<div class="category-view">

<?php // Start the Output
if(!empty($this->category->children)){
foreach ( $this->category->children as $category ) {

// Show the horizontal seperator
if ($iCol == 1 && $iCategory > $categories_per_row) { ?>
<div class="horizontal-separator"></div>
<?php }

// this is an indicator wether a row needs to be opened or not
if ($iCol == 1) { ?>
<div class="row">
<?php }

// Show the vertical seperator
if ($iCategory == $categories_per_row or $iCategory % $categories_per_row == 0) {
$show_vertical_separator = ' ';
} else {
$show_vertical_separator = $verticalseparator;
}

// Category Link
$caturl = JRoute::_ ( 'index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id );

// Show Category ?>
<div class="category floatleft<?php echo $category_cellwidth . $show_vertical_separator ?>">
<div class="spacer">
<h2>
<a href="<?php echo $caturl ?>" title="<?php echo $category->category_name ?>">
<?php echo $category->category_name ?>
<br />
<?php // if ($category->ids) {
echo $category->images[0]->displayMediaThumb("",false);
//} ?>
</a>
</h2>
</div>
</div>
<?php
$iCategory ++;

// Do we need to close the current row now?
if ($iCol == $categories_per_row) { ?>
<div class="clear"></div>
</div>
<?php
$iCol = 1;
} else {
$iCol ++;
}
}
}
// Do we need a final closing row tag?
if ($iCol != 1) { ?>
<div class="clear"></div>
</div>
<?php } ?>
</div>
<?php }
} ?>



<?php // Customer Reviews
if($this->allowRating || $this->showReview) {
$maxrating = VmConfig::get('vm_maximum_rating_scale',5);
$ratingsShow = VmConfig::get('vm_num_ratings_show',3); // TODO add  vm_num_ratings_show in vmConfig
//$starsPath = JURI::root().VmConfig::get('assets_general_path').'images/stars/';
$stars = array();
$showall = JRequest::getBool('showall', false);
for ($num=0 ; $num <= $maxrating; $num++  ) {
$title = (JText::_("COM_VIRTUEMART_RATING_TITLE"). $num . '/' . $maxrating) ;
$stars[] = '<span class="vmicon vm2-stars'.$num.'" title="'.$title.'"></span>';
} ?>

<div class="customer-reviews">
<form method="post" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$this->product->virtuemart_product_id.'&virtuemart_category_id='.$this->product->virtuemart_category_id) ; ?>" name="reviewForm" id="reviewform">
<?php
}

if($this->showReview) {

?>
<h4><?php echo JText::_('COM_VIRTUEMART_REVIEWS')?></h4>

<div class="list-reviews">
<?php
$i=0;
$review_editable=true;
$reviews_published=0;
if ($this->rating_reviews) {
foreach($this->rating_reviews as $review ) {
if ($i % 2 == 0) {
$color = 'normal';
} else {
$color = 'highlight';
}

/* Check if user already commented */
// if ($review->virtuemart_userid == $this->user->id ) {
if ($review->created_by == $this->user->id && !$review->review_editable) {
$review_editable = false;
}
?>

<?php // Loop through all reviews
if (!empty($this->rating_reviews) && $review->published) {
    $reviews_published++;
    ?>
<div class="<?php echo $color ?>">
<span class="date"><?php echo JHTML::date($review->created_on, JText::_('DATE_FORMAT_LC')); ?></span>
<span class="vote"><?php echo JText::_('COM_VIRTUEMART_RATING')." ".$review->review_rates; ?></span>
<blockquote><?php echo $review->comment; ?></blockquote>
<span class="bold"><?php echo $review->customer ?></span>
</div>
<?php
}
$i++ ;
if ( $i == $ratingsShow && !$showall) {
/* Show all reviews ? */
if ( $reviews_published >= $ratingsShow ) {
$attribute = array('class'=>'details', 'title'=>JText::_('COM_VIRTUEMART_MORE_REVIEWS'));
echo JHTML::link($this->more_reviews, JText::_('COM_VIRTUEMART_MORE_REVIEWS'),$attribute);
}
break;
}
}

} else {
// "There are no reviews for this product" ?>
<span class="step"><?php echo JText::_('COM_VIRTUEMART_NO_REVIEWS')?></span>
<?php
}  ?>
<div class="clear"></div>
</div>

<?php // Writing A Review
if($this->allowReview ) { ?>
<div class="write-reviews">

<?php // Show Review Length While Your Are Writing
$reviewJavascript = "
function check_reviewform() {
var form = document.getElementById('reviewform');

var ausgewaehlt = false;

for (var i=0; i<form.vote.length; i++) {
if (form.vote[i].checked) {
ausgewaehlt = true;
}
}
if (!ausgewaehlt)  {
alert('".JText::_('COM_VIRTUEMART_REVIEW_ERR_RATE',false)."');
return false;
}
else if (form.comment.value.length < ". VmConfig::get('reviews_minimum_comment_length', 100).") {
alert('". addslashes( JText::sprintf('COM_VIRTUEMART_REVIEW_ERR_COMMENT1_JS', VmConfig::get('reviews_minimum_comment_length', 100)) )."');
return false;
}
else if (form.comment.value.length > ". VmConfig::get('reviews_maximum_comment_length', 2000).") {
alert('". addslashes( JText::sprintf('COM_VIRTUEMART_REVIEW_ERR_COMMENT2_JS', VmConfig::get('reviews_maximum_comment_length', 2000)) )."');
return false;
}
else {
return true;
}
}

function refresh_counter() {
var form = document.getElementById('reviewform');
form.counter.value= form.comment.value.length;
}";

$document->addScriptDeclaration($reviewJavascript);

if($this->showRating) {
if($this->allowRating && $review_editable) { ?>
<h4><?php echo JText::_('COM_VIRTUEMART_WRITE_REVIEW')  ?><span><?php echo JText::_('COM_VIRTUEMART_WRITE_FIRST_REVIEW')?></span></h4>
<span class="step"><?php echo JText::_('COM_VIRTUEMART_RATING_FIRST_RATE')?></span>
<ul class="rating">

<?php // Print The Rating Stars + Checkboxes
for ($num=0 ; $num<=$maxrating;  $num++ ) { ?>
<li id="<?php echo $num ?>_stars">
<label for="vote<?php echo $num ?>"><?php echo $stars[ $num ]; ?></label>
<?php
if ($num == 5) {
$selected = ' checked="checked"';
} else {
$selected = '';
} ?>
<input<?php echo $selected ?> id="vote<?php echo $num ?>" type="radio" value="<?php echo $num ?>" name="vote">
</li>
<?php } ?>
</ul>

<?php

}
}
if($review_editable ) { ?>
<span class="step"><?php echo JText::sprintf('COM_VIRTUEMART_REVIEW_COMMENT', VmConfig::get('reviews_minimum_comment_length', 100), VmConfig::get('reviews_maximum_comment_length', 2000)); ?></span>
<br />
<textarea class="virtuemart" title="<?php echo JText::_('COM_VIRTUEMART_WRITE_REVIEW')?>" class="inputbox" id="comment" onblur="refresh_counter();" onfocus="refresh_counter();" onkeyup="refresh_counter();" name="comment" rows="5" cols="60"><?php if(!empty($this->review->comment))echo $this->review->comment; ?></textarea>
<br />
<span><?php echo JText::_('COM_VIRTUEMART_REVIEW_COUNT')?>
<input type="text" value="0" size="4" class="vm-default" name="counter" maxlength="4" readonly="readonly" />
</span>
<br /><br />
<input class="highlight-button" type="submit" onclick="return( check_reviewform());" name="submit_review" title="<?php echo JText::_('COM_VIRTUEMART_REVIEW_SUBMIT')  ?>" value="<?php echo JText::_('COM_VIRTUEMART_REVIEW_SUBMIT')  ?>" />
</div>
<?php
} else {
echo '<strong>'.JText::_('COM_VIRTUEMART_DEAR').$this->user->name.',</strong><br />' ;
echo JText::_('COM_VIRTUEMART_REVIEW_ALREADYDONE');
}
}
}

if($this->allowRating || $this->showReview) {
?>
<input type="hidden" name="virtuemart_product_id" value="<?php echo $this->product->virtuemart_product_id; ?>" />
<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="virtuemart_category_id" value="<?php echo JRequest::getInt('virtuemart_category_id'); ?>" />
<input type="hidden" name="virtuemart_rating_review_id" value="0" />
<input type="hidden" name="task" value="review" />
</form>
</div>
<?php
}


// else echo JText::_('COM_VIRTUEMART_REVIEW_LOGIN'); // Login to write a review!
?>
</div>

вот весь код файла.
кстате, он такой и должен быть?
в virte 1.x че то как то поменьше всего было, а здесь неделю разбираться.
или просто у меня такой большой?
*

Efanych

  • Глобальный модератор
  • 4684
  • 644 / 0
  • Меняю свою жизнь на 360°!
Какого файла? Вставляйте в index.php
Создание сайтов, шаблонов, помощь в решении проблем.
*

varX

  • Живу я здесь
  • 2450
  • 141 / 5
  • разработка компонентов
Это плагин контента. Он в вирте работать не будет. Вставляйте в шаблон, только вместо {loadposition razmer} пишите <jdoc:include type="modules" name="razmer" style="xhtml" />

Контент-плагины отлично работают в VirtueMart.
Разработка и ремонт. VirtueMart. JoomShopping. Свои компоненты. Принимаю заявки на plasma-web.ru.
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
Контент-плагины отлично работают в VirtueMart.
да че то не работает. может просветите как там надо его вставлять?
*

varX

  • Живу я здесь
  • 2450
  • 141 / 5
  • разработка компонентов
да че то не работает. может просветите как там надо его вставлять?

В настройках VirtueMart нужно включить подгрузку плагинов.
Разработка и ремонт. VirtueMart. JoomShopping. Свои компоненты. Принимаю заявки на plasma-web.ru.
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
В настройках VirtueMart нужно включить подгрузку плагинов.
включил.

написал в карточке товара {loadposition razmer}
вышла надпись {loadposition razmer}
модуль не подгрузился.
« Последнее редактирование: 07.02.2012, 13:10:25 от EmAl »
*

artlux

  • Захожу иногда
  • 466
  • 58 / 0
Код
<?php
$option = JRequest::getVar('option', null);
$page = JRequest::getVar('page', null);
if ($page == 'shop.product_details') : ?>
<jdoc:include type="modules" name="razmer" style="xhtml" />
<?php endif; ?>

Попробуй так... если не сработает значит не туда вставляешь скорее всего... (это в index.php шаблона)

или проверь что вообще выводится если вставить в шаблон

Код
$option = JRequest::getVar('option', null);
$page = JRequest::getVar('page', null);
echo $page;
echo $option;
Разработка расширений: Joomla 1.5+, Bitrix 12+, Мобильные приложения для сайтов под Android (PhoneGap).
Для бонусов: Z136221252622, R242724126443, U423945028202. +79211696184(Мегафон), или плюсик в репу!
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
Код
<?php
$option = JRequest::getVar('option', null);
$page = JRequest::getVar('page', null);
if ($page == 'shop.product_details') : ?>
<jdoc:include type="modules" name="razmer" style="xhtml" />
<?php endif; ?>

Попробуй так... если не сработает значит не туда вставляешь скорее всего... (это в index.php шаблона)

или проверь что вообще выводится если вставить в шаблон

Код
$option = JRequest::getVar('option', null);
$page = JRequest::getVar('page', null);
echo $page;
echo $option;

Код
<?php

/**
 *
 * Main file
 *
 * @version             1.0.0
 * @package             Gavern Framework
 * @copyright Copyright (C) 2010 - 2011 GavickPro. All rights reserved.
 *               
 */
 
// No direct access.
defined('_JEXEC') or die;
// enable showing errors in PHP
//ini_set('error_reporting', E_ALL);
//ini_set('display_errors','On');

// include framework classes and files
require_once('lib/framework/gk.const.php');
require_once('lib/framework/gk.parser.php');
require_once('lib/gk.framework.php');
// run the framework
$tpl = new GKTemplate($this, $GK_TEMPLATE_MODULE_STYLES);

/* End of the file - index.php */

вот мой файл index.php (шаблона). Он (шаблон) на frameworke.
Да и потом, не совсем допонимаю, вставив этот код в определенном месте, он в этом месте будет выводиться. Или потом еще надо как то его выводить?
Если он уже выводится в том месте, где  я его вставлю, то как его вывести в карточке товара в том месте, где мне надо?
*

artlux

  • Захожу иногда
  • 466
  • 58 / 0
ну в твоем слушае смотри то что писали выше... потому как куда нужно вставлять данную проверку, неизвестно (там откуда угодно модули могут грузится)...

http://joomlaforum.ru/index.php/topic,200400.msg1056436.html#msg1056436
Разработка расширений: Joomla 1.5+, Bitrix 12+, Мобильные приложения для сайтов под Android (PhoneGap).
Для бонусов: Z136221252622, R242724126443, U423945028202. +79211696184(Мегафон), или плюсик в репу!
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
Всем спасибо.
Сделал так.
Создал отдельный шаблон карточки товара.
в нем в нежном месте след код:
Код
    <div class="razmer">
 

 
 <?php
    $document = &JFactory::getDocument();
    $renderer = $document->loadRenderer('modules');
    $options = array('style' => 'xhtml');
    $position = 'razmer';
    echo $renderer->render($position, $options, null);
?>
 </div>
все вывелось.
осталось CSS подредактировать)
*

varX

  • Живу я здесь
  • 2450
  • 141 / 5
  • разработка компонентов
Цитировать
Сделал так.
Создал отдельный шаблон карточки товара.
в нем в нежном месте след код:

Нежное место в шаблоне это как? вот это фантазия.
Разработка и ремонт. VirtueMart. JoomShopping. Свои компоненты. Принимаю заявки на plasma-web.ru.
*

EmAl

  • Захожу иногда
  • 75
  • 0 / 0
Нежное место в шаблоне это как? вот это фантазия.
нужном*
*

dydy

  • Осваиваюсь на форуме
  • 29
  • 4 / 0
Попробуйте так:
1. Создаем модуль, назначаем ему любую свободную позицию (можно даже другого шаблона)
2. В шаблоне карточки товара вставляем

Код
<?php
$pos = 'inner-bottom';
$modules =& JModuleHelper::getModules($pos);
foreach ($modules as $module){
   echo JModuleHelper::renderModule($module);
}
?>
где 'inner-bottom' - название назначенной позиции
*

Mitriy-Bug

  • Захожу иногда
  • 90
  • 1 / 0
  • Верстка сайтов на Joomla
Попробуйте так:
1. Создаем модуль, назначаем ему любую свободную позицию (можно даже другого шаблона)
2. В шаблоне карточки товара вставляем

Код
<?php
$pos = 'inner-bottom';
$modules =& JModuleHelper::getModules($pos);
foreach ($modules as $module){
   echo JModuleHelper::renderModule($module);
}
?>
где 'inner-bottom' - название назначенной позиции
Вот огромное спасибо, помогли.
Правда я это использовал в компоненте JoomShopping :)
Все равно работает!
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Настройки отображения товара

Автор wectra

Ответов: 2
Просмотров: 2518
Последний ответ 12.07.2017, 22:12:27
от wectra
Несколько изображений для товара/ Лупа для изображения/ Magic Zoom

Автор antoha333

Ответов: 41
Просмотров: 25464
Последний ответ 13.11.2015, 16:08:16
от sonics
Как реализовать на VirtueMart такую карточку товара?

Автор AdmbVlad

Ответов: 0
Просмотров: 1413
Последний ответ 14.10.2015, 17:01:55
от AdmbVlad
Вставить картинку в карточку товара через URL и создать его миниатюру

Автор sashgera

Ответов: 8
Просмотров: 2343
Последний ответ 14.02.2015, 21:12:46
от sashgera
Как изменить сортировку товара ?

Автор Timer

Ответов: 0
Просмотров: 1333
Последний ответ 21.01.2015, 23:49:28
от Timer