Page 1 of 3

[vQmod] - Disable/Remove out of stock prod options (15x/2

Posted: Thu Dec 16, 2010 3:00 am
by Qphoria
This will let you either disable or remove out of stock options. Pay attention to the last step for deciding which way you want it to work. This should work for all v1.4.x, 1.5.x, and v2.x versions. Tested and working.

Just drop one of these 2 files into the vqmod folder, depending on which feature you want.

The "Disable" script will show out of stock options in the list but won't let you select them as they are set to disabled.
The "Hide" script will completely hide the out of stock options from the list. This is only used for 1.4.x since 1.5.x and 2.x both already hide out of stock options by default.

Re: [MOD] - Disable/Remove out of stock product options

Posted: Sat Dec 25, 2010 12:14 am
by zeroevil
You are the man Q this is something I've been looking for too. Thanks alot !!!!!

Re: [MOD] - Disable/Remove out of stock product options

Posted: Sat Jan 29, 2011 12:06 pm
by steadynow
Thanks for this Q, a million thanks!

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Fri Jul 29, 2011 1:55 am
by chadelkins
Q: is there a 1.5 solution to this same problem? Or will this work on 1.5?

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Fri Jul 29, 2011 3:09 am
by Qphoria
Updated to work on 1.4.x and 1.5.x

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Mon Aug 01, 2011 6:33 pm
by shawtham
HI, I am using OC 1.5.1, i think by default, this version remove "Add to Cart " when product is out of stock. I actually remove the xml file, and reload the page, and "Add to Cart" is still gone as planned..

And then I try the "disable_out_of_stock_options_vqmod.xml", and I have also reduced one of the option to 0. When I reload the product page, that Option just disappear, instead of grey out or strike off. My question is : Is it planned to be that way, or I miss out something?

I am quite sure the vQmod is working, as it works for another script, "Professional HTML Email".

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Wed Aug 03, 2011 5:22 am
by shawtham
Hi, actually what I wish to do is my product has only one size, but I want to create the impression on many size options, but grey out / strike off and non-selectable for those options.

I tried vQmod "disable out of stock", don't work for my cart v1.5.1, is that another way I could achieve it?

Many thanks in advance.

Shaw

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Thu Aug 04, 2011 3:03 am
by goodday1
hello,
i have dropped both of these into the vqmod xml folder -one at a time of course - and i cant get either to work.

i am using version 1.5.1 which apparantly should work - if anyone has any suggestions i would be very grateful.

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Thu Aug 04, 2011 3:29 am
by Qphoria
what does the vqmod.log show?

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Thu Aug 04, 2011 4:01 am
by goodday1
i cant find vqmod.log - i am using v 1.2.3 of vqmod and cant see .log anywhere either as a file in vqmod or in any subfolders
thanks

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Thu Aug 04, 2011 4:06 pm
by goodday1
actually can i just check

there is a line in /hide_out_of_stock_options_vqmod.xml that says

<file name="catalog/view/theme/default/template/product/product.tpl">


I am new to opencart - as i am now using a theme that is not the default theme is there a need for me to change the word default to the name of my theme in the extract of code above or does this line of code just automatically include my theme ?

thank you

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Thu Aug 04, 2011 4:08 pm
by goodday1
ps still cant find vqmod.log can anyone point me in the right direction - i have checked in as many folders that i can see for opencart 1.5.1 on my server .
thanks

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Thu Aug 04, 2011 5:39 pm
by shawtham
HI, found the vqmod.log file, I am pasting the most recent error log:

Current in xml folder are disable_out_of_stock_options_vqmod.xml and hide_atc_for_out_of_stock.xml.

----------------------20110801-102032-------------------------
SOURCEFILE: /home/littlepr/public_html/catalog/controller/product/product.php
MODFILE: /home/littlepr/public_html/vqmod/xml/hide_out_of_stock_options_vqmod.xml
SEARCH: 'name' => $option_value['name'],
OPERATION FAILED (ABORTED): NO MATCH FOR SEARCH!
--------------------------------------------------------------


----------------------20110801-102033-------------------------
SOURCEFILE: /home/littlepr/public_html/catalog/controller/product/product.php
MODFILE: /home/littlepr/public_html/vqmod/xml/hide_out_of_stock_options_vqmod.xml
SEARCH: 'name' => $option_value['name'],
OPERATION FAILED (ABORTED): NO MATCH FOR SEARCH!
--------------------------------------------------------------


----------------------20110801-102033-------------------------
SOURCEFILE: /home/littlepr/public_html/catalog/controller/product/product.php
MODFILE: /home/littlepr/public_html/vqmod/xml/hide_out_of_stock_options_vqmod.xml
SEARCH: 'name' => $option_value['name'],
OPERATION FAILED (ABORTED): NO MATCH FOR SEARCH!
--------------------------------------------------------------


----------------------20110801-102056-------------------------
SOURCEFILE: /home/littlepr/public_html/catalog/controller/product/product.php
MODFILE: /home/littlepr/public_html/vqmod/xml/hide_out_of_stock_options_vqmod.xml
SEARCH: 'name' => $option_value['name'],
OPERATION FAILED (ABORTED): NO MATCH FOR SEARCH!
--------------------------------------------------------------


----------------------20110801-102056-------------------------
SOURCEFILE: /home/littlepr/public_html/catalog/controller/product/product.php
MODFILE: /home/littlepr/public_html/vqmod/xml/hide_out_of_stock_options_vqmod.xml
SEARCH: 'name' => $option_value['name'],
OPERATION FAILED (ABORTED): NO MATCH FOR SEARCH!
--------------------------------------------------------------

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Thu Aug 04, 2011 6:14 pm
by shawtham
The vqmodlog file said it can't find 'name' => $option_value['name'], but when I looked at the vqmod file and product.php, they are there ! I used notepad ++ to search for it, it also can't find it ! It is like I am seeing a ghost ..

Anyone care to explain that ?

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Thu Aug 04, 2011 11:53 pm
by goodday1
shawtham

where did you find vqmod.log please?

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Fri Aug 05, 2011 1:58 am
by Qphoria
be sure your browser isn't caching the downloaded file.. In the newest version there is error="skip" for that line and it shouldn't write that error.
vqmod.log file is found in the vqmod folder

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Fri Aug 05, 2011 2:26 am
by goodday1
qphoria
i promise vqmod.log isnt in there .

i have read the installation instructions again and tried permissions at 777 but when i try

http://www.yourstore.com/vqmod/install

obviously replacing my store info the page cannot be found

when i change permissions to 755 it tells me vqmod is installed.

i have installed vqmod manager and that shows the error log section to be blank

your instructions mention that if vqmod.log isnt being generated it could be a permissions error but i have tried all the options mentioned
will it help me to completely uninstall vqmod and reinstall again ?

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Fri Aug 05, 2011 10:33 am
by shawtham
Greeting Qphoria,

Thanks for the prompt reply. ! :-)

