Post by theo » Sun Sep 25, 2011 6:25 pm

Hiya, as most are aware, there is a lot of psychology in the way a page is set out and I was wondering, without effecting the category list on the left of the page if there is a way of placing the buttons in the grey bar across the top (on default template) in an order you want them, to be able to change it when you find out what customers are searching for more often but keeping them as categories, so on my site for example, BCD's, Dive Computers, Dry Suits, PADI Materials, Regulators, Wet Suits www.wavecrestscuba.com/shop/ should be in the order of :

Dive Computers, Regulators, BCD's, Wet Suits, Dry Suits, Regulators as I believe they are the ones that are searched for more often (in order of)

New member

Posts

Joined
Thu Sep 22, 2011 3:35 pm

Post by uksitebuilder » Sun Sep 25, 2011 6:26 pm

simply set a sort order in the sort field when editing the categories

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by theo » Sun Sep 25, 2011 6:31 pm

I tried that but it also affects the category listing on the left side

New member

Posts

Joined
Thu Sep 22, 2011 3:35 pm

Post by uksitebuilder » Sun Sep 25, 2011 6:45 pm

How would you like the left categories ordered ?

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by theo » Sun Sep 25, 2011 7:18 pm

Left alphabetically on the left side it is just the top that needs changing

New member

Posts

Joined
Thu Sep 22, 2011 3:35 pm

Post by uksitebuilder » Sun Sep 25, 2011 7:31 pm

Try the following

open: catalog/model/catalog/category.php

find

Code: Select all

	public function getCategories($parent_id = 0) {
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_description cd ON (c.category_id = cd.category_id) LEFT JOIN " . DB_PREFIX . "category_to_store c2s ON (c.category_id = c2s.category_id) WHERE c.parent_id = '" . (int)$parent_id . "' AND cd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND c2s.store_id = '" . (int)$this->config->get('config_store_id') . "'  AND c.status = '1' ORDER BY c.sort_order, LCASE(cd.name)");
		
		return $query->rows;
	}
change to

Code: Select all

	public function getCategories($parent_id = 0, $topm=NULL) {
		$sorttop = (!is_null($topm)?'c.sort_order, ':'');
		
		$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "category c LEFT JOIN " . DB_PREFIX . "category_description cd ON (c.category_id = cd.category_id) LEFT JOIN " . DB_PREFIX . "category_to_store c2s ON (c.category_id = c2s.category_id) WHERE c.parent_id = '" . (int)$parent_id . "' AND cd.language_id = '" . (int)$this->config->get('config_language_id') . "' AND c2s.store_id = '" . (int)$this->config->get('config_store_id') . "'  AND c.status = '1' ORDER BY ".$sorttop."LCASE(cd.name)");
		
		return $query->rows;
	}
open: catalog/controller/common/header.php

find

Code: Select all

$categories = $this->model_catalog_category->getCategories(0);
change to

Code: Select all

$categories = $this->model_catalog_category->getCategories(0,1);

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by theo » Sun Sep 25, 2011 7:44 pm

All I'm going to say is WOW that was fast, will implement it and let you know how it gets on, Thanks uksitebuilder once again you show how much of a credit you are to this community.


edit*

Almost, I now have BCD's, Dive Computers, Dry Suits, PADI Materials, Regulators, Wet Suits and it hasn't altered the category listing at all which is awesome.

Ideally it should be as I listed it above in the other post, but to have control over this function would be better, then if it needed changing as the hits on each category of items was known then it could be updated to match the psychology of the visitors.

New member

Posts

Joined
Thu Sep 22, 2011 3:35 pm

Post by theo » Sun Sep 25, 2011 8:01 pm

My mistake, I thought it changed but it hasn't, still in same order which is the one I didn't want, but you did code that really fast. I think I hadn't refreshed my shop page after I tried putting a sort number onto them in the category backend.

My bag, it has changed when I enter a sort order, but I tried to add fins and that isn't showing, as I previously said it is the ability to change that menu set that would benefit everyone.

New member

Posts

Joined
Thu Sep 22, 2011 3:35 pm

Post by theo » Mon Sep 26, 2011 6:52 pm

Simon Have you had any thoughts on why it is not allowing new entries into the menu bar after the changes?

New member

Posts

Joined
Thu Sep 22, 2011 3:35 pm

Post by uksitebuilder » Mon Sep 26, 2011 7:20 pm

Are you adding Fins to the top menu ?

ImageImageImageImageImage

