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

Ragnos

  • Захожу иногда
  • 253
  • 0 / 0
Разделение на вкладки
« : 05.07.2016, 10:39:46 »
Привет всем, подскажите пожалуйста как сделать отдельной вкладкой добавляющиеся поля в описании товара, в карточке товара я создал доп. поле, но в файле отвечающий за отображение не могу понять какой из кодов отвечает за вывод, можете подсказать что именно мне тут нужно отделить в отдельную вкладку ?

Код
<?php
/**
 *
 * Show the product details page
 *
 * @package VirtueMart
 * @subpackage
 * @author Max Milbers, Eugen Stranz, Max Galt
 * @link http://www.virtuemart.net
 * @copyright Copyright (c) 2004 - 2014 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html 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.
 * @version $Id: default.php 9185 2016-02-25 13:51:01Z Milbo $
 */
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

/* Let's see if we found the product */
if (empty($this->product)) {
echo vmText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND');
echo '<br /><br />  ' . $this->continue_link_html;
return;
}

echo shopFunctionsF::renderVmSubLayout('askrecomjs',array('product'=>$this->product));



if(vRequest::getInt('print',false)){ ?>
<body onload="javascript:print();">
<?php } ?>

<div class="productdetails-view productdetails" >

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

<?php // Back To Category Button
if ($this->product->virtuemart_category_id) {
$catURL =  JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$this->product->virtuemart_category_id, FALSE);
$categoryName = vmText::_($this->product->category_name) ;
} else {
$catURL =  JRoute::_('index.php?option=com_virtuemart');
$categoryName = vmText::_('COM_VIRTUEMART_SHOP_HOME') ;
}
?>
<div class="back-to-category">
    <a href="<?php echo $catURL ?>" class="product-details" title="<?php echo $categoryName ?>"><?php echo vmText::sprintf('COM_VIRTUEMART_CATEGORY_BACK_TO',$categoryName)?></a>
</div>

    <?php // Product Title   ?>
    <h1 class="zagtov" itemprop="name"><?php echo $this->product->product_name ?></h1>
    <?php // Product Title END   ?>

    <?php // afterDisplayTitle Event
    echo $this->product->event->afterDisplayTitle ?>

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

    <?php
    // PDF - Print - Email Icon
    if (VmConfig::get('show_emailfriend') || VmConfig::get('show_printicon') || VmConfig::get('pdf_icon')) {
?>
        <div class="icons">
    <?php

    $link = 'index.php?tmpl=component&option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->virtuemart_product_id;

echo $this->linkIcon($link . '&format=pdf', 'COM_VIRTUEMART_PDF', 'pdf_button', 'pdf_icon', false);
    //echo $this->linkIcon($link . '&print=1', 'COM_VIRTUEMART_PRINT', 'printButton', 'show_printicon');
echo $this->linkIcon($link . '&print=1', 'COM_VIRTUEMART_PRINT', 'printButton', 'show_printicon',false,true,false,'class="printModal"');
$MailLink = 'index.php?option=com_virtuemart&view=productdetails&task=recommend&virtuemart_product_id=' . $this->product->virtuemart_product_id . '&virtuemart_category_id=' . $this->product->virtuemart_category_id . '&tmpl=component';
    echo $this->linkIcon($MailLink, 'COM_VIRTUEMART_EMAIL', 'emailButton', 'show_emailfriend', false,true,false,'class="recommened-to-friend"');
    ?>
    <div class="clear"></div>
        </div>
    <?php } // PDF - Print - Email Icon END
    ?>



    <div class="vm-product-container">
<div class="vm-product-media-container">
<?php
echo $this->loadTemplate('images');
?>
</div>

<div class="vm-product-details-container">
    <div class="spacer-buy-area">

<?php
// TODO 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 = vmText::_('COM_VIRTUEMART_VENDOR_FORM_INFO_LBL');
  echo '<span class="bold">'. vmText::_('COM_VIRTUEMART_PRODUCT_DETAILS_VENDOR_LBL'). '</span>'; ?><a class="modal" href="<?php echo $link ?>"><?php echo $text ?></a><br />
*/
?>

<?php
echo shopFunctionsF::renderVmSubLayout('rating',array('showRating'=>$this->showRating,'product'=>$this->product));

if (is_array($this->productDisplayShipments)) {
    foreach ($this->productDisplayShipments as $productDisplayShipment) {
echo $productDisplayShipment . '<br />';
    }
}
if (is_array($this->productDisplayPayments)) {
    foreach ($this->productDisplayPayments as $productDisplayPayment) {
echo $productDisplayPayment . '<br />';
    }
}

//In case you are not happy using everywhere the same price display fromat, just create your own layout
//in override /html/fields and use as first parameter the name of your file
echo shopFunctionsF::renderVmSubLayout('prices',array('product'=>$this->product,'currency'=>$this->currency));
?> <div class="clear"></div><?php
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$this->product));

