Jump to content

Product Attributes Values change order doesn't work after upgrade from 1.6.0.5 to 1.6.0.6


akumi

Recommended Posts

Just upgraded from 1.6.0.5 to 1.6.0.6 and realised when using the arrow to change the order of product attributes values, it says "update successful" but when you refresh the list, the order goes back again.

 

The funny thing is that this works for product attributes. Which means I can change order of product attribute values like

1. Size

2. Colour

 

to

 

1.Colour

2.Size.

 

But when i change order for product attributes value like

1 Green

2 Blue

 

1Blue

2Green

 

It goes back to Green, Blue. I restored to 1.6.0.5 and it works fine so i can confirm it's something to do with 1.6.0.6. If anyone have any idea, that would be great! Thanks.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...
  • 2 weeks later...

You can also correct it in the updatePosition method of the Attribute class:

 

Replace

		if (!$id_attribute_group = (int)Tools::getValue('id_attribute_group'))
			$id_attribute_group = (int)$this->id_attribute_group;

by

$id_attribute_group = (int)$this->id_attribute_group;

That way, the group id is always right, and the position update process does not fail.

 

 

The Bear

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

I'm having troubles getting this to work on PS 1.6.09.

I have the following code in helperlist.php:

if (isset($this->fields_list['position']))
		{
			if ($this->position_identifier)
				if (isset($this->position_group_identifier))
					$position_group_identifier = Tools::getIsset($this->position_group_identifier) ? Tools::getValue($this->position_group_identifier) : $this->position_group_identifier;
				else
					$position_group_identifier = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category', ($this->is_cms ? '1' : Category::getRootCategory()->id ));
			else
				$position_group_identifier = Category::getRootCategory()->id;

			$positions = array_map(create_function('$elem', 'return (int)($elem[\'position\']);'), $this->_list);
			sort($positions);
		}

Does it require any changes? I see that the getIsset was replaced with getValue already.

Link to comment
Share on other sites

  • 4 weeks later...

Hello everyone,

 

maybe the column called position is necessary. Can you get the error: Unknown column 'position' in 'field list when you try to create a new attribute?
If so, you can fix it with:
ALTER TABLE `ps_attribute_group` ADD `position` TINYINT(3) NOT NULL DEFAULT '1' ;
ALTER TABLE `ps_attribute` ADD `position` TINYINT(3) NOT NULL DEFAULT '1' ;
Link to comment
Share on other sites

  • 2 months later...

You can also correct it in the updatePosition method of the Attribute class:

 

Replace

		if (!$id_attribute_group = (int)Tools::getValue('id_attribute_group'))
			$id_attribute_group = (int)$this->id_attribute_group;

by

$id_attribute_group = (int)$this->id_attribute_group;

That way, the group id is always right, and the position update process does not fail.

 

 

The Bear

where do i find this code pice ? 

Edited by millien (see edit history)
Link to comment
Share on other sites

i upgraded to 1.6.0.9 and have the mobile theme that are not working properly with attributes. 

it's the prestashop standard mobile template from 1.4 , it worked just fine until prestashop 1.6.0.9 :/

 

to se the page in mobile version http://www.nettotobak.com/lossnus/628-phantom-classic-lossnus.html?mobile_theme_ok

Edited by millien (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...