Post by danicmyk » Thu Aug 04, 2011 5:49 pm

I have just solved the issue of setting subtract stock default as no but now i need to set the default quantity for each option to 1000. I have also done this with the main quantity for each product through the controller but it doesn't seem to work for the product options. anyone have a solution?

New member

Posts

Joined
Tue Aug 02, 2011 4:26 pm

Post by danicmyk » Thu Aug 04, 2011 5:58 pm

Nevermind! managed to solve my own problem (was extremely simple too)
Find:

Code: Select all

	html += '    <td class="right"><input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][quantity]" value="" size="3" /></td>'; 
change to:

Code: Select all

	html += '    <td class="right"><input type="text" name="product_option[' + option_row + '][product_option_value][' + option_value_row + '][quantity]" value="1000" size="3" /></td>'; 
simple! hopefully this will come in handy for others with the same issue.

New member

Posts

Joined
Tue Aug 02, 2011 4:26 pm

Post by info@skatenutter.com » Fri Feb 10, 2012 1:20 pm

So where do we get the code?


Posts

Joined
Sat Nov 05, 2011 7:05 am

Post by hellreturn » Sat Jul 28, 2012 10:25 pm

In which file you need to edit above code?

Thanks!

New member

Posts

Joined
Tue May 29, 2012 4:21 am

Post by straightlight » Sun Jul 29, 2012 1:22 am

It looks like the code above needs to be edited from your admin/view/template/catalog/product_form.tpl file. The product option is not being used elsewhere in the admin on anyhow.

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 FloM » Wed Apr 30, 2014 3:30 pm

Hi,

Maybe it's late, or maybe someone is searching for something like this...

To change the default quantity in the "Data" tab of the admin page when inserted a new product:

go to: admin/controller/catalog/product.php

find this:

Code: Select all

if (isset($this->request->post['quantity'])) {
      		$this->data['quantity'] = $this->request->post['quantity'];
    	} elseif (!empty($product_info)) {
      		$this->data['quantity'] = $product_info['quantity'];
    	} else {
			$this->data['quantity'] = 1;
		}
lines 899 - 905

replace line 904

Code: Select all

$this->data['quantity'] = 1;
with

Code: Select all

$this->data['quantity'] = "YOUR VALUE HERE";
Have fun!

Newbie

Posts

Joined
Wed Apr 30, 2014 3:23 pm

Post by rph » Wed Apr 30, 2014 11:49 pm

This is also one of the features of Admin Enhancement Suite.

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

-Ryan


rph
Expert Member

Posts

Joined
Fri Jan 08, 2010 5:05 am
Location - Lincoln, Nebraska
Who is online

Users browsing this forum: Amazon [Bot] and 30 guests