Hello guys, I run into a very strange problem with my shopping cart page and searched long enough to no avail. I understand this might not be an issue with Ubercart itself but if anyone can point out a direction I will be so much appreciated.

On the shopping cart page there should be product thumbnail images but whatever I add to the cart, the images just don't show up on that page. Strange part is on the shopping cart drop down menu (when you hover on the cart icon on the top right corner) the images display fine. Here is the link to the site mysite.com.

Please kindly help if you have any idea. Thanks in advance.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Stone Liu created an issue. See original summary.

TR’s picture

Category: Bug report » Support request

Your site is looking nice. It would be great if you posted here how you did that cart icon in the header with the recently added items dropdown - that's not part of Ubercart, but it could be if you contribute the code.

You've obviously done a lot of customization to the cart - I suspect your custom code is at fault here. Hard to say without seeing it - have the images always been missing? Usually the only problem people have with the cart images is when they first set up images and don't get them set up quite right. Once it's running it shouldn't cause problems anymore.

longwave’s picture

The theme appears to be purchased from http://themeforest.net/item/progressive-multipurpose-responsive-drupal-t... so you should contact them for support. As TR says there is a lot of custom work done and neither the cart page or block are standard Ubercart output, but we do not have access to the code to see what is going on.

TR’s picture

Status: Active » Postponed (maintainer needs more info)
TR’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No further information provided.

Stone Liu’s picture

Thanks to TR and longwave!

Indeed I bought the theme as longwave wrote, but the author there couldn't figure out the problem/solution so far that's why I came to the community. The only thing on my site seems different than the original theme I bought is that I get this error message on my site:
Click here to automatically configure the following items for core image support:
The Image file field has not been created for products.
(This action is not required and should not be taken if you do not need images or have implemented your own image support.)

Could this be the cause? And I saw one of longwaves post that this message could be safely ignored...

Stone Liu’s picture

Status: Closed (cannot reproduce) » Active
TR’s picture

Status: Active » Closed (won't fix)

If you release the code for the theme so we all can use it, then we can help. But I'm not going to provide free support for a commercial product that doesn't give back to the Ubercart community.

Stone Liu’s picture

Issue summary: View changes
Stone Liu’s picture

Hello TR,

I'm more than happy to release the code and give back to our Ubercart community, but it might be better if I ask the author for his consent before I do this? I will get back to you very soon.

Proteo’s picture

I just got bitten by this (not using any commercial theme). The weird thing is that some product classes display the image just fine while others don't. After tinkering for a while I think I've figured it out and it looks like it may have nothing to do with the theme layer, but with the Media module (YMMV).

The root of the problem is that some product classes, those in which the image field is configured to use the Media browser widget, the product image select have no options available in the content type settings page (see atached screenshot), so you can't pick an image field and therefore the cart fails to display such image.

Settings page

The problem lies in the line #911 of the function uc_product_form_node_type_form_alter():

if (strpos($instance['widget']['type'], 'image') !== FALSE || ($instance['widget']['type'] == 'media_generic' && isset($instance['widget']['settings']['allowed_types']) && $instance['widget']['settings']['allowed_types'] == array('image' => 'image'))) {
  $options[$field_name] = $instance['label'];
}

For some reason, the field_info_instances() function call in#907 returns the $instance['widget']['settings']['allowed_types'] array containing every single file type available, even if you selected just "Image" in the field config screen. The comparison fails, because it expects the settings to allow images only.

So maybe there's a bug in field_info_instances(), but regardless I think that the right approach would be not to ask if the settings allow for "image" only, but to ask if "image" is among the allowed types, like this:

if (strpos($instance['widget']['type'], 'image') !== FALSE || ($instance['widget']['type'] == 'media_generic' && isset($instance['widget']['settings']['allowed_types']) && in_array('image', $instance['widget']['settings']['allowed_types']))) {
  $options[$field_name] = $instance['label'];
}

After that change, I can see the UC image option in the select and choose it. After saving the changes, the thumbnail image is displayed perfectly fine.

Hope it helps, best regards.

Proteo’s picture

Status: Closed (won't fix) » Needs work