在左侧显示所有 osCommerce 类别和子类别隐藏主页中的产品列表
我更改了一些 osCommerce 代码以在左侧边栏上显示所有类别和子类别,并且它运行成功。
不幸的是,它在主页上隐藏了产品。在 osCommerce 网站的默认主页上,我们获取当月的产品,并显示所有产品。
如果我逃避下面所做更改的第 2 步,它会显示产品,但左侧导航不会显示所有类别和子类别。
步骤:
index.php - 在第 37 行左右进行更改:
if ($category_深度 == '嵌套') {
致:
if ($category_depth == '嵌套' && isset($HTTP_GET_VARS['cPath'])) {
includes/application_top.php - 第 437 行左右更改:
$cPath = '';
致:
$cPath = '22';
includes/modules/boxes/bm_categories.php - 查找周围第 99 行:
$parent_id = $categories['categories_id'];
添加:
$dbs[] = $categories['categories_id'];
includes/modules/boxes/bm_categories.php > - 在第 109 行左右进行更改:
while (list($key, $value) = every($cPath_array)) {
致:
while (list($key, $value) = every($dbs)) {
为什么会出现问题?
I changed some osCommerce code to show all categories and subcategories on the left sidebar and it is successfully working.
Unfortunately it's hiding products on the home page. On the default home page of osCommerce site we get products for the month and it shows all products.
If I escape step 2 of the changes made below it shows the products but the left navigation does not show all categories and subcategories.
Steps:
index.php - change on around line 37:
if ($category_depth == 'nested') {
To:
if ($category_depth == 'nested' && isset($HTTP_GET_VARS['cPath'])) {
includes/application_top.php - change around line 437:
$cPath = '';
To:
$cPath = '22';
includes/modules/boxes/bm_categories.php - find around line 99:
$parent_id = $categories['categories_id'];
Add:
$dbs[] = $categories['categories_id'];
includes/modules/boxes/bm_categories.php - change at around line 109:
while (list($key, $value) = each($cPath_array)) {
To:
while (list($key, $value) = each($dbs)) {
Why is the problem happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将第二步更改为以下内容:
您现在的情况是,
$cPath = '22';
引用了无效的类别 ID。如果将默认类别路径 ID 设置为顶部(零 (0)),这将纠正问题并默认显示该月的新产品。
如果您将该值更改为子类别 ID,则该类别的产品将默认显示在主页上。
Change the second step to the following:
What you have now,
$cPath = '22';
refers to an invalid category ID.If you set the default category path ID to the top, which is zero (0), this will correct the problem and by default show the new products for that month.
If you changed that value to a child category ID, products from that category will be the default showing on the main page.