Jump to content

'There are no products' message?


Guest mattski

Recommended Posts

Hi,

When viewing my product categories I see the ones I have configured but I also see a 'There are no products in this department' dialogue (I edited the language file btw). Have you got any idea what could be causing this as the category does have products or sub-categories defined. Could it be the sales stuff?

thanks,

Matt

Link to comment
Share on other sites

Guest melchior

Hello,

Find: 'no_prods_in_cat' => "There are no products in this category.",

in your lang.inc.php file and you can alter the quoted text as you like. Worked for me.

Be shure to leave 'no_prods_in_cat' => as it is.

Regards

Peter Melchior

Link to comment
Share on other sites

Hi,

When viewing my product categories I see the ones I have configured but I also see a 'There are no products in this department' dialogue (I edited the language file btw). Have you got any idea what could be causing this as the category does have products or sub-categories defined. Could it be the sales stuff?

thanks,

Matt

I'm not sure I understand exactly what you mean.... But if your saying that the message is showing up in some categories even when that category isn't empty, thats because this text will always show up when the category contains no products, regardless of whether the category contains subcategories.

Personally i modified my cart so that if there are:

- no products, but some subcategories, no text will be displayed

- no products and no subcategories, the text "sorry, this category is empty" will be displayed.

Link to comment
Share on other sites

I modified it to say to look in the sub category or Mfg entrys

be nice to have your hack tho estelle why not post what you did to make it not show if not porudcts but there were subcats and to make it show if no subcats and no products

be a cool hack to share with folks

Link to comment
Share on other sites

K. I even added a message for if the category is not found.

Open includes/content/viewCat.inc.php. Replace this block:

} else {

	

	$view_cat->assign("TXT_NO_PRODUCTS",$lang['front']['viewCat']['no_prods_in_cat']);



	$view_cat->parse("view_cat.noProducts");



}


With this block (leave the mispelled subCategoroies as is!!):


} else if(isset($_GET['catId']) && $_GET['catId']>0 && $subCategoroies == TRUE) {



	// Estelle - if no products, but there were subcats, then no need to display anything else



} else if(isset($currentCat[0]['cat_name'])) {

	

	// Estelle - if no products and no subcats, display category empty message

	$view_cat->assign("TXT_NO_PRODUCTS",$lang['front']['viewCat']['cat_is_empty']);

	$view_cat->parse("view_cat.noProducts");



} else {

	

	// Estelle - if no category, display category not found message

	$view_cat->assign("TXT_NO_PRODUCTS",$lang['front']['viewCat']['cat_not_found']);

	$view_cat->parse("view_cat.noProducts");



}




Open your lang.inc.php. Find this line:


'no_prods_in_cat' => "There are no products in this category.",


Add these lines below it:


'cat_is_empty' => "This category is empty.",



'cat_not_found' => "Sorry, that category code could not be found.",

Cheers!

Link to comment
Share on other sites

Guest melchior

Hi melchior

It is nice that the first post of someone is to help someone and not for a question 

Welome aboard 

:D Thanks. I'm using CC 3.0.3. for selling my stuf, and also for taking a crashcourse in PHP. :D

And the forum gives a lot of answers (which I sure had ) when installing and starting CC.

I think it is a very easely to manage shop, compared to the others I took a look at. Pretty compehensive.

The only little disadvantage it has IMHO is when you are managing products, (Show products) there is a very limited number of pages (3) to select from shown at the bottom, I should like to have at least 25 pages in a row.

Regards,

Peter Melchior

Link to comment
Share on other sites

Guest estelle

In admin/products/index.php on line 327 it calls the function $db->paginate(...). This function is located in classes/db.inc.php on line 101, function paginate(...). It appears the number of previous and next pages are set on line 131:

   $upper_limit = $pageNum + 3;

   $lower_limit = $pageNum - 3;


BUT: Be aware that this is the exact same function that is used for customers viewing your shop. So if you only change line 131/132, you will be affecting not only the admin view, but also the front end view (of category listings, search results, etc).



BTW: if you wanted to change the number of products shown per page, for Admin View Products only, this is hardcoded in admin/products/index.php on line 49:


$productsPerPage = 25;

Link to comment
Share on other sites

Guest melchior

Hi Estelle,

Thanks. I figured out shortly after asking to alter the figures in db.inc.php

Took me a while to find the proper PHP file.

If visitors have the same options when viewing products I don't mind, maybe by seeing more they buy more :)

Regards,

Peter Melchior

Link to comment
Share on other sites

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