For Friendly Professional Support - Click Here


User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by theo » Mon Sep 26, 2011 7:58 pm

Did try to but it didn't allow it, is the code you gave me locking the number of options or should it still allow ones to be added and/or changed around as customer hits on viewed and purchased items is learned?

New member

Posts

Joined
Thu Sep 22, 2011 3:35 pm

Post by theo » Mon Oct 03, 2011 9:32 am

Hi, Simon or anyone else, after the changes Simon guided me to make to this, which allowed the order to be changed on the top menu bar, I still don't have the ability to change this around, or add to it, anyone got any ideas please?

New member

Posts

Joined
Thu Sep 22, 2011 3:35 pm

Post by labeshops » Mon Oct 03, 2011 10:32 am

I've been manually coding most of my top menu buttons as I'm finding that's a lot easier to control for multistores than using the top setting for the category (I reuse some categories among my multiple stores, but not always in the same order).

You can edit template/common/header.php and towards the bottom of the file you will see the categories section. Just remove the auto generated call and put in your links manually.

Running Opencart v2.2 with multi-stores from http://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by theo » Mon Oct 03, 2011 5:05 pm

Thanks labelshops will have a look and see what I can do.


Have had a look and not sure if this is the correct file (slowly learning a little php) but I have found a template.php file with menu section in shop/catalog/controller/ but don't see anything for a .php in the location you suggested, there is a .tpl file in a similair folder location though.

Would you mind giving me an example of coding it manually as php is new to me, Thanks.

New member

Posts

Joined
Thu Sep 22, 2011 3:35 pm

Post by labeshops » Mon Oct 03, 2011 8:25 pm

The template is the file I edit. catalog/view/theme/yourtheme/template/common/header.tpl

Here is my hand coding for http://www.cosplaycostumecloset.com which has some child categories hand coded as well as the main menu bar. It replaces the menu div. I use seo so your links may look different if you don't have seo enabled.

The only down side is if you add a category to your store, you have to remember to manually add it in, but for me at least, I set up my categories early on and then am just adding products so adding categories after the initial coding is few and far between.

Code: Select all

<div id="menu">
  <ul>
    <li><a href="/halloween-costumes-cosplay-costume">All Costumes</a></li>
	<li><a href="/adult-woman-halloween-costumes">Womens</a>
		<div>
		<ul>
		<li><a href="/adult-woman-halloween-costumes">All Womens Costumes</a></li>
		<li><a href="/index.php?route=product/search&filter_category_id=267&filter_tag=Plus_Size">Womens Plus Size</a></li>
		<li><a href="/womens-costume-shoes-boots">Womens Shoes & Boots</a></li>
		</ul>
	    </div>
	    </li>
	<li><a href="/adult-mens-halloween-costumes">Mens</a>
			<div>
		<ul>
		<li><a href="/adult-mens-halloween-costumes">All Mens Costumes</a></li>
		<li><a href="/index.php?route=product/search&filter_category_id=268&filter_tag=Plus_Size">Mens Plus Size</a></li>
		<li><a href="/mens-costume-shoes-boots">Mens Shoes & Boots</a></li>
		</ul>
	    </div>
	    </li>
	<li><a href="/baby-toddler-halloween-costumes">Babies</a></li>
	<li><a href="/kids-halloween-costumes">Kids</a>
		<div>
		<ul>
		<li><a href="/kids-halloween-costumes">Kids Costumes</a></li>
		<li><a href="/kids-shoes-boots-costume-shoes">Kids Shoes & Boots</a></li>
		</ul>
	    </div>
	    </li>
	<li><a href="/teen-halloween-costumes">Teens</a></li>
	<li><a href="/pet-halloween-costumes">Pets</a></li>
    <li><a href="/costume-accessories">Accessories</a>
		<div>
		<ul>
		<li><a href="/kids-shoes-boots-costume-shoes">Kids Shoes & Boots</a></li>
		<li><a href="/womens-costume-shoes-boots">Womens Shoes & Boots</a></li>
		<li><a href="/mens-costume-shoes-boots">Mens Shoes & Boots</a></li>
		<li><a href="/coats-wraps-womens-clothing">Boas & Wraps</a></li>
		<li><a href="/gloves-opera-gloves">Gloves & Armwarmers</a></li>
		<li><a href="/petticoat-hoop-skirt-slip">Petticoats & Hoop Skirts</a></li>
		<li><a href="/costume-accessories/wings-for-costumes">Costume Wings</a></li>
		<li><a href="/feather-masquerade-mardi-gras-masks">Feather Masks</a></li>
		<li><a href="/costume-accessories/feather-headdresses">Feather Headdresses</a></li>
		<li><a href="/pantyhose-stockings-garters/kids-size-tights">Kids Hosiery</a></li>		
		</ul>
	    </div>
	    </li>
    <li><a href="/halloween-decor-party-supplies">Party Supplies</a></li>
	<li><a href="/index.php?route=product/special">Clearance</a></li>
	<li><a href="http://halloweencosplay.wordpress.com/">Ideas</a></li>
  </ul>
