How to set "stripes Color" to transparent?

  • Posts: 18
  • Thank you received: 3
1 year 8 months ago #343175

-- url of the page with the problem -- : still localy developping
-- HikaShop version -- : 4.6.1 [2207041030]
-- Joomla version -- : 3.10.10
-- PHP version -- : 7.4
-- Browser(s) name and version -- : Firefox developer 103.0b7 (64-bits)
-- Error-message(debug-mod must be tuned on) -- : none

Is it possible to set the stripes color to transparent?
Normally I just delete the color setting in hikashop config to get transparent color coding and that works fine with categories en product background views.
But if I do that same thing in stripes color I get a white background color. If I put in some other color code, for example #faf208, it works as supposed to, and I get a yellow background.

Thanks for your time,,

Greetz

Appie

Please Log in or Create an account to join the conversation.

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
1 year 8 months ago #343180

Hi,

We never thought about that.

Try adding the code:

else {
	$bgcolor = imagecolorallocatealpha($resource, 255, 255, 255, 127);
}
before the code:
if($bgcolor === false) {
in the file administrator/components/com_hikashop/helpers/image.php
It should normally generate a transparent background when no color is set in that setting.
Note that as generated thumbnails are cached, you might need to delete the folders / files under the images/com_hikashop/upload/ folder so that HikaShop can regenerate the thumbnails with the transparent background instead of using the images already generated.
Please let us know how it goes so that we can integrate the change on our end.

The following user(s) said Thank You: Appie Thrasher

Please Log in or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 3
1 year 8 months ago #343192

nicolas wrote: Hi,

try adding the code:

else {
	$bgcolor = imagecolorallocatealpha($resource, 255, 255, 255, 127);
}
before the code:
if($bgcolor === false) {


First thanks for the quick answer..
I put in the code like this:
if($bgcolor === false || $bgcolor === -1)
					$bgcolor = imagecolorallocate($resource, hexdec($rgb[0]), hexdec($rgb[1]), hexdec($rgb[2]));
			}
		}
		else {
	$bgcolor = imagecolorallocatealpha($resource, 255, 255, 255, 127);
		}
		if($bgcolor === false) {
			$bgcolor = imagecolorallocatealpha($resource, 255, 255, 255, 0);
			if($bgcolor === false || $bgcolor === -1)
				$bgcolor = imagecolorallocate($resource, 255, 255, 255);
		}
		return $bgcolor;
	}


After that I completely removed the thumb files, and removed cache in Joomla.
Sadly the new generated thumb still has a white background in my case. But maybe I did the code wrong?

Thanks again.
Greetz
Appie

Please Log in or Create an account to join the conversation.

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
1 year 8 months ago #343214

Hi,

I did the same modification on my end and I did get the transparent stripes on my thumbnails:
i.imgur.com/gfuPv1o.png
You can see there are no white stripes there and if I look at the image with my browser's console you can see the transparent stripes.
So I'm not sure why it wouldn't work for you.

Please Log in or Create an account to join the conversation.

  • Posts: 18
  • Thank you received: 3
1 year 8 months ago #343216

nicolas wrote: Hi,

I did the same modification on my end and I did get the transparent stripes on my thumbnails:
i.imgur.com/gfuPv1o.png
You can see there are no white stripes there and if I look at the image with my browser's console you can see the transparent stripes.
So I'm not sure why it wouldn't work for you.


That's strange indeed , so I looked into it a bit further..
Uploaded a tests onto my live server and indeed there it works fine.. THANKS!
Need to check my local synology whats missing... think imgmagic needs to be installed going to look in that problem now.

Nicolas thanks for your time and patience

Greetz,

Appie

Please Log in or Create an account to join the conversation.

  • Posts: 81361
  • Thank you received: 13035
  • MODERATOR
1 year 8 months ago #343219

Hi,

Thanks for your feedback. We'll include the modification for the next version of HikaShop.

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum