小编Mat*_*ath的帖子

Magento类型模型未加载所有数据

我正在Magento中构建一个自定义导航菜单,该菜单显示来自不同商店的类别,这些商店具有与当前商店不同的根类别.某些类别应隐藏,因为它们将"包含在导航菜单中"设置为否.

应该可以从类别模型中读取此属性,如下所示:如何检测类别是否将"导入菜单中的包含"设置为"否"?

但是$ class-> getIncludeInMenu()在我的Magento EE 1.11安装上为所有类别返回NULL.

// Load child categories for a specific root category
$_uk_default_root_id = Mage::app()->getStore('uk_default')->getRootCategoryId();
$_uk_default_root_category = Mage::getModel('catalog/category')->load($_uk_default_root_id); 
$_sub_categories = $_uk_default_root_category->getChildrenCategories();

// Loop through the categories
foreach ($_sub_categories as $_category)
{
    if ($_category->getIsActive() && $_category->getIncludeInMenu())
    {
        <echo navigation link>
    }
}
Run Code Online (Sandbox Code Playgroud)

其中一个类别的var转储显示没有'include_in_menu'属性,尽管'is_active'属性按预期工作.是否有另一种方法可以确定是否应在导航中显示某个类别?

类别对象的var转储:

object(Mage_Catalog_Model_Category)[423]
  protected '_eventPrefix' => string 'catalog_category' (length=16)
  protected '_eventObject' => string 'category' (length=8)
  protected '_cacheTag' => string 'catalog_category' (length=16)
  protected '_useFlatResource' => boolean false
  private '_designAttributes' => 
    array (size=6)
      0 => string …
Run Code Online (Sandbox Code Playgroud)

magento

6
推荐指数
1
解决办法
6019
查看次数

Three.js Raycaster不与自定义网格相交

我通过创建具有顶点的几何体,然后构建面来构建自定义网格(八角形棱镜).我现在正在尝试添加鼠标悬停交互,但是Raycaster不返回此网格的交叉点.

我认为这是网格的一个问题,因为其他几何在场景中的交叉点上正确返回.

这里可以看到一个完整的例子:http://jsfiddle.net/mattheath/3qxzS/

var x, y, z, width, height, opacity;


 // Container object
 var octagon = new THREE.Object3D();

 // Adjust registration point to bottom of object
 y = y + height / 2;

 // Default opacity to non-transparent
 opacity = opacity || 1;

 // Calculate distance from edge of a cube the octagonal side starts
 var cornerRadius = ((width - (width / (1 + Math.sqrt(2)))) / 2) * 0.85;

 // Boundaries
 var xMin = x - width …
Run Code Online (Sandbox Code Playgroud)

three.js

4
推荐指数
1
解决办法
2842
查看次数

标签 统计

magento ×1

three.js ×1