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.
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
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!!!
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".
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".
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
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
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
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
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!
--------------------------------------------------------------
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!
--------------------------------------------------------------
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 ?
Anyone care to explain that ?
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 ?
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 ?
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
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
Yes, something got to do with the controller/product/product.php
However, programming is not my talent... I just can't get it to work for ($option_value['quantity'] = 0)....
Code: Select all
foreach ($option['option_value'] as $option_value) {
if (!$option_value['subtract'] || ($option_value['quantity'] > 0)) {
Who is online
Users browsing this forum: No registered users and 41 guests