Issues when listing brands products (SQL ERROR)

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #98596

Hello! I am new to HikaShop and I love it :lol:

However I have encountered an issue.
I have a page where I list products in two categories: Make Up and Skincare. This used to work great but when I decided to add a list of brands hell broke loose.

This URL is used for displaying single products
mypage.org/products/smink/product/9-makeuptest-2
As I said this used to work great.

But then I added a Joomla module to add a list of brands with the type Hikashop Content Module. Each menu items lead to a page which displays the products in that brand category. This also works great... BUT, when I publish this module all the urls to my single product view stops working with this error:
0 - SQL=SELECT category_id FROM jypxd_hikashop_product_category WHERE product_id=9 OR product_parent_id=9

The URL that worked earlier mypage.org/products/smink/product/9-makeuptest-2 does not work anymore. If I enter a brand in the brand menu the products in that brands are listed as they should but then again when I click them:
0 - SQL=SELECT category_id FROM jypxd_hikashop_product_category WHERE product_id=2 OR product_parent_id=2

The module I've created to display brands have completely messed up all my products listning.

Here is an image of the Hikashop options for the Brand module



Here is the Hikashop Display -> Content Menus -> Brands listing



Anyone can tell me what is going on here?


I tried to turn SEF urls off in Joomla with no luck.

Last edit: 12 years 1 month ago by grittafu.

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #98597

Also these are the URLS in the brand listning

Category product view(this one works)
mypage.org/component/hikashop/category/18-maybelline?Itemid=104

Category product view -> Single product view(this one does not work)
mypage.org/component/hikashop/product/2-brown-lashes?Itemid=104
This link above works IF I unpublish the Brand listning module.

Last edit: 12 years 1 month ago by grittafu.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #98638

Hi,

Can you enable the Joomla debug mode, and set the error reporting to maximum to have more informations about this error ?

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #98650

Xavier wrote: Hi,

Can you enable the Joomla debug mode, and set the error reporting to maximum to have more informations about this error ?


Yes sir, right away, sir.

This error is generated when I click on a product in the product listning.


SQL=SELECT category_id FROM jypxd_hikashop_product_category WHERE product_id=9 OR product_parent_id=9

Call stack
# Function Location
1 JSite->render() /storage/content/62/112162/mypage.org/public_html/joomla/index.php:58
2 JDocumentHTML->render() /storage/content/62/112162/mypage.org/public_html/joomla/includes/application.php:279
3 JDocumentHTML->_renderTemplate() /storage/content/62/112162/mypage.org/public_html/joomla/libraries/joomla/document/html/html.php:462
4 JDocumentHTML->getBuffer() /storage/content/62/112162/mypage.org/public_html/joomla/libraries/joomla/document/html/html.php:682
5 JDocumentRendererModules->render() /storage/content/62/112162/mypage.org/public_html/joomla/libraries/joomla/document/html/html.php:399
6 JDocumentRendererModule->render() /storage/content/62/112162/mypage.org/public_html/joomla/libraries/joomla/document/html/renderer/modules.php:39
7 JModuleHelper::renderModule() /storage/content/62/112162/mypage.org/public_html/joomla/libraries/joomla/document/html/renderer/module.php:107
8 include() /storage/content/62/112162/mypage.org/public_html/joomla/libraries/legacy/module/helper.php:176
9 hikashop_getLayout() /storage/content/62/112162/mypage.org/public_html/joomla/modules/mod_hikashop/mod_hikashop.php:48
10 CategoryViewCategory->display() /storage/content/62/112162/mypage.org/public_html/joomla/administrator/components/com_hikashop/helpers/helper.php:667
11 CategoryViewCategory->listing() /storage/content/62/112162/mypage.org/public_html/joomla/components/com_hikashop/views/category/view.html.php:22
12 JDatabaseDriver->loadColumn() /storage/content/62/112162/mypage.org/public_html/joomla/components/com_hikashop/views/category/view.html.php:109
13 JDatabaseDriverMysql->execute() /storage/content/62/112162/mypage.org/public_html/joomla/libraries/joomla/database/driver.php:1069

Last edit: 12 years 1 month ago by grittafu.

Please Log in or Create an account to join the conversation.

  • Posts: 83831
  • Thank you received: 13572
  • MODERATOR
12 years 1 month ago #98665

Hi,

Please replace the line:

$query = 'SELECT category_id FROM '.hikashop_table('product_category').' WHERE product_id='.$product_id.' OR product_parent_id='.$product_id;
with the line:
$query = 'SELECT category_id FROM '.hikashop_table('product_category').' WHERE product_id='.$product_id;
in the file components/com_hikashop/views/category/view.html.php and that will fix the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #98695

nicolas wrote: Hi,

Please replace the line:

$query = 'SELECT category_id FROM '.hikashop_table('product_category').' WHERE product_id='.$product_id.' OR product_parent_id='.$product_id;
with the line:
$query = 'SELECT category_id FROM '.hikashop_table('product_category').' WHERE product_id='.$product_id;
in the file components/com_hikashop/views/category/view.html.php and that will fix the problem.


It did. In order to learn more I have to ask why the OR statement messed up the page?



Am also wondering why my "Category listing" module dissappear when I enter a category listing.
mypage.org/joomla/component/hikashop/cat...aybelline?Itemid=104
I understand I need to specify where to show the Hikashop module and I have done so.

The Hikashop Content Module that present the menu's have these menu assignments

