Post by Qphoria » Thu Dec 16, 2010 3:00 am

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.

Attachments

Supports 14x, 15x, 2x

Only needed for 1.4.x since 1.5.x and 2.x already hide out of stock options by default


Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by zeroevil » Sat Dec 25, 2010 12:14 am

You are the man Q this is something I've been looking for too. Thanks alot !!!!!

I recently moved to the island formally owned by Dr. Moreau and currently live there lost in a ocean of computer code with my cat Nigel... help us!!!


User avatar
New member

Posts

Joined
Thu Nov 25, 2010 2:05 am

Post by steadynow » Sat Jan 29, 2011 12:06 pm

Thanks for this Q, a million thanks!

Newbie

Posts

Joined
Sat Jan 29, 2011 5:52 am

Post by chadelkins » Fri Jul 29, 2011 1:55 am

Q: is there a 1.5 solution to this same problem? Or will this work on 1.5?

Newbie

Posts

Joined
Thu Jul 28, 2011 9:16 pm

Post by Qphoria » Fri Jul 29, 2011 3:09 am

Updated to work on 1.4.x and 1.5.x

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by shawtham » Mon Aug 01, 2011 6:33 pm

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".

Newbie

Posts

Joined
Fri Jul 22, 2011 10:29 pm

Post by shawtham » Wed Aug 03, 2011 5:22 am

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

Newbie

Posts

Joined
Fri Jul 22, 2011 10:29 pm

Post by goodday1 » Thu Aug 04, 2011 3:03 am

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.

Newbie

Posts

Joined
Fri Jul 22, 2011 8:52 pm

Post by Qphoria » Thu Aug 04, 2011 3:29 am

what does the vqmod.log show?

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by goodday1 » Thu Aug 04, 2011 4:01 am

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

Newbie

Posts

Joined
Fri Jul 22, 2011 8:52 pm

Post by goodday1 » Thu Aug 04, 2011 4:06 pm

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

Newbie

Posts

Joined
Fri Jul 22, 2011 8:52 pm

Post by goodday1 » Thu Aug 04, 2011 4:08 pm

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

Newbie

Posts

Joined
Fri Jul 22, 2011 8:52 pm

Post by shawtham » Thu Aug 04, 2011 5:39 pm

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

Newbie

Posts

Joined
Fri Jul 22, 2011 10:29 pm

Post by shawtham » Thu Aug 04, 2011 6:14 pm

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 ?

Newbie

Posts

Joined
Fri Jul 22, 2011 10:29 pm

Post by goodday1 » Thu Aug 04, 2011 11:53 pm

shawtham

where did you find vqmod.log please?

Newbie

Posts

Joined
Fri Jul 22, 2011 8:52 pm

Post by Qphoria » Fri Aug 05, 2011 1:58 am

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

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by goodday1 » Fri Aug 05, 2011 2:26 am

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 ?

Newbie

Posts

Joined
Fri Jul 22, 2011 8:52 pm

Post by shawtham » Fri Aug 05, 2011 10:33 am

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

Newbie

Posts

Joined
Fri Jul 22, 2011 10:29 pm

Post by Qphoria » Sat Aug 06, 2011 12:04 am

Im testing this again... looks like 1.5.x automatically hides options when they are out of stock

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by shawtham » Sat Aug 06, 2011 6:46 pm

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)....

Newbie

Posts

Joined
Fri Jul 22, 2011 10:29 pm
Who is online

Users browsing this forum: No registered users and 2 guests