Jump to content
Neo_odessa

Additional Input in _product_line.tpl

Recommended Posts

Hello. Need help with code. Trying to make text Field in product line. In order details.

 

I was modified 2 files.

 

/admin/themes/default/template/controllers/orders/_product_line.tpl 

Code

<span class="product_quantity_edit">
    <input type="text" name="product_quantity_collected" class="edit_product_quantity" value="{$product['product_quantity_collected']|htmlentities}"/>
    <input type="submit" value="Save"/>
</span>

And

/controllers/admin/AdminOrdersController.php 

if (Tools::getValue('product_quantity_collected'))
$product['product_quantity_collected'] = Tools::getValue('product_quantity_collected');

Problem is

1. I can make changes only in last product in list. And it value gives to each product.

2. when Im leaving order details all data dissapearing. And when Ill go to order details next time its empty.

Screen post-872128-0-83349400-1417048666_thumb.jpg

 

Please help me with this.

Edited by Neo_odessa (see edit history)

Share this post


Link to post
Share on other sites

each prduct line must have different <input> field name

otherwise php will always use last one

Share this post


Link to post
Share on other sites

How to use different names for <input> fields? In template I have only 1 line to edit.

 

I`ve deleted 

    <input type="submit" value="Save"/>

And using 

		{* Update controls *}
		<button type="button" class="btn btn-default submitProductChange" style="display: none;">
			<i class="icon-ok"></i>
			{l s='Update'}

To submit value.

 

But after refreshing page all data erasing.

How to save it?

Edited by Neo_odessa (see edit history)

Share this post


Link to post
Share on other sites
On 12/1/2014 at 7:12 AM, Neo_odessa said:

Somebody can help me. Have an idea why data loosing? I hope to find the solution.

 

Hi, did you solve this problem? I'd be interested too

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More