News:

Support the VirtueMart project and become a member

Main Menu

Change lay-out position of special fields on my website

Started by p.lankhaar, March 31, 2016, 02:05:10 AM

Previous topic - Next topic

p.lankhaar

Dear ,
At first I want to excuse myself for my English. I'm fully aware that I write my English as a Dutchman!  8)
I'm absolutely a newbie / beginner in Joomla, in Virtuemart and in PHP language. I'm using it now to build my new website and I love this CMS! I have several questions now and I hope I can get answers here.

Together with an hobby mate I have much much old vintage items that I want to show on our website with the catalogue module of Virtuemart. By each of the listed items, I have added some special fields with detail information.
One example
First of all, now the special fields are showed under the picture, but I want to show this special fields on the right side near the picture.

Excuse me when someone have already asked this! I cannot find an answer.

In advance everyone thanks for your help,

Jörgen

Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

p.lankhaar

#2
Dear Jörgen,

Unfortunately by me that doesn't help.

I've inspected this page with Firebug and I see two items:
<div class="vm-product-media-container"> That's the picture.
<div class="vm-product-details-container"> That's on the right side behind the picture. And that's the place where I want to have the technical details of my items.

I've searched for the components\com_virtuemart\views\productdetails\tmpl\default.php  (I have made a second default, it's called default - edited.php). So I hold the default.php original.

In the picture is showed that I have already changed the path of the template of the Article view.

Further I've added my default - edited.php  (In Dutch default - bewerkt.php). In role 126 to 128 I've made my changes.

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

Also "ontop" and "mynewpos" doesn't matter.
Most probably is that I'm too stupid for PHP   ;D

Thanks again.

Ghost

You forgot a closing PHP tag after // Product Short Description END.

The position name is supposed to be the name of layout position assigned to custom field. It's assigned when creating/editing custom field. By default (when left empty), the position is 'normal'. You can add any custom position name to the field, e.g. myposition.

Then add the position in your layout like this:

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

Only fields with the specified position will be show in that place.


p.lankhaar

I feel myself very stupid!
I've changed the lay-out position of the special fields. I've used "addtocart" and now my special fields are showed right from the pictures.

I have some other problems and I shall make a new topic for my cases.