echo shopFunctionsF::renderVmSubLayout('stockhandle',array('product'=>$this->product));

// Ask a question about this product
if (VmConfig::get('ask_question', 0) == 1) {
$askquestion_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', FALSE);
?>
<div class="ask-a-question">
<a class="ask-a-question" href="<?php echo $askquestion_url ?>" rel="nofollow" ><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_ENQUIRY_LBL')?></a>
</div>
<?php
}
?>

<?php
// Manufacturer of the Product
if (VmConfig::get('show_manufacturers', 1) && !empty($this->product->virtuemart_manufacturer_id)) {
    echo $this->loadTemplate('manufacturer');
}
?>

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


    </div>
<?php
$count_images = count ($this->product->images);
if ($count_images > 1) {
echo $this->loadTemplate('images_additional');
}

// event onContentBeforeDisplay
echo $this->product->event->beforeDisplayContent; ?>

<?php
//echo ($this->product->product_in_stock - $this->product->product_ordered);
// 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 vmText::_('COM_VIRTUEMART_PRODUCT_DESC_TITLE')?></span>
<?php echo $this->product->product_desc; ?>
        </div>
<?php
    } // Product Description END

echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'normal'));

    // Product Packaging
    $product_packaging = '';
    if ($this->product->product_box) {
?>
        <div class="product-box">
    <?php
        echo vmText::_('COM_VIRTUEMART_PRODUCT_UNITS_IN_BOX').$this->product->product_box;
    ?>
        </div>
    <?php } // Product Packaging END ?>

    <?php
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'onbot'));

  echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'related_products','class'=> 'product-related-products','customTitle' => true ));

echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'related_categories','class'=> 'product-related-categories'));

?>

<?php // onContentAfterDisplay event
echo $this->product->event->afterDisplayContent;

echo $this->loadTemplate('reviews');

// Show child categories
if (VmConfig::get('showCategory', 1)) {
echo $this->loadTemplate('showcategory');
}

$j = 'jQuery(document).ready(function($) {
VirtueMart.product(jQuery("form.product"));

$("form.js-recalculate").each(function(){
if ($(this).find(".product-fields").length && !$(this).find(".no-vm-bind").length) {
var id= $(this).find(\'input[name="virtuemart_product_id[]"]\').val();
VirtueMart.setproducttype($(this),id);

}
});
});';
//vmJsApi::addJScript('recalcReady',$j);

/** GALT
 * Notice for Template Developers!
 * Templates must set a VirtueMart.container variable as it takes part in
 * dynamic content update.
 * This variable points to a topmost element that holds other content.
 */
$j = "Virtuemart.container = jQuery('.productdetails-view');
VirtueMart.containerSelector = '.productdetails-view';";

vmJsApi::addJScript('ajaxContent',$j);

if(VmConfig::get ('jdynupdate', TRUE)){
$j = "jQuery(document).ready(function($) {
VirtueMart.stopVmLoading();
var msg = '';
jQuery('a[data-dynamic-update=\"1\"]').off('click', VirtueMart.startVmLoading).on('click', {msg:msg}, VirtueMart.startVmLoading);
jQuery('[data-dynamic-update=\"1\"]').off('change', VirtueMart.startVmLoading).on('change', {msg:msg}, VirtueMart.startVmLoading);
});";

vmJsApi::addJScript('vmPreloader',$j);
}

echo vmJsApi::writeJS();

if ($this->product->prices['salesPrice'] > 0) {
  echo shopFunctionsF::renderVmSubLayout('snippets',array('product'=>$this->product, 'currency'=>$this->currency, 'showRating'=>$this->showRating));
}

?>
</div>
*

gartes

  • Завсегдатай
  • 1859
  • 142 / 6
  • Е = mс²
Re: Разделение на вкладки
« Ответ #1 : 05.07.2016, 11:07:08 »
Описание товара
Код: php
<?php echo $this->product->product_desc; ?>

Кнопки предыдущий и следующий товар
Код: php
<?php
    if (!empty($this->product->neighbours ['previous'][0])) {
$prev_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['previous'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id, FALSE);
echo JHtml::_('link', $prev_link, $this->product->neighbours ['previous'][0]
['product_name'], array('rel'=>'prev', 'class' => 'previous-page','data-dynamic-update' => '1'));
    }
    if (!empty($this->product->neighbours ['next'][0])) {
$next_link = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $this->product->neighbours ['next'][0] ['virtuemart_product_id'] . '&virtuemart_category_id=' . $this->product->virtuemart_category_id, FALSE);
echo JHtml::_('link', $next_link, $this->product->neighbours ['next'][0] ['product_name'], array('rel'=>'next','class' => 'next-page','data-dynamic-update' => '1'));
    }
    ?>
