Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Which file controls showing products


thadson

Recommended Posts

Hi all,

Can anyone let me know which file controls showing the 2nd page of the products in any category?

My issue is that if I have more than 20 items in any category (ie: at /index.php/cPath/21_23), when I click on the 2nd page button at the bottom (image 1 attached), the 2nd page comes up empty (at index.php/cPath/21_23/sort/1a/page/2)  (image 2 attached).

Please see attached images.

When I look at page source, the second page stops at lines

<div class="body-sans-header clearfix">

      <div id="bodyContent" class="col-md-8 col-md-push-2">

about line 85-88 everything above this is identical on both pages, but the 2nd page is missing everything underneath it.

 

1stpage.JPG

2ndpage.JPG

Link to comment
Share on other sites

I'd try to turn on error reporting temporary to see if something is throwing an error that you can see.

At includes/application_top,php

find

  error_reporting(E_ALL & ~E_NOTICE);

change it temporary to

  error_reporting(E_ALL);

Reload the page and see if something informs you about any hidden errors, then change application_top values to the original settings.

Link to comment
Share on other sites

I tried to reproduce the problem in your store, but didn't see anything with more than 19 entries (single page). Did you remove some products? You might also reduce the items displayed per page to something that will cause multiple pages. You probably have a PHP error somewhere, which should be logged (e.g., "error_log" file in some directory) unless you've suppressed error messages.

You should have an index file in your site root. Right now anyone going to the site is presented with a list of directories, and they can snoop around. If the shop is your only active subsystem, you could also put an entry in .htaccess to jump a visitor to / over to /shop:

RewriteEngine On
	RewriteCond  %{REQUEST_URI}  !^/shop  [NC]
	RewriteRule  ^(.*)$  http://www.erikoart.com/shop/$1 

This assumes you're on an Apache or compatible server.

Link to comment
Share on other sites

4 hours ago, MrPhil said:

I tried to reproduce the problem in your store, but didn't see anything with more than 19 entries (single page). Did you remove some products? You might also reduce the items displayed per page to something that will cause multiple pages. You probably have a PHP error somewhere, which should be logged (e.g., "error_log" file in some directory) unless you've suppressed error messages.

You should have an index file in your site root. Right now anyone going to the site is presented with a list of directories, and they can snoop around. If the shop is your only active subsystem, you could also put an entry in .htaccess to jump a visitor to / over to /shop:

 


RewriteEngine On
	RewriteCond  %{REQUEST_URI}  !^/shop  [NC]
	RewriteRule  ^(.*)$  http://www.erikoart.com/shop/$1 

 

This assumes you're on an Apache or compatible server.

Please see http://www.collectingbay.com/index.php/cPath/21_31/sort/1a/page/2

Link to comment
Share on other sites

Since the page is ending right in the middle of a <div>, I suspect you've got a fatal PHP error somewhere. There should be error messages logged somewhere on your site (make sure you aren't suppressing them; talk with your host). You should not be able to feed store data to Edge that would blow up PHP code, so unless you modified the code and introduced an error yourself, @burt will need to know what's going on to find the error. Do you have any add-ons installed? This is "Edge" and not "Gold" version of 2.3.4BS?

Link to comment
Share on other sites

Problem is the broken URL rewrites.  If (s)he turns it off, all should work.

If someone else running Gold/Edge with normal URLs could turn on these URLs (admin setting somewhere), and see if it breaks the product new page, that would be helpful.

Link to comment
Share on other sites

Great, thank you Zahid :)  Tested at your site, and yes...all seems to work well with those URLs turned on.

So, @thadson, now you need to turn those URLs OFF, and see if the paging then works, it might; 
http://www.collectingbay.com/index.php?cPath=21_31&page=2

 

Possibly the _GET['sort'] is problematic.  Have you made any changes in that area?

Link to comment
Share on other sites

Having checked your site you have a some addons installed? remove or disable them first and check again. Its not your second page that is the issue! pressing any page on that sub catogory brakes the site! try clicking page one you get same result.

 

