Post by seachen » Thu Jan 13, 2011 1:24 am

every times i add product option, i need to set Subtract Stock: No .

may i know how to make it always No.

New member

Posts

Joined
Mon Oct 25, 2010 8:15 pm

Post by Qphoria » Thu Jan 13, 2011 1:28 am

1. EDIT: admin/view/template/catalog/product_form.tpl

2. FIND:

Code: Select all

<?php if ($product_option_value['subtract']) { ?>
3. REPLACE WITH:

Code: Select all

<?php if (!$product_option_value['subtract']) { ?>
But beware that it will always show NO even if you once set it to YES.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by seachen » Thu Jan 13, 2011 2:35 am

Okie. Thanks a lot.

New member

Posts

Joined
Mon Oct 25, 2010 8:15 pm

Post by seachen » Thu Jan 13, 2011 2:46 am

Hi,

I have edit the code to as below:

<?php if (!$product_option_value['subtract']) { ?>

but it remain "Yes"

Attachments

FireShot capture #321 - 'Products' - www_stepup_com_my_admin_index_php_route=catalog_product_insert&token=c826811d13b1f39a957f95f95dd5ad3c.png

FireShot capture #321 - 'Products' - www_stepup_com_my_admin_index_php_route=catalog_product_insert&token=c826811d13b1f39a957f95f95dd5ad3c.png (81.19 KiB) Viewed 4052 times


New member

Posts

Joined
Mon Oct 25, 2010 8:15 pm

Post by Vynl » Tue Jul 26, 2011 10:38 pm

Hi, Did you ever get to the bottom of this?

Newbie

Posts

Joined
Sat Jun 04, 2011 12:11 am

Post by Qphoria » Tue Jul 26, 2011 11:16 pm

That is for existing options.. You also need to change the other one for the dynamic option adding:

Find:

Code: Select all

    html += '<option value="1"><?php echo $text_yes; ?></option>';
    html += '<option value="0"><?php echo $text_no; ?></option>';
Flip the 2 around:

Code: Select all

    html += '<option value="0"><?php echo $text_no; ?></option>';
    html += '<option value="1"><?php echo $text_yes; ?></option>';

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by amnesiac84 » Mon Jan 09, 2012 11:47 am

Can anyone help to set to always yes?

I have around 2,000 items and going one by one is insane.

Thanks

Newbie

Posts

Joined
Wed Dec 14, 2011 7:59 am

Post by straightlight » Mon Jan 09, 2012 12:02 pm

Just revert this process: http://forum.opencart.com/viewtopic.php ... 54#p178149 and it should always display as yes instead of no. However, if you did already applied the step above and you did already save the data from the form by setting one or multiple options to no and you're looking for to put them all back to yes option, I would suggest to make a backup of your database and to query all the no option into yes option from PHPMyAdmin to buy some time rather than editing the options one-by-one due to 2000 quantity of items.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by amnesiac84 » Mon Jan 09, 2012 12:28 pm

Well i have uploaded all of my items with CSV import pro tool, but all of them are set to stock subtract=no
So what i need to do is set them all to yes, i don't quite understand what to reverse, from the code i see just a ! symbol added.

I'm fairly new to this and my store is both spanish and english so a little step by step will be greatly appreciated.

Thanks for the help, this is a nice cart with good support from the community.

Newbie

Posts

Joined
Wed Dec 14, 2011 7:59 am

Post by amnesiac84 » Mon Jan 09, 2012 12:31 pm

This is what i find when i search my code:

<td><?php echo $entry_subtract; ?></td>
<td><select name="product_option[<?php echo $option_row; ?>][product_option_value][<?php echo $option_value_row; ?>][subtract]">
<?php if ($product_option_value['subtract']) { ?>
<option value="1" selected="selected"><?php echo $text_yes; ?></option>
<option value="0"><?php echo $text_no; ?></option>
<?php } else { ?>
<option value="1"><?php echo $text_yes; ?></option>
<option value="0" selected="selected"><?php echo $text_no; ?></option>
<?php } ?>
</select></td>
</tr>

Newbie

Posts

Joined
Wed Dec 14, 2011 7:59 am

Post by straightlight » Mon Jan 09, 2012 12:33 pm

Since CSV Import Pro is a contribution, you should rather ask the author for any future importation you'd like to make on how to set the subtract option to yes instead of no by default straight from the module. ;)

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by haydent » Tue Jan 17, 2012 4:30 pm

Qphoria wrote:That is for existing options.. You also need to change the other one for the dynamic option adding:

Find:

Code: Select all

    html += '<option value="1"><?php echo $text_yes; ?></option>';
    html += '<option value="0"><?php echo $text_no; ?></option>';
Flip the 2 around:

Code: Select all

    html += '<option value="0"><?php echo $text_no; ?></option>';
    html += '<option value="1"><?php echo $text_yes; ?></option>';

just for notes i found this at line 939 of admin/view/template/catalog/product_form.tpl in 1.5.1.3

to change existing ones just use phpmyadmin sql command

User avatar
Active Member

Posts

Joined
Wed Nov 09, 2011 9:50 am
Location - Sydney, Australia

Post by straightlight » Tue Jan 17, 2012 10:43 pm

to change existing ones just use phpmyadmin sql command
Or use this free tool to make the update: http://www.opencart.com/index.php?route ... order=DESC

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 203 guests