- Posts: 107
- Thank you received: 0
category_left, category_right, category_depth
- cobinet_edv
-
Topic Author
- Offline
I set data in the table cn_hikashop_category self.
It works.
But I set no data for fileds category_left, category_right, category_depth
So I have no tree for categories left up.
I want that Hikashop recalculate my imported data, that fileds category_left, category_right, category_depth filled.
Is it possible?
Thanks
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- cobinet_edv
-
Topic Author
- Offline
- Posts: 107
- Thank you received: 0
and how can I the script execute?
In joomla? On the shell?
What is a simple way?
Thanks
Please Log in or Create an account to join the conversation.
PS: do not post the same message on several threads.
Please Log in or Create an account to join the conversation.
- cobinet_edv
-
Topic Author
- Offline
- Posts: 107
- Thank you received: 0
Another way?
Please Log in or Create an account to join the conversation.
extensions.joomla.org/extensions/core-en...code-in-content/5051
Please Log in or Create an account to join the conversation.
- cobinet_edv
-
Topic Author
- Offline
- Posts: 107
- Thank you received: 0
It does'nt work.
No errors
One Idea?
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
- cobinet_edv
-
Topic Author
- Offline
- Posts: 107
- Thank you received: 0
I set my code as first - Echo "Anfang"; and last - Echo "Ende";
I see "Anfang" as output but not "Ende"
I set Echo $database; after $database =& JFactory::getDBO(); but I see nothing.
I think "& JFactory::getDBO()" does'nt work
With fake categorie does'nt work too
Please Log in or Create an account to join the conversation.
if you don't see the "ende" text, it means that there is an error in the code you have.
Please Log in or Create an account to join the conversation.
- cobinet_edv
-
Topic Author
- Offline
- Posts: 107
- Thank you received: 0
echo "Anfang";
$database =& JFactory::getDBO();
$categoryClass = hikashop::get('class.category');
$query = 'SELECT category_left,category_right,category_depth,category_id,category_parent_id FROM '.hikashop::table('category').' ORDER BY category_left ASC';
$database->setQuery($query);
$categories = $database->loadObjectList();
$root = null;
$categoryClass->categories = array();
foreach($categories as $cat){
$categoryClass->categories[$cat->category_parent_id][]=$cat;
echo $cat->categoriy_parent_id;
if(empty($cat->category_parent_id)){
$root = $cat;
}
}
$categoryClass->rebuildTree($root,0,1);
echo "Erfolg!";
I copied code from internet
Please Log in or Create an account to join the conversation.
Do you have the category_parent_id properly set for each of your categories ?
Please Log in or Create an account to join the conversation.
- cobinet_edv
-
Topic Author
- Offline
- Posts: 107
- Thank you received: 0
That does'nt work with one single category, that I in Hikashop Menu set
Please Log in or Create an account to join the conversation.
- cobinet_edv
-
Topic Author
- Offline
- Posts: 107
- Thank you received: 0
I have it
It is not fine solution, but it works
I have inserted the code in category/lising.php
It works
Please Log in or Create an account to join the conversation.