Styling "select" state for menu items (categories)

  • Posts: 38
  • Thank you received: 0
13 years 1 week ago #30209

ok, works for the checkout/cart page (meaning no select state shown) but still getting an unwanted select state when returning to the shop page.

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

  • Posts: 38
  • Thank you received: 0
13 years 1 week ago #30210

ok, works for the checkout/cart page (meaning no select state shown). Does nicely show category after selecting product from checkout page (nice!)

However, still getting an unwanted select state when returning to the main shop page (Category view page, none selected).


Edited - Actually, the wrong category (last category) is showing after selecting product from checkout page

Last edit: 13 years 1 week ago by sdebaun. Reason: mistaken regarding product from checkout page

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
13 years 1 week ago #30246

Unfortunately, these are a lot more complex to handle as you would have to do mysql queries to load the information: the category of the current product being displayed, or the default category of the current product/category listing.

You would actually have the same problem if you had 1 menu item per category displayed by joomla with a joomla menu module.

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

  • Posts: 38
  • Thank you received: 0
13 years 1 week ago #30255

Yes. Thanks for all the efforts, I know you've spent a bunch of time on this already.


I think my best option would be a combination of the edits you have already given me and some css. At this point that's what I'm implementing, my only problem I have is that my default shop page is showing the previously selected category state! There must be some way to clear this, and only set it if selecting a category or product.


I'm trying to figure how to pass another variable to my templates index.php page to stick to the body tags class.

something like:
<?php
$menu =& JSite::getMenu();
$active = $menu->getActive();
$params = $menu->getParams( $active->id );
$class = $params->get( 'pageclass_sfx' );
?>

<body id ="<?php echo $class ? htmlspecialchars($class) : ''; ?>" class="my_category">


I can hard code the css to work based on that. Not sure which variable exist and how to grab them though, I figure it's possible with the already generated variables being used by hikashop. I guess I would need to globalize it though?

My categories are unlikely to change, so if my shop page had <body id="shop" >and category pages/item pages were like <body id = "shop" class = "mycategory">
it would be doable to set the category menu based on that.

...

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
13 years 1 week ago #30289

There is already a unique id which is set around the category listing. That is done with the line:
<div id="<?php echo $this->params->get('main_div_name');?>" class="hikashop_category_information hikashop_categories_listing_main">

in the file "listing" of the view "category" of the front end. Is that what you're talking about ?

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

  • Posts: 38
  • Thank you received: 0
13 years 1 week ago #30362

I'll look into it, thanks

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

  • Posts: 38
  • Thank you received: 0
12 years 10 months ago #34734

Do you have the final listing_list.php (category) ready? I saw it was not included in the latest version of the shop.
And the above attachment listing_list-20111116 is not complete right?


COBIZ webdevelopment | www.cobiz.nl

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

  • Posts: 82910
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #34799

The latest version is in the current release and it already includes all these changes.

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

Time to create page: 0.082 seconds
Powered by Kunena Forum