VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: Meta11icA on January 29, 2014, 15:21:03 PM

Title: Sold Out Badge on Category View
Post by: Meta11icA on January 29, 2014, 15:21:03 PM
Hello!
I am trying to show a sold out badge on the category view and something is not working quite well.
I am using the following code<?php
if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none')  ){?>

<?php if (($product->product_in_stock $product->product_ordered) < 1) { ?>
                <div class="SoldOut"><?php echo $soldouttext;?></div>
<?php }?>
<?php }>   

in templates/mytemplate/html/com_virtuemart/category/default.php

the css looks like this:
.SoldOut {
font:bold 15px/28px "Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,Verdana,sans-serif;
color:#FFF;
background:#F00;
text-align:center;
position: absolute;
top: 28px;
left: 0px;
-webkit-transform: rotate(-20deg); /**safari, chrome**/
-moz-transform: rotate(-20deg); /**firefox**/
transform: rotate(-20deg); /**other browsers**/
width:100%;
opacity:0.7;

}


I don't know what am I doing wrong because I "borrowed" the code from another extension, FancyProductSlider which is displaying it perfectly inside the module.
I appreciate any help/suggestion
Title: Re: Sold Out Badge on Category View
Post by: AH on February 01, 2014, 12:29:19 PM
I think this could be modified to work correctly

if (!VmConfig::get('use_as_catalog') and !(VmConfig::get('stockhandle','none')=='none')  ){?>
                     <?php if (($product->product_in_stock - $product->product_ordered) < 1) { ?>
                         <div class="SoldOut"><?php echo $soldouttext;?></div>
                     <?php }?>
               <?php }>        


Try this

if (!VmConfig::get('use_as_catalog') and (!VmConfig::get('stockhandle','none')=='none')  ){?>
                     <?php if (($product->product_in_stock - $product->product_ordered) < 1) { ?>
                         <div class="SoldOut"><?php echo $soldouttext;?></div>
                     <?php }?>
               <?php } ?>        
Title: Re: Sold Out Badge on Category View
Post by: zainabubu on March 06, 2014, 19:22:55 PM
this showed no changes for me on my site, can you please specify the css file used here?