Jump to content

how to change category_shop.position by script?


IgnacioSM
 Share

Recommended Posts

Hello,

 

I'm trying to receive the position of the categories by another software, and then, I have to update the category position, or insert the category.

 

 

how could I insert a category in a position and increment the position of the others if there are some duplicate positions? 

 

 

Ex: I want to insert a new category in position 3, and mofify th$cat = new Category($idClasificacionOnline);

 

 

Code:

$cat-id_parent = $idClasFather;

Category::cleanPositions($idClasFather);

$cat->addPosition(3, $idShop);

 

It eliminates all the duplicates, but it left a category with position 3(obviously) and then, it inserts the new category with position 3. Finally, the result is that there are two categories with position 3.

 

Any idea?

Edited by IgnacioSM (see edit history)

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
 Share

×
×
  • Create New...

Important Information

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