</div>

Running Opencart v2.2 with multi-stores from http://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by fabema » Thu Nov 01, 2012 7:42 pm

labeshops wrote:The template is the file I edit. catalog/view/theme/yourtheme/template/common/header.tpl

Here is my hand coding for http://www.cosplaycostumecloset.com which has some child categories hand coded as well as the main menu bar. It replaces the menu div. I use seo so your links may look different if you don't have seo enabled.

The only down side is if you add a category to your store, you have to remember to manually add it in, but for me at least, I set up my categories early on and then am just adding products so adding categories after the initial coding is few and far between.

Code: Select all

<div id="menu">
  <ul>
    <li><a href="/halloween-costumes-cosplay-costume">All Costumes</a></li>
	<li><a href="/adult-woman-halloween-costumes">Womens</a>
		<div>
		<ul>
		<li><a href="/adult-woman-halloween-costumes">All Womens Costumes</a></li>
		<li><a href="/index.php?route=product/search&filter_category_id=267&filter_tag=Plus_Size">Womens Plus Size</a></li>
		<li><a href="/womens-costume-shoes-boots">Womens Shoes & Boots</a></li>
		</ul>
	    </div>
	    </li>
	<li><a href="/adult-mens-halloween-costumes">Mens</a>
			<div>
		<ul>
		<li><a href="/adult-mens-halloween-costumes">All Mens Costumes</a></li>
		<li><a href="/index.php?route=product/search&filter_category_id=268&filter_tag=Plus_Size">Mens Plus Size</a></li>
		<li><a href="/mens-costume-shoes-boots">Mens Shoes & Boots</a></li>
		</ul>
	    </div>
	    </li>
	<li><a href="/baby-toddler-halloween-costumes">Babies</a></li>
	<li><a href="/kids-halloween-costumes">Kids</a>
		<div>
		<ul>
		<li><a href="/kids-halloween-costumes">Kids Costumes</a></li>
		<li><a href="/kids-shoes-boots-costume-shoes">Kids Shoes & Boots</a></li>
		</ul>
	    </div>
	    </li>
	<li><a href="/teen-halloween-costumes">Teens</a></li>
	<li><a href="/pet-halloween-costumes">Pets</a></li>
    <li><a href="/costume-accessories">Accessories</a>
		<div>
		<ul>
		<li><a href="/kids-shoes-boots-costume-shoes">Kids Shoes & Boots</a></li>
		<li><a href="/womens-costume-shoes-boots">Womens Shoes & Boots</a></li>
		<li><a href="/mens-costume-shoes-boots">Mens Shoes & Boots</a></li>
		<li><a href="/coats-wraps-womens-clothing">Boas & Wraps</a></li>
		<li><a href="/gloves-opera-gloves">Gloves & Armwarmers</a></li>
		<li><a href="/petticoat-hoop-skirt-slip">Petticoats & Hoop Skirts</a></li>
		<li><a href="/costume-accessories/wings-for-costumes">Costume Wings</a></li>
		<li><a href="/feather-masquerade-mardi-gras-masks">Feather Masks</a></li>
		<li><a href="/costume-accessories/feather-headdresses">Feather Headdresses</a></li>
		<li><a href="/pantyhose-stockings-garters/kids-size-tights">Kids Hosiery</a></li>		
		</ul>
	    </div>
	    </li>
    <li><a href="/halloween-decor-party-supplies">Party Supplies</a></li>
	<li><a href="/index.php?route=product/special">Clearance</a></li>
	<li><a href="http://halloweencosplay.wordpress.com/">Ideas</a></li>
  </ul>
</div>
You add this code after something or you delete all the header.tpl file and add this?

Produse naturiste, produse bio si cosmetice naturale
la http://www.sanolife.ro


New member

Posts

Joined
Thu Oct 18, 2012 11:05 pm
Who is online

Users browsing this forum: No registered users and 57 guests