Наименование товара
Код: php
<?php echo $this->product->product_name ?>

Рейтинг
Код: php
echo shopFunctionsF::renderVmSubLayout('rating',array('showRating'=>$this->showRating,'product'=>$this->product));

Цена
Код: php
echo shopFunctionsF::renderVmSubLayout('prices',array('product'=>$this->product,'currency'=>$this->currency));

Кнопка купить
Код: php
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$this->product));

Где то так
при использовании такой надписи это вывод слоя.
Код: php
shopFunctionsF::renderVmSubLayout

В общем если не понятно спрашивайте. ...
*

Ragnos

  • Захожу иногда
  • 253
  • 0 / 0
Re: Разделение на вкладки
« Ответ #2 : 05.07.2016, 11:28:18 »
Спасибо, только мне нужно найти тот код который отвечает за вывод доп. полей которые можно создать в редакторе карточки товара, вот его я не могу найти среди всего этого, точне я вроде как нашел, но не могу его отделить так чтобы ничего не ломалось
*

gartes

  • Завсегдатай
  • 1859
  • 142 / 6
  • Е = mс²
Re: Разделение на вкладки
« Ответ #3 : 05.07.2016, 11:40:46 »
В карточке товара
Цитата: php
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$this->product,'position'=>'normal'));

Это тот же SubLayout

лежит этот файлик тут
/components/com_virtuemart/sublayouts/customfields.php

Конкретно скажите где и что вы хотите переделать...

*

Ragnos

  • Захожу иногда
  • 253
  • 0 / 0
Re: Разделение на вкладки
« Ответ #4 : 05.07.2016, 12:47:09 »
Я хочу сделать табы в карточке товаров, чтобы описание товара, доп. поля (характеристики будут) и отзывы, были каждый в отдельном табе, я вот и не могу понять какой кусок кода можно поместить в таб, чтобы сама катачка не сломалась
*

gartes

  • Завсегдатай
  • 1859
  • 142 / 6
  • Е = mс²
Re: Разделение на вкладки
« Ответ #5 : 05.07.2016, 14:25:07 »
Прошу прощения сразу не уточнил версия VirtueMart и Joomla ////
*

gartes

  • Завсегдатай
  • 1859
  • 142 / 6
  • Е = mс²
Re: Разделение на вкладки
« Ответ #6 : 05.07.2016, 14:26:09 »
Давайте версию щас пример накатаем .  !
*

Ragnos

  • Захожу иногда
  • 253
  • 0 / 0
Re: Разделение на вкладки
« Ответ #7 : 05.07.2016, 15:57:10 »
Спасибо, версия  VirtueMart 3.0.14, версия Joomla! 3.3.6 Stable
*

Anna01

  • Захожу иногда
  • 53
  • 0 / 0
Re: Разделение на вкладки
« Ответ #8 : 14.08.2017, 22:50:38 »
Код
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$this->product));

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

Avarus

  • Осваиваюсь на форуме
  • 33
  • 8 / 1
Re: Разделение на вкладки
« Ответ #9 : 14.08.2017, 23:38:15 »
В файле ../sublayouts/addtocart.php блок кода, отвечающий за вывод кнопки:
Код
<?php
if (!VmConfig::get('use_as_catalog', 0)  ) {
echo shopFunctionsF::renderVmSubLayout('addtocartbar',array('product'=>$product));
} ?>
переместить вверх кода, отвечающего за вывод доп.полей:
Код
<div class="vm-customfields-wrap">
<?php
if(!empty($rowHeights['customfields'])) {
foreach($positions as $pos){
echo shopFunctionsF::renderVmSubLayout('customfields',array('product'=>$product,'position'=>$pos));
}
} ?>
</div>
*

draff

  • Гуру
  • 5803
  • 434 / 7
  • ищу работу
Re: Разделение на вкладки
« Ответ #10 : 15.08.2017, 07:22:00 »
Код
echo shopFunctionsF::renderVmSubLayout('addtocart',array('product'=>$this->product));

в данном коде идет кнопка купить и настраиваемые поля. как их разделить? мне нужно чтобы кнопка купить была сверху. а у меня настраиваеммые пол здоровые. кнопка сильно вниз идет. нужно чтобы кнопка была в начале.
А указать позицию ontop настраиваемому полю пробовали ? Если не указать позицию поля выводятся с кнопкой купить .
Чтобы оставить сообщение,
Вам необходимо Войти или Зарегистрироваться
 

Табы вкладки описание и озывы

Автор vetkrs

Ответов: 0
Просмотров: 679
Последний ответ 11.03.2019, 20:45:44
от vetkrs
Вкладки/Табыв описание товара, вставить видео

Автор 12mv

Ответов: 2
Просмотров: 794
Последний ответ 24.03.2016, 20:08:32
от Liss