- Posts: 86
- Thank you received: 0
More Products by this artist
$pathway = JRequest::getInt('category_pathway',0);
if(empty($pathway)){
//load products in the same first category
$query = "SELECT category_id FROM ".hikashop::table('product_category').' WHERE product_id='.$product_id.' ORDER BY product_category_id DESC LIMIT 1';
$database->setQuery($query);
$pageInfo->filter->cid = $database->loadResultArray();
}
Please Log in or Create an account to join the conversation.
Maybe the problem lies somewhere else. With some products the artists shows beneath the product category even when the id of the artist is 40 and the id of the product category is 42.
However in the same group I have a product where the artist id is 29 and the product category id 42.
From this product I deleted both the artist and the product category and then added the product category first and the artist second. The artist still shows before the product.
Is this normal or is this the cause of the problem.
Gert.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
1. Delete both categories from the product.
2. Save the product.
3. When I reopen the product the system has added a category product groups.
4. Added the correct product group
5. Save the product
6. Delete the category product groups added by the system in step 3
7. Save the product
8. Add the correct artist category.
9. Save the product.
Now when I reopen the product the artist is still the first category and the product group the second.
Please Log in or Create an account to join the conversation.
Any idea how to solve this?
Gert.
Please Log in or Create an account to join the conversation.
We didn't change anything on that end. Are you sure that you reapplied the modification after the update ?
Please Log in or Create an account to join the conversation.
I think the problem is that for some products I am unable to get the artist as the second category. See my earlier post:
Re: More Products by this artist 3 Days, 5 Hours ago
I did the following:
1. Delete both categories from the product.
2. Save the product.
3. When I reopen the product the system has added a category product groups.
4. Added the correct product group
5. Save the product
6. Delete the category product groups added by the system in step 3
7. Save the product
8. Add the correct artist category.
9. Save the product.
Now when I reopen the product the artist is still the first category and the product group the second.
Please Log in or Create an account to join the conversation.
Each time I add a category to a product, the category gets added with a greater product_category_id.
Now, if you're talking only about the display on the back end, it is indeed ordered on the category_id, but not for your modified query which is based on the product_category_id and thus should not have the problem.
The order on the category listing of the products is done by:
$query = 'SELECT b.* FROM '.hikashop_table('product_category').' AS a LEFT JOIN '.hikashop_table('category').' AS b ON a.category_id=b.category_id WHERE a.product_id = '.$product_id.' ORDER BY b.category_ordering';
and should be:
$query = 'SELECT b.* FROM '.hikashop_table('product_category').' AS a LEFT JOIN '.hikashop_table('category').' AS b ON a.category_id=b.category_id WHERE a.product_id = '.$product_id.' ORDER BY a.product_category_id';
in adminsitrator/components/com_hikashop/views/product/view.html.php o that the categories are always displayed in the order they are added. However, as I said above, that doesn't change the fact that they are in the correct order in the database.
Please Log in or Create an account to join the conversation.
I tested it again after your last message and it's working now.
Must have been a browser cache problem. Thanks for your help.
Gert.
Please Log in or Create an account to join the conversation.
Once more I cheered too early. I still cannot get it to work. I even removed the artist from all products and added them again after saving each product.
Could you please have a look at the site to see what's wrong?
Thanks,
Gert.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
The solution is simple. Just change the line:
if(empty($pathway)){
to:
if(true){
in the same file just before the query you changed.
Please Log in or Create an account to join the conversation.
Yes. Now it really works. Thanks so much!
Gert.
Please Log in or Create an account to join the conversation.
- Posts: 13
- Thank you received: 1
Please Log in or Create an account to join the conversation.