Jump to content

Help ! - I have somehow broken my Front Office on my test domain


Recommended Posts

Hi guys

 

I was implementing Vekia's post (http://mypresta.eu/en/art/developer/product-page-visits-counter.html) and it was working fine except for the fact that the visit counter numbers were incorrect.

 

I decided to have a play around with the query that he was using in the FrontController and now when I start the Front Office, I get nothing, just a blank white screen in the browser.

 

I have cleared the cache via the back office and the browser cache, I have also removed the changes that I made to the SQL code but I can't get the Front Office to work again...

 

What else can I do????

 

Thanks for your help

 

Regards

Greg

Edited by lateral (see edit history)
Link to comment
Share on other sites

Thanks Vekia,

 

I decided to restore from a backup and I'm know up and running again.

 

If this happens again, I'll try your suggestions.

 

Have you had time to look and fix the query that you use to get the number of Product Pages views:

 

public static function getTotalViewed($id_product){
$view1 = Db::getInstance()->getRow('SELECT pv.counter AS total FROM '._DB_PREFIX_.'page_viewed pv
LEFT JOIN '._DB_PREFIX_.'page p ON pv.id_page = p.id_page
LEFT JOIN '._DB_PREFIX_.'page_type pt ON p.id_page_type = pt.id_page_type
WHERE pt.name = \'product\' AND p.`id_object` = '.intval($id_product).'');
return isset($view1['total']) ? $view1['total'] : 0;
}

 

As always,

Thanks for your help

 

Regards

Greg

Link to comment
Share on other sites

Hi Vekia,

 

I am already using everything as descrivbed in your post: (http://mypresta.eu/e...ts-counter.html)

 

including the following:

 

{FrontController::getTotalViewed(Tools::getValue('id_product'))}

 

If I look at the table that contains the page views there are lots of records and when I manually sum them for a specific product ID and compare the total to what is being displayed in the Front Office, they are not the same. The front office is always much much less.

 

I also went into the MYSQL admin and ran the following query (I got it from a comment on your post) to see what it showed:

 

SELECT pv.counter AS total FROM ps_page_viewed pv
LEFT JOIN ps_page p ON pv.id_page = p.id_page
LEFT JOIN ps_page_type pt ON p.id_page_type = pt.id_page_type
WHERE pt.name = 'product' AND p.id_object = 446

 

I also looked at the Stats section in the Back office and compared the total with the same Product ID and it also differed significantly from the Front Office.

 

I'm not sure what records are actually contained in the ps_page_viewed table but all I want is a total of ALL page views for each product to be displayed...

 

Is it possible to provide me with a different query similar to the one shown above for me to try?

 

Regards

Greg

Link to comment
Share on other sites

Hi again Vekia,

 

I'm trying to figure out what is actually happening with the calculation of the number of pages views and the data that's actually recorded in the page_viewed table but am not finding anything that means much to me (remember that I am a newbie :)).

 

When I run the following query and I look at ID = 23, I see a total of 1131. When I look in the Stats (Back office) I see a "Total Viewed" = 77 ( have set the date range Start=2012-08-01, end = 2015-02-01. When I look at the total that is displayed on the Front Office, I see a total = 2. My guess is that the 77 is probable closer to the correct number. I had a look at Google Analytics and did some rough calculations and the pageviews is very close to 77......

 

SELECT id_page,  (SUM(counter)) AS Total

FROM ps_page_viewed

GROUP BY id_page

Link to comment
Share on other sites

  • 1 month later...
  • 3 years later...
On 31/01/2015 at 12:33 AM, vekia said:

hello

turn on error reporting then instead of blank page you will see where the error is.

 

in addition, to rebuild controllers remove cache/class_index.php file

prestashop will rebuild with first page refresh

Hi, I have a similar problem - blank front office.

 

I tried updating to 1.7.4 from 1.7.3.3 and the update failed halfway so I'm trying to restore the back-up.

 

Back office is seemingly fine - so I assume my db is fine.

 

When I turn on error reporting the front office remains blank.

'cache/class_index.php' is now deprecated in 1.7 - is there a current alternative?

 

Surely this should be fixable? I'd rather not have to re-install the whole thing.

 

Thanks for any help

 

Andy

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...