× English Section!

We will be more than happy to help you with problems related to our services and products. Please feel free to write it down as clear as possible

Change custom fields layout to lines for custom fields

Περισσότερα
2 Χρόνια 9 Μήνες πριν #217 από infogate
Change the way custom fields added to products show.
If i use smart template to one of my categories then all the added custom fields with their values show as tabs.
Having the custom fields and their values added as table the best way is to replace the tabs system of the template and use the standard VirtueMart layout, you can make the following changes.

Override and customise - templates/vp_smart/layouts/default/html/com_virtuemart/productdetails/default.php

Replace
<?php if(!empty($tabTitles) && !empty($tabDisplays)) : ?>
					<div class="product-tabpanel" role="tabpanel">
						<!-- Nav tabs -->
						<ul class="nav nav-list" role="tablist">
							<?php $i = 0; ?>
							<?php foreach($tabTitles as $id => $title) : ?>
								<?php $i++; ?>
								<li role="presentation"<?php echo ($i == 1) ? ' class="active"' : ''; ?>>
									<a href="#<?php echo $id ?>" aria-controls="<?php echo $id ?>" role="tab" data-toggle="tab"><?php echo $title ?></a>
								</li>
							<?php endforeach; ?>
							<?php if($this->allowRating || $this->allowReview || $this->showRating || $this->showReview) : ?>
								<li role="presentation">
									<a href="#tab-reviews" aria-controls="tab-reviews" role="tab" data-toggle="tab"><?php echo vmText::_('COM_VIRTUEMART_REVIEWS') ?></a>
								</li>
							<?php endif; ?>
						</ul>
						<!-- Tab panes -->
						<div class="tab-content with-list-tab">
							<?php $i = 0; ?>
							<?php foreach($tabDisplays as $id => $display) : ?>
								<?php $i++; ?>
								<div role="tabpanel" class="tab-pane fade<?php echo ($i == 1) ? ' in active' : ''; ?>" id="<?php echo $id ?>">
									<div <?php echo empty($metaDescription) && empty($this->product->product_s_desc) && !empty($this->product->product_desc) ? 'class="product-tab-texts" itemprop="description"' : 'class="product-tab-texts`"'; ?>>
										<?php echo $display ?>
									</div>
									<?php if($i == 1 && $this->product->product_box) : ?>
										<div class="product-box">
											<?php echo vmText::_('COM_VIRTUEMART_PRODUCT_UNITS_IN_BOX') . $this->product->product_box; ?>
										</div>
									<?php endif; ?>
								</div>
							<?php endforeach; ?>
							<?php if($this->allowRating || $this->allowReview || $this->showRating || $this->showReview) : ?>
								<div role="tabpanel" class="tab-pane fade" id="tab-reviews">
									<?php echo $this->loadTemplate('reviews'); ?>
								</div>
							<?php endif; ?>
						</div>
					</div>
        <?php elseif($this->allowRating || $this->allowReview || $this->showRating || $this->showReview) : ?>
          <div class="product-tabpanel" role="tabpanel">
            <!-- Nav tabs -->
            <ul class="nav nav-list" role="tablist">
							<li role="presentation" class="active">
								<a href="#tab-reviews" aria-controls="tab-reviews" role="tab" data-toggle="tab"><?php echo vmText::_('COM_VIRTUEMART_REVIEWS') ?></a>
							</li>
            </ul>
            <!-- Tab panes -->
            <div class="tab-content with-list-tab">
							<div role="tabpanel" class="tab-pane fade in active" id="tab-reviews">
								<?php echo $this->loadTemplate('reviews'); ?>
							</div>
            </div>
          </div>
				<?php endif; ?>

With
<?php echo $this->product->product_desc; ?>
				<?php if($i == 1 && $this->product->product_box) : ?>
					<div class="product-box">
						<?php echo vmText::_('COM_VIRTUEMART_PRODUCT_UNITS_IN_BOX') . $this->product->product_box; ?>
					</div>
				<?php endif; ?>
				<?php echo shopfunctionsf::rendervmsublayout('customfields', array('product' => $this->product, 'position' => 'normal')); ?>
				<?php if($this->allowRating || $this->allowReview || $this->showRating || $this->showReview) : ?>
					<?php echo $this->loadTemplate('reviews'); ?>
				<?php endif; ?>

Use the following CSS code
.product-field-type-S {
margin: 5px;
min-height: 15px;
overflow: hidden;
padding: 8px 5px 0px;
border-top: 1px solid #cccccc;
font-size: 14px;
width:auto;
}


.product-fields-title {
font-weight: bold;
float: left;
width: 35%;
color:#000000;
}

.product-field {
float: left;
width: 64%;
margin: 0px;
}


The best possible way to start your online marketing : fspirits.com/go/leadsleap-home
Explode Your Web Site Traffice: fspirits.com/go/sparktraffic
Start your affiliate journey here: fspirits.com/go/olsp-academy
Best Solution To Create Videos: fspirits.com/go/create-studio-pro
Best Solution To Create Graphics: fspirits.com/go/clickdesigns
Smart Chat Automation: fspirits.com/go/chatterpal
Multi-Purpose Video Maker: fspirits.com/go/avatar-builder
Multi-Purpose Video Creator: fspirits.com/go/video-creator
AI Human Spokesperson Videos: fspirits.com/go/humanpal

Παρακαλούμε Σύνδεση ή Δημιουργία λογαριασμού για να συμμετάσχετε στη συζήτηση.

Χρόνος δημιουργίας σελίδας: 0.743 δευτερόλεπτα
Powered by Kunena Φόρουμ