Jump to content

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)
Link to comment
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)
Link to comment
Share on other sites

  • 5 years later...

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