News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Sold Out Badge on Category View

Started by Meta11icA, January 29, 2014, 15:21:03 PM

Previous topic - Next topic

Meta11icA

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

AH

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 } ?>        
Regards
A

Joomla 4.4.5
php 8.1

zainabubu

this showed no changes for me on my site, can you please specify the css file used here?