I downloaded the latest update "Disable/Remove out of stock product options", I have checked the vqmod.log and vqcache, the files replacement seems working. However, I still can't get the the option that is out of stock to be grey out or strike off. Is it meant to be like that?

Currently, this test product ( 10 pieces) has option Large 5 pieces, Medium 0 piece and Small 5 pieces. All option and products have been set to Substract Stock. The only time the Out of Stock product option (Medum size) would appear is that when I set the Subtract Stock to be "No". Does that impact the xml script?

For the mean time, I have replaced the "p.status" into "p.status = '1' AND p.quantity > 0" in catalog/model/catalog/product.php,

AND

Disable the Add to Cart button as followed in catalog\view\theme\little\template\product\product.tpl

<?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>

Would this modification also has impact on the xml script ?

Thanks in advance for your help,

Shaw

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Sat Aug 06, 2011 12:04 am
by Qphoria
Im testing this again... looks like 1.5.x automatically hides options when they are out of stock

Re: [vQmod] - Disable/Remove out of stock product options

Posted: Sat Aug 06, 2011 6:46 pm
by shawtham
Yes, something got to do with the controller/product/product.php

Code: Select all

foreach ($option['option_value'] as $option_value) {
			if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
However, programming is not my talent... I just can't get it to work for ($option_value['quantity'] = 0)....