For now, the body field of our product content types is "Long text with summary".

Issue :

  1. When the summary is filled, the main body is not displayed on the product page.
  2. The main body is not entirely displayed on the product page.

On the product page, we want the body to be trimmed to a maximum length, and display a "read more" option which will display the end of the body.

The solution might be to set the body field to "Long text" and display the entire body field when clicking on "read more".

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Haza’s picture

Status: Active » Needs review

Patch for that have been commited for review https://code.drupalcommerce.org/48

Haza’s picture

Status: Needs review » Fixed

It has been merged.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

michfuer’s picture

Category: task » bug
Status: Closed (fixed) » Needs work

There's a problem with Features that arises from changing the type of the 'body' field. Now if you try to install a Feature that creates a content type there's a high chance of a field type collision since most people will be developing their features with a standard Drupal install (instead of Commerce Kickstart), and the default 'body' type is 'text_with_summary'. Is there any reason why the field name couldn't be adjusted to avoid collisions?

RKS’s picture

How do you remove the "Read More" link? I have yet to even hear of anyone asking for this and yet here it is. Every paragraph in my product description is trimmed with a read more after. I haven't come across any sites that trim their product descriptions and I want mine to have a full description and not a lot of Read More links floating around.

How do you change this and display just full descriptions on the product pages? Thanks.

capnjav’s picture

And somehow I'm experiencing the opposite as RKS. I can't seem to turn on the "Read More" link in the product display similar to what is seen on the demo.

advix’s picture

I believe the missing Read More link is related to this issue: http://drupal.org/node/1803732 - Missing wrappers for new fields.

bojanz’s picture

Title: Update the body of our product content types to "Long text" and trim it to a maximum length » Revert: replace default body fields of type text_with_summary with ones of type text_long
Assigned: theo_ » bojanz
Status: Needs work » Active

Working on this.

DSquaredB’s picture

tag

jjclint’s picture

Need a patch for this asap, shame cause I really wanted to use the kickstart distro. for this project.

fhdrupal’s picture

How can I revert body field to "Long text and summary" type?

silkogelman’s picture

Will this be changed to 'Long text' or 'Long text and summary' ?

silkogelman’s picture

related to this:
Blog summaries are not saved, therefore unusable as Meta Tag meta descriptions (or og:descriptions), and currently unusable as descriptions for the items on Blog category pages.

vasike’s picture

Status: Active » Needs review
FileSize
15.63 KB

here is patch that should revert body field to text with summary type:
- correct the field type in instalation
- rebuild of body field features
- adapt the migration field mapping
- update script that forces this change in the DB + revert features

jsacksick’s picture

Status: Needs review » Needs work
+++ b/commerce_kickstart.install
@@ -1104,3 +1104,26 @@ function commerce_kickstart_update_7214() {
+    features_revert();

We shouldn't do that, this will revert unwanted features, we should either revert specific features and only the field component or not revert them at all.

+++ b/modules/commerce_kickstart/commerce_kickstart_blog/commerce_kickstart_blog.features.field.inc
+++ b/modules/commerce_kickstart/commerce_kickstart_blog/commerce_kickstart_blog.features.field.inc
@@ -37,7 +37,7 @@ function commerce_kickstart_blog_field_default_fields() {

We should also update the formatter settings of the body field for the teaser view mode and use (Summary or trimmed) instead of default.

jsacksick’s picture

You also need to update commerce_kickstart_product_ui.js.
The expander is broken with that change (The read more/read less) on the product display page.
$('.node-product-type .field-name-body .field-item').expander() to $('.node-product-type .field-name-body').expander();

vasike’s picture

Status: Needs work » Needs review
FileSize
17.72 KB

here is a new patch with solutions for #15 & #16 included.
@jsacksick : thanks for support

jsacksick’s picture

Status: Needs review » Fixed
FileSize
17.34 KB

I committed a slightly different patch, I don't use the div fences wrapper in order to keep the default drupal field markup for the body. Thanks to that we no longer need to update the js.
The attached path is the one that I've committed, thanks for the good job vasike!

jsacksick’s picture

Same patch with small modifications on the blog feature.

Drupa1ish’s picture

After running update with function commerce_kickstart_update_7216, I get PHP Fatal error: Call to undefined function commerce_product_reference_node_types() /profiles/commerce_kickstart/modules/commerce_kickstart/commerce_kickstart_product_ui/commerce_kickstart_product_ui.module on line 71

jsacksick’s picture

That would mean your commerce_product_reference_module is disabled, this update doesn't disable it.

Drupa1ish’s picture

Last night, the last commit wasn't available in the main package http://ftp.drupal.org/files/projects/commerce_kickstart-7.x-2.x-dev-core....
So I took it from git clone --branch 7.x-2.x http://git.drupal.org/project/commerce_kickstart.git.
This was the cause of errors. After upgrading with main package today works as designed.
Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Staler75’s picture

Issue summary: View changes

is there a way to get the "read more" option on product display in standard commerce (without kickstart) ?

Atec Zhou’s picture

If I input Chinese/Japanese text, it won't work. "read more" link won't be displayed. Maybe issue on checking text length?