There is a problem with upsell block when the product carry long names.

Upsell simply display the entire name, making it rather ugly, see attached screen shot.
In the demonstration site, http://www.rifftrax.com/
It clearly does not have the same problem I do.......the long name simply goes into a 2nd line.......it appears there is a setting somewhere to control the width of each column of the table.

Does anyone know how to configure this?
(I have looked around all the issues and can't find any ideas....)

In the same screenshot, upsell shows the name twice for those without a thumbnail. Is there something I can do to prevent this? or does it qualify for a new feature request to stop this from happening?

In the same screenshot, it has a box to enter the quantity and link to add to cart. In the demonstration site, these two are not present. How do I configure this? (I can't figure it out...)

CommentFileSizeAuthor
screen.png10.71 KBericwongcm

Comments

Marsh57’s picture

I have a similar problem with double names when there is no thumbnail. Do we have to show a thumbnail?

Marsh57’s picture

Am using the latest dev version, and the long names work well in the cart view, but cause the next product to move below the first thereby creating a vertical list rather than a horizontal one in the product page view. What can be done to make the names break to the next line in the product page view like they do in the cart view?

torgospizza’s picture

Regarding issue (and comment) #1, I have just committed a new version to Dev that includes an option in the admin/build/block/uc_upsell/0 configuration (the "Upsell Items block config) that allows you to show or not show the default product image. If you keep this unchecked (the default option) then it will just not show any thumbnail if none exists. Keep in mind I just committed this to Dev tonight, so you probably won't see the new Dev build on tomorrow. Download that new package and run update.php.

Regarding the other issue about the lines not breaking, this is simply done using CSS. You have to specify the width of your div. If that doesn't work you can also specify that the words get wrapped using the "word-wrap" CSS definition. You can also try using the PHP function wordwrap, and override the default theme function for the Upsell block: http://us2.php.net/wordwrap

Let me know if you need more suggestions.

torgospizza’s picture

Status: Needs work » Postponed (maintainer needs more info)
Marsh57’s picture

First, let me thank you for your efforts with Upsell. It is a great module.

Still having trouble with the word break. I added width settings and "text-wrap: normal" to the uc_upsell.css file with no effect. Is that the wrong file? How can it be that word wrap works for the block in cart view, but not in product view? I have a custom template for my product pages, could that be causing the difference?

torgospizza’s picture

Yes, it could be... you might want to instead add rules to your layout.css or style.css (your template's stylesheet). You might need to specify the div tags that are used in the product page.

.upsell-block-product {
width: 100px;
}

Tested this on my local site and it works fine.

HTH

Marsh57’s picture

Thanks for the response. I found the problem. I had not refreshed the cache on my performance page, so the changes to the css file were not being used. After refreshing the cache, everything is working as it should. Sorry for my ignorance, and thanks again for the help.

torgospizza’s picture

Status: Postponed (maintainer needs more info) » Fixed

Ah yes, the troublesome cache. That'll do it every time. :) Glad you got it working!

ericwongcm’s picture

re: #6

Putting

.upsell-block-product {
width: 100px;
}

inside uc_upsell.css works well to solve the line break issue.
Maybe you can include it in the uc_upsell.css itself, and mention this in the description or inside readme file so that user knows where to change this.

Or maybe provide an option somewhere for user to specify the width for line break? rather than make users change the codes? because not everyone can.

I also noticed another bug, on my site, the upsell block does not show unless I login.
I have checked my upsell block setting and none of the boxes for "Show block for specific roles: " are ticked.
That means it should show for anonymous users. Am I missing something here?

Thanks the fix
Eric

torgospizza’s picture

Well, I would add it to the CSS, maybe I'll comment it out though but still leave it there. The problem is, if I introduce the new CSS rule *now*, it might hurt some of the current sites that use it. I'm not sure at the moment - what are your thoughts?

I haven't noticed the "authenticated user" bug but others have reported it. I don't think it's an issue with Upsell because there are no mechanisms in the code anywhere that determine what types of users are allowed to see the block. Likewise, I can't reproduce this on any site that is running Upsell.

My guess is you need to edit your block settings, or perhaps clear your block cache.

You might also check out this related issue: #524994: Upsell block only displaying for Drupal Administrator

ericwongcm’s picture

Re: #10

Of course I would prefer the CSS to be in the code, I actually used 150px btw, 100px is too narrow for me.
Possibly either the others did not have long product name or they use upsell anyway without bothering to fix or report this issue because it is not major.

About the 3rd question I asked in #1
any ideas how to configure it?
I know it is probably not related not upsell...but can't find where I should change.

The example site only shows a link "Buy now $3.99"
with URL underneath like this.....
http://www.rifftrax.com/cart/add/i30347Featured-p30347_q1?destination=cart

but my site is showing the quantity box and the Add to cart button.

torgospizza’s picture

Well I got rid of the Cart Links option... for that you'd probably have to override the Theme function to have a cart link instead of the add to cart form.

However I understand that people might prefer this look. I know I prefer it on our site... so I think I'll add it back in this week as another option.

ericwongcm’s picture

I have just installed the latest Dev version.

Thanks for the option "Use a "Buy Now" button instead of Add to Cart form"

torgospizza’s picture

Cool. You're welcome :)

Status: Fixed » Closed (fixed)

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

ericwongcm’s picture

If anyone is wondering why your custom css width setting for your upsell-block-product is working for login users but not for annoymous users.

Try disable your block cache.
Otherwise, in my case, drupal ignore my custom upsell css setting.