简体   繁体   English

Drupal Commerce类别页面

[英]Drupal Commerce category page

I've put together a Drupal commerce site using a theme called Expressa. 我已经将一个名为Expressa的主题整合到了Drupal商业站点上。 Will readily admit I'm not an expert with Drupal. 会很容易地承认我不是Drupal的专家。

On my category (item-type) page I get just text - no sign of the image I uploaded when I added the product. 在我的类别(项目类型)页面上,我只会看到文字-添加产品时没有上传图片的迹象。 Simply a list of products in that category. 仅列出该类别中的产品。

When you click on one of the products you see the product's picture that I uploaded. 当您单击其中一种产品时,您会看到我上传的产品图片。

From what I can tell both pages use the same file to display the products - node-product-display-tpl.php. 据我所知,两个页面都使用同一文件来显示产品-node-product-display-tpl.php。

To be a little more specific on the category page there's this: 要在类别页面上更具体一点,请执行以下操作:

<div class="row">  
<div class="span5">
<div class="product-display-image">
</div>
</div>
</div>

On the product page this changes to 在产品页面上,此更改为

<div class="span5">
<div class="product-display-image">
<div class="commerce-product-field commerce-product-field-field-image field-field-image                        node-47-           product-field-image">
<div class="field field-name-field-image field-type-image field-label-above">
<div class="field-label">Image:&nbsp;</div><div class="field-items">
<div class="field-item even"><img typeof="foaf:Image" src="http://edge.ppgdev.com/oo/sites/default/files/styles/large/public/ocrm.jpg?itok=JLlUNLG8" width="600" height="450" alt="" />
</div>
</div>
</div>
</div>
</div>
</div>

Any help restoring the picture(s) to the item type page appreciated. 任何帮助将图片还原到项目类型页面的帮助。 Got a feeling I've changed something inside Drupal. 有种感觉,我改变了Drupal内部的某些东西。 Mainly because both use the same file and the code calling in the image is there. 主要是因为两者都使用相同的文件,并且图像中的代码在那里。 So my guess is somewhere in the depths of Drupal I've deactivated product images on the item-type page. 因此,我的猜测是在Drupal的深处,我已在项目类型页面上停用了产品图片。 It's just I've spent 12 hours looking for this setting and found diddly squat so far. 只是我已经花了12个小时寻找此设置,并且到目前为止发现了深蹲。

Here's the theme maker's page looking like I want mine to look like: 这是主题制作者的页面,看起来像我想要的样子:

http://refaktorthemes.com/expressa/item-type/bags http://refaktorthemes.com/expressa/item-type/bags

It seems very simple on paper but I'm struggling to find this particular setting. 在纸上看似非常简单,但我一直在努力寻找这种特殊的设置。

Thanks in advance for any help. 在此先感谢您的帮助。

In Drupal Commerce (and Drupal), node display (which fields are visible ? where ? which formatter is used ?) is set using Display Suite (most of the time, it's the case with Commerce Kickstart) : Structure -> Content types -> [content type] -> Manage Display. 在Drupal Commerce(和Drupal)中,使用Display Suite设置节点显示(可见的字段?其中使用哪个格式程序?)(大多数情况下,Commerce Kickstart就是这种情况):结构->内容类型-> [内容类型]->管理显示。

Then you have to select a display mode in top right (full content, product list...), and choose what to display (and how) for this content type and this display mode. 然后,您必须在右上角选择一种显示模式(完整内容,产品列表...),并选择该内容类型和此显示模式的显示内容(以及显示方式)。

In Drupal commerce, you have product display nodes , which are plain old Drupal nodes and have a product reference field, and products which are not nodes but entities, with mandatory fields : price, SKU. 在Drupal Commerce中,您具有产品显示节点 ,它们是普通的旧Drupal节点并具有产品参考字段,而产品不是节点而是实体,但具有必填字段:价格,SKU。 A product display node can reference multiple products (think about T shirts : different colors and sizes). 一个产品展示节点可以引用多个产品 (考虑一下T恤:不同的颜色和尺寸)。 A product is basically a thing that can be sold (with a unique SKU, a price, and most of the time a picture), while a product display node is a wrapper which allows to display one or more products (variations of a products). 产品基本上是一种可以出售的东西(具有唯一的SKU,价格和大部分时间的图片),而产品显示节点是包装器,可以显示一个或多个产品(产品变体) 。

So when managing the way products appears on your site, you have to check the display settings for the product display node (product reference field must be visible, using a formatter like "rendered entity", where you can choose a display mode which will be used to display the product entity within the product display node ) AND the display settings for the product itself : is the image field (it must be on the product entity since typically it changes across variations) visible for the display mode that is used on your listing page (this display mode should be called "product listing by category" for instance) ? 因此,在管理产品在网站上的显示方式时,您必须检查产品显示节点的显示设置(必须使用“渲染的实体”之类的格式程序来显示产品参考字段,在这里您可以选择一种显示模式用于在产品显示节点内显示产品实体产品本身的显示设置:对于您所使用的显示模式而言,图像字段(该图像字段必须在产品实体上,因为通常它会随着变化而变化)是可见的列表页面(例如,此显示模式应称为“按类别列出产品”)?

So when a product is displayed, two sets of display settings are playing together : one for the product and one for the product display node. 因此,在显示产品时,将同时使用两组显示设置:一组用于产品,另一组用于产品显示节点。

You can review the display settings for product display node here : admin/structure/types/manage/your-product-display-content-type/display 您可以在此处查看产品显示节点的显示设置:admin / structure / types / manage / your-product-display-content-type / display

You can review the display settings for product here : admin/commerce/products/types/your-product-type/display 您可以在此处查看产品的显示设置:admin / commerce /产品/类型/您的产品类型/显示

(the content type your-product-content-type has a product reference field, which can reference a product of the your-product-type type). (内容类型your-product-content-type具有产品引用字段,该字段可以引用your-product-type类型的产品)。

If image should be displayed reviewing the display settings, look at the formatter used, then try to find the view which is used for this page and check its configuration (should be the view on the /category/% URL, or something like this). 如果应该通过查看显示设置来显示图像,请查看使用的格式化程序,然后尝试查找用于该页面的视图并检查其配置(应该是/ category /%URL上的视图,或类似的东西) 。 It must be set to display nodes using a certain display mode, so check the display settings for this display mode. 必须将其设置为使用某种显示模式显示节点,因此请检查此显示模式的显示设置。

I hope this can help, the Drupal Commerce way of dealing with products, variations and displays is not really straight forward, I struggled myself with this for a while, but it is very flexible. 我希望这可以有所帮助,Drupal Commerce处理产品,变体和展示的方式并不是很直截了当,我为此付出了一段时间,但它非常灵活。

Good luck with it 祝你好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM