Jump to content

Edit History

ricardopxl

ricardopxl


More context.

Update 2024 to PS 1.7

The problem is created when you work directly in db, and don't run all the process with the currents controllers. If you have problem with your breadcrumb, but your assoc category (ps_category_product) and id_category_default is correctly (ps_product,ps_product_shop)

The correct and full fix's to update the nleft and nright:

 

Create this file in 

public_html/process/[hidden_folder_name]/regenerate_lf_category.php

 

Excecute only from terminal

php public_html/process/[hidden_folder_name]/regenerate_lf_category.php

<?php 

if (php_sapi_name() !== 'cli') { # Only CLI
    die("Error.");
}

require('../../config/config.inc.php');

ini_set('memory_limit',-1);
set_time_limit(0);

$sql = 'UPDATE '._DB_PREFIX_.'_category SET nleft = 0, nright = 0 WHERE 1';
Db::getInstance()->execute($sql);

$regenerate = Category::regenerateEntireNtree();

echo "INIT: ".date('Y-m-d H:i:s');
echo "\n\n";
print_r($regenerate);
echo "END: ".date('Y-m-d H:i:s');
echo "\n\n";
die("END:13");
ricardopxl

ricardopxl


More context.

Update 2024 to PS 1.7

The problem is created when you work directly in db, and don't run all the process with the currents controllers. If you have problem with your breadcrumb, but your assoc category (ps_category_product) and id_category_default is correctly (ps_product,ps_product_shop)

The correct and full fix's to update the nleft and nright:

 

Create this file in 

public_html/process/[hidden_folder_name]/regenerate_lf_category.php

 

Excecute only from terminal

php public_html/process/[hidden_folder_name]/regenerate_lf_category.php

<?php 

if (php_sapi_name() !== 'cli') { # Este script solo puede ser ejecutado desde la línea de comandos
    die("Error.");
}

require('../../config/config.inc.php');

ini_set('memory_limit',-1);
set_time_limit(0);

$sql = 'UPDATE '._DB_PREFIX_.'_category SET nleft = 0, nright = 0 WHERE 1';
Db::getInstance()->execute($sql);

$regenerate = Category::regenerateEntireNtree();

echo "INIT: ".date('Y-m-d H:i:s');
echo "\n\n";
print_r($regenerate);
echo "END: ".date('Y-m-d H:i:s');
echo "\n\n";
die("END:13");
ricardopxl

ricardopxl


More context.

Update 2024 to PS 1.7

The problem is created when you work directly in db, and don't run all the process with the currents controllers. If you have problem with your breadcrumb, but your assoc category (ps_category_product) and id_category_default is correctly (ps_product,ps_product_shop)

The correct and full fix's to update the nleft and nright:
 

<?php 
require('../../config/config.inc.php');
ini_set('memory_limit',-1);
set_time_limit(0);

$sql = 'UPDATE '._DB_PREFIX_.'_category SET nleft = 0, nright = 0 WHERE 1';
Db::getInstance()->execute($sql);

$regenerate = Category::regenerateEntireNtree();

echo "INIT: ".date('Y-m-d H:i:s');
echo "\n\n";
print_r($regenerate);
echo "END: ".date('Y-m-d H:i:s');
echo "\n\n";
die("END:13");
ricardopxl

ricardopxl

Update 2024 to PS 1.7

 

The correct and full fix's:
 

<?php 
require('../../config/config.inc.php');
ini_set('memory_limit',-1);
set_time_limit(0);

$sql = 'UPDATE '._DB_PREFIX_.'_category SET nleft = 0, nright = 0 WHERE 1';
Db::getInstance()->execute($sql);

$regenerate = Category::regenerateEntireNtree();

echo "INIT: ".date('Y-m-d H:i:s');
echo "\n\n";
print_r($regenerate);
echo "END: ".date('Y-m-d H:i:s');
echo "\n\n";
die("END:13");
×
×
  • Create New...