Change Category list to products

  • Posts: 110
  • Thank you received: 0
13 years 8 months ago #11268

Hello and help

Where I originally had a category list on my main navigation, I now need to change this to a product list.

I thought I had done the right thing,

Attachments:

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

  • Posts: 110
  • Thank you received: 0
13 years 8 months ago #11269

However, my listing now looks like this:

Completely disappeared. Please is there something I am missing?

Attachments:
Last edit: 13 years 8 months ago by deborahharrison.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #11284

Do you have products attached to the category "product category" ?
If not, it's normal that it doesn't display anything.
If you want to display all the products including the ones which are in sub categories of that category, you need to change the option "Sub elements filter" to "all sub elements" instead of "direct sub elements".

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

  • Posts: 110
  • Thank you received: 0
13 years 8 months ago #11291

Hi Nicolas

I think she means all the books regardless of what category they are in. A listing of the books on the site at the moment.

I have tried product listing, but by choosing that is when I get the blank screen.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 8 months ago #11304

If you want to display all the products including the ones which are in sub categories of that category, you need to change the option "Sub elements filter" to "all sub elements" instead of "direct sub elements" in the hikashop options of your menu.

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

  • Posts: 110
  • Thank you received: 0
13 years 7 months ago #12121

Hi Nicolas

I have tried with this. I have changed the setup on my menu link

Attachments:

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

  • Posts: 110
  • Thank you received: 0
13 years 7 months ago #12122

Forget that it does work but no images show up. I am assuming one of the many pages under Display > Views needs to be tweaked. Please advise which one?

Attachments:
Last edit: 13 years 7 months ago by deborahharrison.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12124

The display of images will depend of the item box layout option you have in the hikashop options of your menu

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

  • Posts: 110
  • Thank you received: 0
13 years 7 months ago #12285

I have done that and it works. Is there a way I can also list which category each book comes under?

212.113.133.235/~englishr/index.php?opti...ut=listing&Itemid=53 is what I have at the moment

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12289

Could you do a screenshot of your listing menu's hikashop options ? That's hard to answer without understanding how you're displaying the listing.

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

  • Posts: 110
  • Thank you received: 0
13 years 7 months ago #12296

Content Menu View:

Attachments:

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

  • Posts: 110
  • Thank you received: 0
13 years 7 months ago #12298

And the View > listings > Listing_title:

Hope this helps.

Attachments:

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12306

I see. Actually, that information is not loaded on that page. You would have to run a mysql query on the product_category and category tables to load the category data before being able to display it:

$db=& JFactory::getDBO();
$db->setQuery('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 = '.$this->row->product_id );
$category = $db->loadObject();
echo $category->category_name;

Last edit: 13 years 7 months ago by nicolas.

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

  • Posts: 110
  • Thank you received: 0
13 years 7 months ago #12396

From adding that code, I get a :

Error

There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem

ERROR: Unknown Punctuation String @ 4
STR: =&
SQL: $db=& JFactory::getDBO();$db=& JFactory::getDBO();$db=& JFactory::getDBO();$db=& JFactory::getDBO();$db=& JFactory::getDBO();


SQL query:

$db=& JFactory::getDBO();

MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$db=& JFactory::getDBO()' at line 1


I have the following info about my server:

* Server: Localhost via UNIX socket
* Server version: 5.0.92-community-log
* Protocol version: 10
* User: ???????
* MySQL charset: UTF-8 Unicode (utf8)

Web server

* cpsrvd 11.28.87
* MySQL client version: 5.0.92
* PHP extension: mysql

PHP My admin

Version information: 3.3.9.2

Please advise.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12428

Please make sure that the code you write is the exact same as the one I posted and make sure that you put it in the file listing_img_title of the view product in a php block of code.

We tested the code on our end and it's working fine.

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

  • Posts: 110
  • Thank you received: 0
13 years 7 months ago #12486

I promise you I did copy what you put and I got that message. I shall try again as you have since edited it.

Once I have, can I just clarify its then a case of adding the PHP code in the listing file.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 7 months ago #12489

I just put the syntax coloration to make sure that there was no typo on my end and that the quotes were fine.

I'm not sure what you did but I just did it for you on your website since the access you gave us was still working: 212.113.133.235/~englishr/administrator/...ct|listing_title.php

Now the category name is written on the listing: 212.113.133.235/~englishr/index.php?opti...ut=listing&Itemid=53

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

  • Posts: 110
  • Thank you received: 0
13 years 7 months ago #12514

Thank you very much for that Nicolas :kiss:

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

Time to create page: 0.095 seconds
Powered by Kunena Forum