Jump to content

Archived

This topic is now archived and is closed to further replies.

Guest

Categries on frontpage (like last products)

Recommended Posts

Guest

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

Share this post


Link to post
Share on other sites

Guest vrakas

Moved, here you will get a better chance of reply :lol:

Share this post


Link to post
Share on other sites
Guest

Hi,

yeah thanks for changing, bud don't think its better of here tho.

Changed the query's in index.inc, and some output parameters working fine now thanks anyway.

Share this post


Link to post
Share on other sites
Guest aikdo

Can you give a detailed explianation of what you did to get the results for others who also wish to do this...

Share this post


Link to post
Share on other sites
Guest

Hi, yes i'm planning to put it on here for others.

I do it ASAP.

:)

Share this post


Link to post
Share on other sites
Guest

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 <_<

Share this post


Link to post
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 <_<

Share this post


Link to post
Share on other sites
Guest vrakas

Thanks Loua,

very good job done :w00t:

I have added this here for other users that seek this solution to find. <_<

Share this post


Link to post
Share on other sites
Guest

Sure,

Hopefully it's usefull for someone else.

Later :P

L

Share this post


Link to post
Share on other sites
Guest

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

Share this post


Link to post
Share on other sites
Guest aikdo

There is a way to do this correctly, contact me Via PM for more details and i can sort you out with the mod ;)

Share this post


Link to post
Share on other sites
Guest rey1

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

Share this post


Link to post
Share on other sites
Guest rey1

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

Share this post


Link to post
Share on other sites

Welcome to the forum, rey1 :wacko:

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
Guest

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

Share this post


Link to post
Share on other sites

Id like to use this mod also but I want ALL the categories to display, so that means subcategories also, not just master cats.

Can this be done??

Share this post


Link to post
Share on other sites

×
×
  • Create New...