Page 1 of 1
Out of stock image watermark
Posted: Tue Oct 11, 2011 2:33 pm
by ifyouseek
If stock = 0 a watermark out of stock image appears on top of the orignal image?
Would this be easy to do? Any thoughts?
Re: Out of stock image watermark
Posted: Tue Oct 11, 2011 2:41 pm
by grgr
Re: Out of stock image watermark
Posted: Tue Oct 11, 2011 11:43 pm
by ifyouseek
thats a bit of an overkill for what i need... I thought a watermark would be a good idea but to do it myself it may be a bit complicated.
So what i can imagine would be easier is when a product is out of stock on the category page it would replace the star rating with Out Of Stock.
currently you cannot tell if the item is out of stock until you add to cart and then view cart and get the error message, this isn't that good.
Re: Out of stock image watermark
Posted: Wed Oct 12, 2011 2:00 am
by grgr
You can change the 'add to cart button' to an 'out of stock' button, do a search (google may be better) as there are instructions on how to do it on the forum somewhere.
Re: Out of stock image watermark
Posted: Wed Oct 12, 2011 2:19 am
by MatthewB
I use this vqmod file
it changes the "add to cart" button to "out of stock" and is not clickable
Re: Out of stock image watermark
Posted: Mon Dec 19, 2011 12:36 am
by ifyouseek
thought i'd give an update on what it did to resolve this problem in 1.5.1.3...
for the category page, i inserted this code below into catalog/view/theme/default/template/product/category.tp it replaced the star rating with the out of stock message.
before the line:
Code: Select all
<?php if ($product['rating']) { ?>
Code: Select all
<?php if ($product['stock'] == 0) { ?>
<div class="rating"><span style="text-align: center; font-size: 11px; font-weight: bold; color: red;">Out Of Stock</span></div>
<?php } else { ?> ****NORMAL STAR RATING CODE HERE**** <?php } ?>
This changes the star rating to the message out of stock on the category page when stock=0.
Next i added this into the same category page, when stock=0 it replaces the add to cart button with an 'Enquire' button which then links to the contact us page.
Add the code just after this line
Code: Select all
<?php if ($product['stock'] == 0) {
echo '<a onclick="" href="/index.php?route=information/contact" class="button" style="padding: -5px 0 0 0;"><span>Enquire</span></a>';
} else { ?> ****Normal add to cart button code here****** <?php } ?>
I made the very similar changes to the product page. I hope this can help someone out.
Re: Out of stock image watermark
Posted: Fri Dec 30, 2011 7:54 pm
by Marcus
Sorry being dense here as can't seem to get this working
Im trying to use just the last section to change the out of stock icon to Enquire and link to the comments
Where do I add the code, is it between the <div class="cart"> and <a onclick= etc or at the end of the statement after the /div
either way doesn't seem to work.
This is the code from my file, before the mod
<div class="cart"><a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
Re: Out of stock image watermark
Posted: Fri Dec 30, 2011 9:19 pm
by GoGo OpenCart
I released a mod for doing this:
http://www.opencart.com/index.php?route ... on_id=4358
It will disable the "Add to Cart" button everywhere within the OpenCart, and you can choose to leave it enabled or not for products that have Pre-Order, 2-3 Days, etc. statuses.