Jump to content

Categries on frontpage (like last products)


Guest

Recommended Posts

Hello,

I'm wondering if I can put the categories on the frontpage, the way latest products are displayed centered bud then with thumbs of the categorie displayed? I'm using killer skin.

Looked everywhere.

Thanks,

Loua

Link to comment
Share on other sites

Hello,

To put the categories on the frontpage I did the following.

In ../yourroot/includes/content/index.inc.php look for this line:

$latestProducts = $db->select("SELECT productId, image, price, name, sale_price FROM ".$glob['dbprefix']."CubeCart_inventory WHERE `showFeatured` = 1 ORDER BY productId DESC LIMIT ".$config['noLatestProds']);

####

Change that query for this one:

$latestProducts = $db->select("SELECT cat_id, cat_image, cat_name FROM ".$glob['dbprefix']."CubeCart_category ORDER BY cat_id DESC ");

####

Now look for:

if(($val = prodAltLang($latestProducts[$i]['productId'])) == TRUE){

####

Change "productId" field for "cat_id" like this:

if(($val = prodAltLang($latestProducts[$i]['cat_id'])) == TRUE){

####

Now look for:

$latestProducts[$i]['name'] = $val['name'];

####

Change the "name" field for "cat_name":

$latestProducts[$i]['cat_name'] = $val['cat_name'];

####

Look for:

if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$latestProducts[$i]['image'])){

$index->assign("VAL_IMG_SRC",$GLOBALS['rootRel']."images/uploads/thumbs/thumb_".$latestProducts[$i]['image']);

####

Change "image" field:

if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$latestProducts[$i]['cat_image'])){

$index->assign("VAL_IMG_SRC",$GLOBALS['rootRel']."images/uploads/thumbs/thumb_".$latestProducts[$i]['cat_image']);

####

Look for "productId" field in the rest of de script and change that for "cat_id".

Change "name" for "cat_name".

Go to ../yourroot/skins\Killer\styleTemplates\content

And in index.tpl change both links:

<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}">

####

For:

<a href="index.php?act=viewCat&amp;catId={VAL_PRODUCT_ID}">

Maybee you want to change some layout stuff here aswell.

Thats it!

Speak to you later <_<

Link to comment
Share on other sites

That is a very quick hack which sneeks the category information in place of latest products information. It should work well and fast and easy.

Note, I am also working on cats on homepage right now, and will leave the latest prods coding alone in my version. That way, you can either have both on the homepage, or you can turn latest prods off in ACP and have categories only <_<

Link to comment
Share on other sites

  • 2 weeks later...

Hello!

I made the changes suggested here but have a few problems. The categories are shown in the frontpage but with very small pictures and the link is not working.

my webpage is www.precioestrella.com/tiendamayorista

I'd appreciate your help (anybody's help!!!)

Anopther thing is: what if I also want to have my latest products shown? isn't there a way to put the categories in the front page without subtituting all the codes for the latest products.

Thanks to all in advance

Link to comment
Share on other sites

  • 10 months later...

Hello,

To put the categories on the frontpage I did the following.

In ../yourroot/includes/content/index.inc.php look for this line:

$latestProducts = $db->select("SELECT productId, image, price, name, sale_price FROM ".$glob['dbprefix']."CubeCart_inventory WHERE `showFeatured` = 1 ORDER BY productId DESC LIMIT ".$config['noLatestProds']);

####

Change that query for this one:

$latestProducts = $db->select("SELECT cat_id, cat_image, cat_name FROM ".$glob['dbprefix']."CubeCart_category ORDER BY cat_id DESC ");

####

Now look for:

