Jump to content

Can't figure out placeholder images (no-image)


Recommended Posts

A couple of the products in my shop do not have images yet.
I'd like to display a placeholder image instead.

The best I found is this thread:

https://forums.cubecart.com/topic/52289-resolved-image-not-available-place-holder-image/

I checked the mentioned imagePath() and getProductImage() functions, but did not find any paths to change.

In my skin's config.xml I put

  <images>
	<image reference="thumbnail" maximum="190" quality="80" default="platzhalter.png" />
	<image reference="category" maximum="800" quality="80" default="platzhalter.png" /><!-- Doesnt need a default -->
	<image reference="subcategory" maximum="105" quality="80" default="platzhalter.png" />
	<image reference="gallery" maximum="50" quality="80" default="platzhalter.png" />
	<image reference="normal" maximum="300" quality="80" default="platzhalter.png" />
	<image reference="enlarge" maximum="600" quality="80" default="platzhalter.png" /><!-- Doesnt need a default -->
	<image reference="tiny" maximum="30" quality="80" default="platzhalter.png" />
	<image reference="small" maximum="200" quality="80" default="platzhalter.png" />
	<image reference="medium" maximum="500" quality="80" default="platzhalter.png" />
	<image reference="large" maximum="600" quality="80" default="platzhalter.png" /><!-- Doesnt need a default -->
  </images>

but it does nothing and inspection of the output gives me:

<a class="th" href="http://localhost/shop/no-image" title="NoImageProduct">
  <img src="" alt="NoImageProduct"></a>

and in debug:

7 => Array (14)
  name => "NoImageProduct"
  product_id => "8"
  quantity => "1"
  price => "€0.00"
  sale_price => null
  tax_type => "0"
  tax_inclusive => "0"
  url => "http://localhost/shop/no-image"
  ctrl_sale => false
  price_to_pay => "0.00"
  full_base_price => "0.00"
  price_unformatted => "0.00"
  sale_price_unformatted => null
  image => false

 

Since the post I found is rather old, were there any changes in how this works?
My base skin is Minimalizer.

Link to comment
Share on other sites

All skins need to follow a set of guidlelines.

One guideline is where to put and what to name the image that CubeCart uses when an image has not been assigned to a product.

That image is named as default in the config.xml file for the <image> nodes.

The image is located in the skin folder, /images/ folder. A stock skin should have noimage.png. I see that your config.xml file is using the name platzhalter.png, So, make sure platzhalter.png is located in the skin's /images/ folder. Then clear CubeCart's cache.

 

Edited by bsmither
Link to comment
Share on other sites

platzhalter.png is in skin/images as well as the default noimage.png
"noimage.png" was originally in my config.xml, but it never showed up, only the broken image icon and "no-image" Alt-text.

Just to make sure, I also copied platzhalter,png to the main image folder and the shop's root folder as well.

This might be another quirk with Minimalizer.
Are there any more settings to this?

Link to comment
Share on other sites

6 hours ago, bsmither said:

What page are you looking at with the Smarty debug?

 

Above is from putting {debug} into main.php and then go to the shop's homepage.

But it's the same result everywhere. Inside content.product.php and then checking the product page, it says (as far as image related):

thumbnail => false
category => false
subcategory => false
gallery => false
normal => false
enlarge => false
tiny => false
small => false
medium => false
magnify => true
large => false
source => false

It's like placeholder images are switched off or something.

 

---

EDIT: I switched to Foundation skin and the placeholder image is there.
Switching back to my skin, it's gone again.
The original Minimizer skin also does NOT show a placeholder image.

Maybe this helps?

Edited by MostlyConfused
Link to comment
Share on other sites

minimalizer_config.xml > Original, right out of the box (noimage.png exists)
my_skin_config.xml > the one from my modified skin

minimalizer_config.xml
my_skin_config.xml

Meanwhile I must have copied platzhalter.png into every folder there is.

As a test, I copied all contents of the Foundation (skin) folder into my own skin's folder. That did not work at all.
By trial and error I could use every file of the foundation skin but main.php. Even then, the placeholder images don't show up.

Also I did a fresh install of the Minimizer skin by token. Still no placeholder images.

If you install Minimizer, do placeholder images work for you?

 - if so, the root of my problem might be elsewhere
 - if not, maybe you can figure out from there what's wrong?

Cheers

Edited by MostlyConfused
Link to comment
Share on other sites

I am not able to replicate your experiences.

Please edit the config.xml as follows:

Find all:
<style images="true">

Change to:
<style images="false">

In the 'my_skin_config.xml' file, there are two <styles> groups, one before <layout> containing all the colored sub-theme styles, and one after </layout> containing the default sub-theme style.

Group all the <style> nodes into one single <styles> group. Then, you will notice there are two sub-styles that have the default="true" attribute. There should only be one default sub-style.

I have attached the 'my_skin_config.xml' with these edits.

 

my_skin_config.xml

Edited by bsmither
Link to comment
Share on other sites

Thanks, but sadly it still does not work.
I also tried creating a new product and it gets no placeholder.

I used your config.xml as is and also with the green subtheme as a default.

If a freshly installed Minimalizer skin does work for you, that's strange. I can't remember any placeholder images ever, even when I just had installed CC and the skin without any changes.

Even more so, the online-version never had the original Minimalizer skin before. I just installed it there and also no placeholders, only with Foundation.

 

1 minute ago, bsmither said:

Be sure to clear CubeCart's cache.

 

every time

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...