Link to comment
Share on other sites

Thank you for all pitching in, I appreciate it.

This s definitely an edge, not gold.

I paid a developer to add SPPC (https://apps.oscommerce.com/fgHfe&separate-pricing-per-customer) add-on, since it is not PHP 7 compatible, as is.

I verified that the error does not exist on the site before the changes, only after SPPC was installed.

The problem is, there are a lot of files in that add-on, and this is why I asked which file could control that part of the website, so I could narrow down where to look for the problem.

 

Link to comment
Share on other sites

2 minutes ago, burt said:

Find your error log, post the errors (if it shows any)..

this is the error in the log:

[18-Apr-2018 12:12:31 America/Chicago] PHP Fatal error:  Uncaught Error: Call to undefined function ereg() in /home/erikoart/public_html/collectingbay.com/index.php:95
Stack trace:
#0 {main}
  thrown in /home/.../collectingbay.com/index.php on line 95

here are the lines around  95 in index:

   // find out if sorting by price has been requested
   if ( (isset($_GET['sort'])) && (ereg('[1-8][ad]', $_GET['sort'])) && (substr($_GET['sort'], 0, 1) <= sizeof($column_list)) && $customer_group_id != '0' ){
    $_sort_col = substr($_GET['sort'], 0 , 1);
    if ($column_list[$_sort_col-1] == 'PRODUCT_LIST_PRICE') {
      $status_need_to_get_prices = true;
      }
   }

where the line starting with if is line 95

Link to comment
Share on other sites

ereg is removed in your current php version. It seems you are using a very outdated add-on

change it to:

preg_match(

but place your regex into delimiters.

So it should look like this:

preg_match('/[1-8][ad]/', $_GET['sort'])

see also:

https://stackoverflow.com/questions/2217850/how-to-replace-ereg

Link to comment
Share on other sites

5 hours ago, raiwa said:

ereg is removed in your current php version. It seems you are using a very outdated add-on

change it to:


preg_match(

but place your regex into delimiters.

So it should look like this:


preg_match('/[1-8][ad]/', $_GET['sort'])

see also:

https://stackoverflow.com/questions/2217850/how-to-replace-ereg

Thank you. This worked.

I have found another one in advanced_search_result.php fixed that too.

Now page shows the items properly.

Link to comment
Share on other sites

Search all your files for ereg, eregi, and other obsolete calls, rather than waiting for something to break. You might find others. Look at discussions on this forum about the migration to PHP 7 and what sort of things were deprecated and needed to be fixed (the "split" call comes to mind). The base osC 2.3.4[.1]BS Edge code ought to be up-to-date, but any add-ons you installed could have these obsolete calls.

Link to comment
Share on other sites

2 hours ago, MrPhil said:

Search all your files for ereg, eregi, and other obsolete calls, rather than waiting for something to break. You might find others. Look at discussions on this forum about the migration to PHP 7 and what sort of things were deprecated and needed to be fixed (the "split" call comes to mind). The base osC 2.3.4[.1]BS Edge code ought to be up-to-date, but any add-ons you installed could have these obsolete calls.

Thank you, I will check for "split", however, I'm really just a beginner when it comes to PHP, so could you list some more old stuff I should look for, and what to change them to? (if you have time of course :-) )

Searching for "migration to PHP 7" on oscommerce forum brings up only the Bootstrap 3 in 2.3.4 - Responsive from the Get Go page, and at first glance, that is not the thread i would look for.

Maybe this "listing obsolete calls and what to change them to for migrating to PHP 7" for old add-ons would deserve it's own topic? People could add their own stuff to it when things come up...

I would appreciate any more suggestions. Thank you again.

 

Link to comment
Share on other sites

Most of this discussion was years ago, so I don't remember all the details. Search this forum for "deprecated", "ereg", and "split". Also go onto php.net and look for their "migration from PHP x to PHP y" pages.

Link to comment
Share on other sites

Any problems that you'll have will likely be the result of having added dated add-ons so you should be able to just test them out and verify whether they work correctly or not. 

Dan

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...