Post by shiokguy » Fri Sep 30, 2011 3:21 pm

padred123 wrote:
i2Paq wrote:I think it would be also nice to have the Add to Cart button removed instead of the whole product.
This works for me. It removes the add to cart button if the stock is anything different than "In Stock".

Look in file:
catalog\view\theme\"your_theme"\template\product\product.tpl

Find (around line 100):

Code: Select all

			  
 <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px;"><?php echo $text_qty; ?>
   <input type="text" name="quantity" size="3" value="1" />
   <a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span> </a></div>
 <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
 <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
</form>
Add this before the DIV tag:

Code: Select all

<?php  if($stock == 'In Stock' || $stock > 0){ ?>
Add this before the FORM tag :

Code: Select all

<?php } ?>
Result:

Code: Select all

  <?php  if($stock == 'In Stock' || $stock > 0){ ?>
  <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px;"><?php echo $text_qty; ?>
     <input type="text" name="quantity" size="3" value="1" />
     <a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a></div>
    <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
    <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
   <?php } ?>
  </form>
Dear padred123

How and Where do i do for V1.5.1.1?
I have search for the file you mentioned but cannot find the location.
thank in advance.

Regards
Shiok Guy

New member

Posts

Joined
Wed Jul 13, 2011 3:28 pm

Post by shiokguy » Sat Oct 08, 2011 1:21 pm

Dear All

I am using 1.5.1.1

This is the code at catalog/view/theme/default/template/product/category.tpl -- line 93+

Code: Select all

<div class="cart"><a onclick="addToCart('<?php echo $product['product_id']; ?>');" class="button"><span><?php echo $button_cart; ?></span></a></div>
I want to disable the $button_cart is the stock level = 0 or when the stock "OUT OF STOCK". My stock status message is "OUT OF STOCK" when the quantity is Zero.

How do I add code to disable it, or hide it?

Regards
Shiok Guy

New member

Posts

Joined
Wed Jul 13, 2011 3:28 pm

Post by shiokguy » Sat Oct 08, 2011 1:23 pm

Dear All
Better still, how can I add a graphic the same size as Add to Cart but the Graphic is SOLD OUT.

Regards
Shiok Guy

New member

Posts

Joined
Wed Jul 13, 2011 3:28 pm

Post by Qphoria » Sat Oct 08, 2011 8:59 pm


Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by rm79 » Mon Nov 07, 2011 5:13 am

Hi. I would like to do that trick with hiding add to cart button but I cannot find ''<div class="content">'' in product.tpl. I am running version 1.5.1.1. There is nothing like that around the line 100. But also I use Dreamweaver there is a syntax error apparently on line 348. >>> new AjaxUpload('#button-option-<?php echo $option['product_option_id']; ?>', { <<<
Many thanks for help if you could. Richard

Newbie

Posts

Joined
Fri Oct 14, 2011 12:34 am

Post by vaibhav.jain » Fri Jan 27, 2012 1:11 pm

hey guys, I was wondering if anyone can tell me what should i configure so I can get it out of stock when product quantity is 0..i knw it look stupid but I have done all the changes e.g. in setting page I have changes default out of stutus= out of status and manually i can do it from product data tab but i have 5000 product and I really can't find and do it manually pls help if posible..thanks..Jain

New member

Posts

Joined
Wed Nov 30, 2011 10:57 am

Post by vaibhav.jain » Fri Jan 27, 2012 3:29 pm

hey guys, I was wondering if anyone can tell me what should i configure so I can get it out of stock when product quantity is 0..i knw it look stupid but I have done all the changes e.g. in setting page I have changes default out of stutus= out of status and manually i can do it from product data tab but i have 5000 product and I really can't find and do it manually pls help if posible..thanks..Jain

New member

Posts

Joined
Wed Nov 30, 2011 10:57 am

Post by GoGo OpenCart » Fri Jan 27, 2012 6:07 pm

Take a look at the following two modules that can do that:

http://www.opencart.com/index.php?route ... on_id=4730

http://www.opencart.com/index.php?route ... on_id=4358

Free installation/help as always ;)

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

Post by vaibhav.jain » Fri Jan 27, 2012 11:26 pm

Hey, Thank you so much for your reply. however I am using one of them but still there is option of status which is still show in stock, I am facing customer saying I got confuse one place it says in stock n other out of stock..I also have problem with feeds as website is listed in few online site where stock lever is mapped with default OC stock level option..I guess you are getting what I want to say!!! please tell me why it doesn't work as a default..thanks..

New member

Posts

Joined
Wed Nov 30, 2011 10:57 am

Post by vaibhav.jain » Fri Jan 27, 2012 11:31 pm

hey, I m using your module only and it works great but as i said it says in stock at one place and out of stock in other..please help if you can..heaps thanks..

New member

Posts

Joined
Wed Nov 30, 2011 10:57 am

Post by GoGo OpenCart » Fri Jan 27, 2012 11:53 pm

@vaibhav.jain:

Are you talking about one of my modules, or you are talking about something else? ???

Because both my modules work as described, without any problems...

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

Post by vaibhav.jain » Sat Jan 28, 2012 12:27 am

pls see the following link, you will understand what i want to say..Avaibility- in stock, thats what I want to be currrect..
http://www.computerplanet.co.nz/iluv-ic ... -flexi-gel

New member

Posts

Joined
Wed Nov 30, 2011 10:57 am

Post by GoGo OpenCart » Sat Jan 28, 2012 1:15 am

That's not my module for sure :) Ask the developer of that module why it's like that, or there's a chance that you've messed something in the Admin > Settings area...

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

Post by vaibhav.jain » Sat Jan 28, 2012 1:19 am

yeah, i know its not your module dear..and yes I am asking everyone..I dont think there is much to mess in admin setting..do you want to have a look..pls..

New member

Posts

Joined
Wed Nov 30, 2011 10:57 am

Post by GoGo OpenCart » Sat Jan 28, 2012 1:25 am

Ok, no problem, I sent you an email ;)

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

Post by lpecsok58 » Mon Sep 14, 2015 4:20 am

GoGo OpenCart wrote:Take a look at the following two modules that can do that:

http://www.opencart.com/index.php?route ... on_id=4730

http://www.opencart.com/index.php?route ... on_id=4358

Free installation/help as always ;)
BUMP ... been trying to comment, not working at product page

Will this extension update 5,000 products in bulk, vs one-by-one? Will I then have a two-part job to update when back in stock? ... being my data import AND this extension?

Newbie

Posts

Joined
Sun Sep 13, 2015 6:44 am

Post by GoGo OpenCart » Tue Sep 15, 2015 5:33 am

lpecsok58 wrote:
GoGo OpenCart wrote:Take a look at the following two modules that can do that:

http://www.opencart.com/index.php?route ... on_id=4730

http://www.opencart.com/index.php?route ... on_id=4358

Free installation/help as always ;)
BUMP ... been trying to comment, not working at product page

Will this extension update 5,000 products in bulk, vs one-by-one? Will I then have a two-part job to update when back in stock? ... being my data import AND this extension?
I sent you a PM, so please check it.

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 11 guests