VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Otto0815 on April 03, 2012, 16:23:23 PM

Title: Availability image layout on category page
Post by: Otto0815 on April 03, 2012, 16:23:23 PM
Hi,

i ran into strange problems when i tried to set the availabilty image on the category page "centered" under the pöroduct image....

I tried the normal "Text-align:center", but this doesn't work.

I've put the image in an extra "div", but this doesn't work, too

If i try it with "margin", it works, but when you change the resolution then it is no longer "centered"....

Can someone point me iin the right direction?

Here's the part of code from the template:

   <div class="paddingtop8">
                  <span class="vmicon vm2-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>" ></span>
                     <span class="stock-level"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') ?></span>
                  </div>




[attachment cleanup by admin]
Title: Re: Availability image layout on category page
Post by: PRO on April 03, 2012, 17:54:01 PM
nobody can help without a url.

http://forum.virtuemart.net/index.php?topic=73348.0
Title: Re: Availability image layout on category page
Post by: Otto0815 on April 03, 2012, 18:14:27 PM
Thx for the link....but im already working with firebug...and tried everything...text-align, margin, float....but this picture won't move to "center" :-((

It's the image on the default category page which is within every virtuemart.......(i'm not shure if i should post the url in an public forum)..

Maybe someone has got an solution without my url for me.....
Title: Re: Availability image layout on category page
Post by: PRO on April 03, 2012, 18:41:14 PM
Otto0815, NOBODY still has the default css/layout.
I modified mine on day one, so I do not know how to examine without a url.

U can send me the url in pm, and I will look
Title: Re: Availability image layout on category page
Post by: Otto0815 on April 04, 2012, 13:19:21 PM
So, i've the solution:

in the default.php from the category view you have to "div" the following lines ('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP'):

   <?php
                  if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none') && (VmConfig::get ( 'display_stock', 1 )) ){?>
<!--                   if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none')){?> -->
                  <div class="paddingtop8">
                  <span class="vmicon vm2kat-<?php echo $product->stock->stock_level ?>" title="<?php echo $product->stock->stock_tip ?>"></span>
Add this Div-->         <div class="paddingtop8">            <span class="stock-level"><?php echo JText::_('COM_VIRTUEMART_STOCK_LEVEL_DISPLAY_TITLE_TIP') ?></span>   </div>    <--- Add these Div
                  </div>
                  <?php }?>
            </div>

In the vmsite-ltr.css you have to edit the lines 148-150:

.vm2-lowstock{background-position:0 -1114px;width:62px;height:15px;display:block;}
.vm2-nostock{background-position:0 -1179px;width:62px;height:15px;display:block;}
.vm2-normalstock{background-position:0 -1244px;width:62px;height:15px;display:block;}

from "display:block" to "display:inline-block"