if(($val = prodAltLang($latestProducts[$i]['productId'])) == TRUE){

####

Change "productId" field for "cat_id" like this:

if(($val = prodAltLang($latestProducts[$i]['cat_id'])) == TRUE){

####

Now look for:

$latestProducts[$i]['name'] = $val['name'];

####

Change the "name" field for "cat_name":

$latestProducts[$i]['cat_name'] = $val['cat_name'];

####

Look for:

if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$latestProducts[$i]['image'])){

$index->assign("VAL_IMG_SRC",$GLOBALS['rootRel']."images/uploads/thumbs/thumb_".$latestProducts[$i]['image']);

####

Change "image" field:

if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$latestProducts[$i]['cat_image'])){

$index->assign("VAL_IMG_SRC",$GLOBALS['rootRel']."images/uploads/thumbs/thumb_".$latestProducts[$i]['cat_image']);

####

Look for "productId" field in the rest of de script and change that for "cat_id".

Change "name" for "cat_name".

Go to ../yourroot/skins\Killer\styleTemplates\content

And in index.tpl change both links:

<a href="index.php?act=viewProd&amp;productId={VAL_PRODUCT_ID}">

####

For:

<a href="index.php?act=viewCat&amp;catId={VAL_PRODUCT_ID}">

Maybee you want to change some layout stuff here aswell.

Thats it!

Speak to you later :(

Hello,

To put the categories on the frontpage I did the following.

In ../yourroot/includes/content/index.inc.php look for this line:

$latestProducts = $db->select("SELECT productId, image, price, name, sale_price FROM ".$glob['dbprefix']."CubeCart_inventory WHERE `showFeatured` = 1 ORDER BY productId DESC LIMIT ".$config['noLatestProds']);

####

Change that query for this one:

$latestProducts = $db->select("SELECT cat_id, cat_image, cat_name FROM ".$glob['dbprefix']."CubeCart_category ORDER BY cat_id DESC ");

####

Now look for:

if(($val = prodAltLang($latestProducts[$i]['productId'])) == TRUE){

####

Change "productId" field for "cat_id" like this:

if(($val = prodAltLang($latestProducts[$i]['cat_id'])) == TRUE){

####

Now look for:

$latestProducts[$i]['name'] = $val['name'];

####

Change the "name" field for "cat_name":

$latestProducts[$i]['cat_name'] = $val['cat_name'];

####

Look for:

if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$latestProducts[$i]['image'])){

$index->assign("VAL_IMG_SRC",$GLOBALS['rootRel']."images/uploads/thumbs/thumb_".$latestProducts[$i]['image']);

####

Change "image" field:

if(file_exists($GLOBALS['rootDir']."/images/uploads/thumbs/thumb_".$latestProducts[$i]['cat_image'])){

$index->assign("VAL_IMG_SRC",$GLOBALS['rootRel']."images/uploads/thumbs/thumb_".$latestProducts[$i]['cat_image']);

####

Look for "productId" field in the rest of de script and change that for "cat_id".

Change "name" for "cat_name".

Go to ../yourroot/skins\Killer\styleTemplates\content

And in index.tpl change both links:

<a href="index.php?act=viewProd&productId={VAL_PRODUCT_ID}">

####

For:

<a href="index.php?act=viewCat&catId={VAL_PRODUCT_ID}">

Maybee you want to change some layout stuff here aswell.

Thats it!

Speak to you later :)

I tried this but nothing happened. I am using 3.0.13 and was wondering if that would make a difference. I am very new at this but I have been able so to change my header and would love to show my cats on the home page instead of the latest products. My url is educationtoystation.com

Thanks, rey1

Link to comment
Share on other sites

Hi, sorry for posting another question before help with the first but I was on a roll! I just realized that my homepage is showing my cats after I made the change but the text in the box is still Latest Products, so I don't know how to change this! Also when I add a cat. and a product in the cat. and I click on the cat. It gives me a "that product can not be found". I am so lost.

Thanks for any help,

rey1

Link to comment
Share on other sites

  • 3 weeks later...
Guest stmack89

Welcome to the forum, rey1 :)

You are posting to a thread from December 2005. The latest free mod for this is fully featured, PM sent. ;)

I need help with this as well. Please see my site ...

glowshark.net

I did everything instructed. :on2long: When you click it sends you to a different link than the cat. home. How can I make it so that it sends me to the homepage for the category? How can I change "Latest Products" title? Also, would it be possible to add a small description under the picture and make the picture larger?

Thanks! :D

Link to comment
Share on other sites

LOL :on2long: no problems, will send PM to you too.

This old code was a very limited first attempt by loua, but I do not suggest that anyone use it. The most recent free mod for this allows use of both latest products and categories on front page, and is configurable in admin control panel, in other words truly integrated and properly coded for CubeCart . . . if anyone needs this just send me a pm

Link to comment
Share on other sites

  • 6 months later...

hi markscarts,

can u send me pm for this mods... thanks

LOL no problems, will send PM to you too.

This old code was a very limited first attempt by loua, but I do not suggest that anyone use it. The most recent free mod for this allows use of both latest products and categories on front page, and is configurable in admin control panel, in other words truly integrated and properly coded for CubeCart . . . if anyone needs this just send me a pm

Link to comment
Share on other sites

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...