Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Store's home page setup


Recommended Posts

I'm upgrading a production store from v2.2rc2a to v2.3.1.


I've installed v2.3.1 on a test server and it runs. I backedup the prduction database, made the requried database changes and pointed the test installation to this updated copy of the production database. No changes have yet been made to the store's PHP code. I can see products, customers etc. So things are reasonable.


However, I'm having a real problem with the initial catalog page i.e. <store>/index.php


1. Why does this page say "New Products For January"?


What determines if a product is "new"?


( I can't see anything in the Admin panel under categories/products that seem to indicate new products. All the dates added are from Jan. 2011.)



2. While I can always comment out the "New Products...." header, I'm having a problem getting all the products to display. The display currently shows 4 rows of 3 columns. This is fine, exceptI have 14 products (total).


Under Admin -> Configuration -> Product Listings


I see this option:


>>>Location of Prev/Next Navigation Bar (1-top, 2-bottom, 3-both)


I've tried all 3 optionss and I don't get any navigation buttons. So the shopper can't see all the products as they only have access to one page.



3. If I set the value for:


Admin -> Configuration -> Maximum Values -> New Product Module


to say 18, then I do see all currently available products.


However, I would like to be able to limit this display to say 2 rows and have navigation buttons to see the additional products.


How do I do that?



4. Last question. Note this description:



Admin -> Configuration -> Maximum Values -> New Product Module


In the "module" category of the Admin panel, I don't see anything for "New Product". Should I?



Bottom line, what I would like to achieve is to have a store that has a home page that shows all products in a 3 column layout in 2 or 3 rows and when I have more than 6 or 9 products, I would like navigation buttons to allow the user to see the other products.


I don't need any concept of "new products" or "special" priced products. Under Admin Configuration Max Values, I've set "special products" and "products expected" to "0", but when I set "new products module" to "0", no products display on the home page.



Anyone have any ideal of what I need to do to at least get started on fixing these problems?






(Note, if one checks the documentation.pdf for v2.3.1, in Administration Tool (Backend) -> Configuration -> Maximum Values, there is nothing that explains the differenece between these two options "New Products Module" and "New Product Listing". While there is an explanation of the latter, it does not make clear what the difference is.)

Link to comment
Share on other sites

I don't have access to a clean 2.3.1 at the moment but when browsing through the moduleoptions did you see the button in the top right corner to install modules?

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile


Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.


For links mentioned in old answers that are no longer here follow this link Useful Threads.


If this post was useful, click the Like This button over there ======>>>>>.

Link to comment
Share on other sites

Yes, I did. I went through all the modules and everything looked reasonable.


I was just studying the code and I think I know where my problem is. My store has one category with all products listed under that category.


In application_top.php, at line 203, there is this code:



// calculate category path

if (isset($HTTP_GET_VARS['cPath'])) {

$cPath = $HTTP_GET_VARS['cPath'];

} else {

$cPath = '';




for me $cPath is set to an empty string. Should that be?



This means, in index.php, the execution falls pass the 'if' at line 19 (or so):


>> if (isset($cPath) && tep_not_null($cPath)) {

$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");


And execution never hits this code at approx line 240 (still index.php):




execution goes directly to line 266:





I guess this is why when I set max new products to 0, I see nothing on the home page.




I'm wondering if v2.3.1's home page will display products for a store that has only one category? (This was not a problem in v.2.2rc2a.) Or I have something configured wrong.




Link to comment
Share on other sites

1. New products are not really new "for january". This is simply a list of the last added/modified products.


2. "product listings" are those in categories. The front page is not considered a category.


3. Without extra coding, you cannot. I am unsure if anyone has yet made an addon that can achieve this.


4. The "new product" module is the one that shows the products in the "new product for 'month'" area on the front page. The answer therefore is "no".


Bottom line; there might be an addon for pagination of the new products module. If not, make one, or get one made.

Link to comment
Share on other sites

G - thank you for this clarification.


So, just to be clear, (1) the default behavior of the store is _not_ to show any products on the home page if the max value for new products is 0?


One other question.


(2) What controls the order of the display of new products? It seems to be random. Not ordered by either name or price.

Link to comment
Share on other sites

Did the home page functionality change between v2.2rc2a and v2.3.1?


My first store used v2.2x and I had the store customized by another programmer. That store listed all products and from the home page the visitor could add a product to the shopping cart. Did it work this way because of customizations the prior programmer made, or did the native behavior of the home page change between v2.2. and v2.3?


Anyway, I don't see any way to add a product directly to the cart from the home page. Can this be done?



Link to comment
Share on other sites

RESOLVED: I now (almost) have the behavior that I want. Namely the store's home page shows all the products with a "buy now" button as the store default when user goes to:


<my domain>/<store>/


All that is required is to go to this block of code in <store>/includes/application_top.php (approx line 435):


// calculate category path

if (isset($HTTP_GET_VARS['cPath'])) {

$cPath = $HTTP_GET_VARS['cPath'];

} elseif (isset($HTTP_GET_VARS['products_id']) && !isset($HTTP_GET_VARS['manufacturers_id'])) {

$cPath = tep_get_product_path($HTTP_GET_VARS['products_id']);

} else {

$cPath = '22';




Set the value of $cPath after the last else to the value of the category that has the products you want to display. (In our case, that's the '22', your value will be different).


How do you know what value to set? There are several ways. Since I had my store's admin panel open, I went to:


Catalog -> Categories/Products


and doubled click to open the category in the right pane to reveal the products. In the browser's address bar you'll see the value of "cPath" set. Use the value in the above code.

Link to comment
Share on other sites

Actually, yes and no.


"Yes" in the sense that the prior programmer changed the initialization of the $cPath variable from an empty string to another value.


But "no" in the sense they did not need to make any other modifications to the PHP or HTML code.


See my above post starting with "RESOLVED" as to how this is done.

Link to comment
Share on other sites

OK. Yes and no.


The new products module between 2.2 and 2.3.1 barely changed (and certainly did not change in terms of information display). If you previoiusly had a buy button for each product in the new products module, then it was a feature added on top of the native oscommerce code.


The block of code you posted with the instruction to change the $cPath variable adds the category to the index page - it does not add buy buttons (unless you have made another change to show them, or I am mistaken (which is very easily possible lol)).

Link to comment
Share on other sites

I think I really confused issues. What I was trying to get to was a home page that was like my v2.2 home page (that the prior developer had set up). So what I was asking was, did the logic of how $cPath and $category_depth change in index.php since I could not figure out how to show just a listing of all of our products.


Since I didn't know how to do this, I thought I had to modify new_products.php when all I had to do was initialize the $cPath variable. Once I did that, I was back in business. Now I see all products. I have navigation buttons if there are more products. And I have a buy now button for each product.


Life is good.

Link to comment
Share on other sites


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

  • Create New...