X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Any way to Move a Root Category (& Sub Categories) to a Sub Category? (https://forum.x-cart.com/showthread.php?t=70574)

s4tnav 11-20-2014 06:39 PM

Any way to Move a Root Category (& Sub Categories) to a Sub Category?
 
Hi Everyone,

Just wondering how (or if it's possible) to Move a Root Category (& Sub categories under it) to a Sub Category.

IE:

Currently:
-Category 1
--Sub 1
--Sub 2
-Category 2

Proposed:
-Category 2
--Category 1
---Sub 1
---Sub 2


Thanks in Advance! :)

tony_sologubov 11-24-2014 05:16 AM

Re: Any way to Move a Root Category (& Sub Categories) to a Sub Category?
 
Hi!

Sorry, but there is no way to move categories in X-Cart 5 at the moment. You can create new category structure and then remove old ones in order to achieve needed result.

Tony.

s4tnav 11-24-2014 05:41 PM

Re: Any way to Move a Root Category (& Sub Categories) to a Sub Category?
 
Added my idea to an existing idea
http://ideas.x-cart.com/forums/229428-x-cart-5-x/suggestions/4860287-move-category

tony_sologubov 11-25-2014 06:15 AM

Re: Any way to Move a Root Category (& Sub Categories) to a Sub Category?
 
Thank you!

qualiteam 11-25-2014 07:16 AM

Re: Any way to Move a Root Category (& Sub Categories) to a Sub Category?
 
Hi,

If you OK with doing some hacks, this may help you.

NOTE: these hacks may crash your website. So, please CREATE A BACKUP of your site and TRY THE HACKS ON A LOCAL COPY of your website before uploading changes to your "live" server.

1. Use PHPMyAdmin or the MySQL console and search the xc_categories table for the category where you want to move other categories into. Remember its id.

2. In the xc_categories table, update categories which you want to move and set their parent_id to the id of the category from the 1st step.

3. Create and run (from the SSH console, or from your browser) the following script from the directory where X-Cart is installed:

Code:

<?php
require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'top.inc.php');

\XLite\Core\Database::getRepo('XLite\Model\Category')->correctCategoriesStructure();


s4tnav 02-18-2015 04:58 PM

Re: Any way to Move a Root Category (& Sub Categories) to a Sub Category?
 
Works a Treat!
Thank you!


All times are GMT -8. The time now is 09:24 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.