Categories listing
Products listing
User control panel
Registration form
Brands listing

Also Products and all the childs.
I think because the URL is /components/hikashop/.../ I cant specify that the Hikashop Module should be visible there.

And is it possible to change the URL? /components/hikashop/category/...../ is one big url. Why not
mypage.org/products/category/maybelline-18 instead?

Last edit: 12 years 1 month ago by grittafu.

Please Log in or Create an account to join the conversation.

  • Posts: 83831
  • Thank you received: 13572
  • MODERATOR
12 years 1 month ago #98828

Hi,

That OR statement was wrong which is why it messed up the page.

The component/hikashop part of the URL is converted by joomla's sef into the alias of the current menu item when possible.
If you see component/hikashop, it means that the current menu item is not a Hikashop type of menu item and thus joomla cannot replace it.
In short, it means that in the "menu" option of your module, you need to select a correct hikashop category listing menu item and it will then use the alias of that menu.

Actually, your issue with the module "disappearing" is probably linked to that. Since you selected a menu which is not a HikaShop menu, when the user click on a link of the module, it goes on a menu where the module is not assigned and thus the module is not displayed.

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #99230

nicolas wrote: Hi,
The component/hikashop part of the URL is converted by joomla's sef into the alias of the current menu item when possible.
If you see component/hikashop, it means that the current menu item is not a Hikashop type of menu item and thus joomla cannot replace it.
In short, it means that in the "menu" option of your module, you need to select a correct hikashop category listing menu item and it will then use the alias of that menu.


Ok. So I added a menu item to my main menu as "Hikashop Product listning" and pointed the Hikashop Module at it. Now the URL looks good
mypage.org/produkter/varumarke/category/listing/18-maybelline
Also the products in that category are listed properly. But still the Brand menu to the left are missing inside this page :dry:

If I go to the tab "Modules Assignment for this menu Item" the module "Products Brands" which list the brands to the left is set to "Yes".


The menu is visibile in mypage.org/produkter/varumarke/ but not mypage.org/produkter/varumarke/category/*

Last edit: 12 years 1 month ago by grittafu.

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #99234

The Prooduct Brand module is type "Hikashop content module". Note that another module in that same position with type "Custom html" is visible.

Please Log in or Create an account to join the conversation.

  • Posts: 83831
  • Thank you received: 13572
  • MODERATOR
12 years 1 month ago #99459

Mmm. I checked the link you sent but I didn't see any module disappear.

Actually, it's quite hard to say anything else without more information on how you setup your module (screenshot of the joomla and hikashop options) and a link to the page with the module.

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #99461

nicolas wrote: Mmm. I checked the link you sent but I didn't see any module disappear.

Actually, it's quite hard to say anything else without more information on how you setup your module (screenshot of the joomla and hikashop options) and a link to the page with the module.


I published the modules again... bringing screens in 5 minutes. The link I sent you should now display the module.

Last edit: 12 years 1 month ago by grittafu.

Please Log in or Create an account to join the conversation.

  • Posts: 83831
  • Thank you received: 13572
  • MODERATOR
12 years 1 month ago #99463

I checked the link and looking at it, it sounds that you turned on the "synchronize with content" option of the module and because of that is always tries to display the sub brands of the current brand, which is why you don't get anything when you click on a link.
Turn that option off in the module and that will work.

The following user(s) said Thank You: grittafu

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #99465

nicolas wrote: I checked the link and looking at it, it sounds that you turned on the "synchronize with content" option of the module and because of that is always tries to display the sub brands of the current brand, which is why you don't get anything when you click on a link.
Turn that option off in the module and that will work.


Hey, thank you!

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #99466

I have another question while were at it. I need an alternative layout for the product listning inside the manufacturers menu. Is this possible with Hika?

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #99469

So I figured out how to make overrides for listing_img_* and then they appear in the "Type of item layout". But how do I override the listing_div?

Please Log in or Create an account to join the conversation.

  • Posts: 83831
  • Thank you received: 13572
  • MODERATOR
12 years 1 month ago #99500

You can also edit it via the menu Display->Views.
You will have to add a condition based on the current category to display differently the listing_div file .

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #99538

nicolas wrote: You can also edit it via the menu Display->Views.
You will have to add a condition based on the current category to display differently the listing_div file .


Yeah, I created my listing_div2. I do not quite understand how to make this condition. Why are there so little documentation about this?

Please Log in or Create an account to join the conversation.

  • Posts: 83831
  • Thank you received: 13572
  • MODERATOR
12 years 1 month ago #100059

Because that is a code customization and thus to make code customization you need to know how to code and if you know how to code you should be able to find that out by yourself by searching a bit. Please understand that we provide support on how to configure HikaShop and that we cannot realistically teach everyone how to program.
If you need to customize the code and you don't know how, I invite you to find a third party developer to help you on that. You can do that via our commercial jobs forum or joomlancers.com
Such small customization should be doable for a relatively small price.

Please Log in or Create an account to join the conversation.

  • Posts: 12
  • Thank you received: 0
12 years 1 month ago #100060

I have experience with PHP programming and I've been doing so for several years. But I am surpised why the options for alternatives layout are so low in HikaShop.

Please Log in or Create an account to join the conversation.

  • Posts: 83831
  • Thank you received: 13572
  • MODERATOR
12 years 1 month ago #100079

We are happy to add more of them if anyone wants to share theirs. Remember that this is an open source initiative so everyone's code is welcome :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.370 seconds
Powered by Kunena Forum