Question

This is what I have:

echo tep_image(DIR_WS_IMAGES . "arText.png", "ALTERNATE TEXT HERE");

The output is this:

img src="THIS-IS-THE-IMAGE-LOCATION" alt="ALTERNATE TEXT HERE" title="ALTERNATE TEXT HERE"

My question is that I want to add WIDTH & HEIGHT of the image in tep_image function in OSCommerce. So the new output would be like this:

img src="THIS-IS-THE-IMAGE-LOCATION" alt="ALTERNATE TEXT HERE" title="ALTERNATE TEXT HERE" WIDTH="Sizepx" HEIGHT="Sizepx"
Was it helpful?

Solution

You just need to pass width and height as extra parameters to tep_image() function, the function already support them. From documentation:

tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') X-Ref
The HTML image wrapper function

So it will look like

echo tep_image(DIR_WS_IMAGES . "arText.png", "ALTERNATE TEXT HERE", "width_here", "height_here");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top