Post by ifyouseek » Tue Oct 11, 2011 2:33 pm

If stock = 0 a watermark out of stock image appears on top of the orignal image?

Would this be easy to do? Any thoughts?

Active Member

Posts

Joined
Thu May 06, 2010 4:40 pm

User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by ifyouseek » Tue Oct 11, 2011 11:43 pm

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.

Active Member

Posts

Joined
Thu May 06, 2010 4:40 pm

Post by grgr » Wed Oct 12, 2011 2:00 am

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.

-
Image Image Image Image
VIEW ALL EXTENSIONS * EXTENSION SUPPORT * WEBSITE * CUSTOM REQUESTS


User avatar
Active Member

Posts

Joined
Mon Mar 28, 2011 4:08 pm
Location - UK

Post by MatthewB » Wed Oct 12, 2011 2:19 am

I use this vqmod file

it changes the "add to cart" button to "out of stock" and is not clickable

Attachments


Matthew


Active Member

Posts

Joined
Sat Jul 23, 2011 5:18 am
Location - Sunderland Tyne and Wear

Post by ifyouseek » Mon Dec 19, 2011 12:36 am

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

	<div class="cart">

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.
Last edited by ifyouseek on Sun Mar 23, 2014 8:36 am, edited 1 time in total.

Active Member

Posts

Joined
Thu May 06, 2010 4:40 pm

Post by Marcus » Fri Dec 30, 2011 7:54 pm

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>

New member

Posts

Joined
Sun Dec 11, 2011 12:19 am

Post by GoGo OpenCart » Fri Dec 30, 2011 9:19 pm

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.

See all my extensions: https://www.opencart.com/index.php?rout ... 20OpenCart


User avatar
Active Member

Posts

Joined
Mon Nov 14, 2011 11:30 pm
Who is online

Users browsing this forum: No registered users and 139 guests