Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Why no support on this site - Sidebox image size question - need help please

Why no support on this site - Sidebox image size question - need help please

Locked

Views: 8,799

Results 1 to 20 of 31
This thread is locked. New replies are disabled.
17 Aug 2006, 12:14 AM
#1
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Why no support on this site - Sidebox image size question - need help please

Have asked this question and after doing a search through this site it seems that far to many requests for help go unanswered as well.

Trying to get some support to determine how how to change the sidebox image size using this code from the template file

$content .= '<div align="center"><a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(zen_get_small_image($random_whats_new_sidebox_product->fields['products_image']), $random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br /><a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . $random_whats_new_sidebox_product->fields['products_name'] . '</a><br />' . $whats_new_price . '</div>';
?>

In this code, it uses SMALL_IMAGE_WIDTH

We do not want to change this in our admin but instead specify MANUALLY and image size here or use the image size used in the shopping cart

Tried replacing those variables with the IMAGE_SHOPPING_CART_WIDTH and this had no effect.

Can someone please assist with this question?

Thank You

17 Aug 2006, 12:32 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Why no support on this site - Sidebox image size question - need help please

what exact size do you want ?

Since you don't want to have admin control over it, and want to change just the function of this file, why not just replace the constant with the exact number?

...ucts_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><b...
```becomes:```
...ucts_name'], 85, 130 ) . '</a><b...
17 Aug 2006, 12:34 AM
#3
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

Thank You very much for responding

I did change this to the figure as you suggested and it still just displayed the image the other size (100X80)

I changed it to 50X40

Not sure what is causing the problem

17 Aug 2006, 12:36 AM
#4
merlinpa1969 avatar

merlinpa1969

Totally Zenned

Join Date:
Mar 2004
Posts:
13,031
Plugin Contributions:
4

Re: Why no support on this site - Sidebox image size question - need help please

Have asked this question and after doing a search through this site it seems that far to many requests for help go unanswered as well.
You are aware that everyone here is a volunteer,

Sometimes it takes the right person to come across the question,
If you want it to use the same size image as in the product you can also change
SMALL_IMAGE_WIDTH
to
MEDIUM_IMAGE_WIDTH

17 Aug 2006, 12:36 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Why no support on this site - Sidebox image size question - need help please

aha ... more information ... that always helps.

Perhaps you can supply the URL where this is happening?

EDIT: I clicked on the links in your signature, and they took me elsewhere. Seems you need to update them. Typing them manually takes me to a Zen Cart v1.2.x site.
What are your settings for Proportional Images?

17 Aug 2006, 12:52 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Why no support on this site - Sidebox image size question - need help please

JLA,

I am just one of the community posters..but take issue with your Post title...

You post a specific Code question in "First Steps & General Customization Issues", and then expect immediate assistance...

You should have posted in a more appropriate area. JMO

17 Aug 2006, 1:00 AM
#7
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

Sorry but yesterday we made several posts in one thread and have made a few posts in the recent past - all of which went unanswered.

I do understand that there are all volunteers but after being around for awhile it seems that there responses were much quicker in the past.

I guess I just am used to the faster pace of some other projects and their support

I do apologize.

I fixed the signature - apparently it was messed up and went the same place all my private messages went when the board did the switch

As far as demo

We currently have box on our forum at http://www.jlaforums.com

that are pulling data from our store at http://www.jlaenterprises.net

We have one which is a 468X60 (which in the one we are having trouble with) and two more on the index page (one in the right side bar - scroll down) and the other on the left side bar further down

The two sidebar ones are functioning properly for the most part but we had to disable the image on the top one since we could not get the image to be smaller.

I will create a demo page with the suggest code change to show the image has not changed

Will post the link in a min

Thanks

Thanks

17 Aug 2006, 1:09 AM
#8
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

Ok

Here is a test page

http://www.jlaforums.com/test1.php

As you see, the image that appears is 100X80 even though we changed the code in the template (and yes, we are positive we used the correct template file - it was checked and double checked)

to this

$content .= '<div align="center"><a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(zen_get_small_image($random_whats_new_sidebox_product->fields['products_image']), $random_whats_new_sidebox_product->fields['products_name'], 50, 40) . '</a><br /><a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . $random_whats_new_sidebox_product->fields['products_name'] . '</a><br />' . $whats_new_price . '</div>';
?>

But as you can see on the test URL, it is displaying the product at 100X80 pixels

Not sure why this is

Also, looking to display more than 1 product. I assume that the code is here, but not sure what to change

switch (true) {
case (SHOW_NEW_PRODUCTS_LIMIT == '0'):
$display_limit = '';
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '1'):
$display_limit = " and date_format(p.products_date_added, '%Y%m') >= date_format(now(), '%Y%m')";
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '30'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 30';
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '60'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 60';
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '90'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 90';
break;
case (SHOW_NEW_PRODUCTS_LIMIT == '120'):
$display_limit = ' and TO_DAYS(NOW()) - TO_DAYS(p.products_date_added) <= 120';
break;
}

$random_whats_new_sidebox_product_query = "select SQL_CACHE p.products_id, p.products_image, p.products_tax_class_id, p.products_price
from " . TABLE_PRODUCTS . " p
where p.products_status = '1' and p.products_quantity >= '1' " . $display_limit . "
limit " . MAX_RANDOM_SELECT_NEW;

$random_whats_new_sidebox_product = zen_random_select($random_whats_new_sidebox_product_query);

if ($random_whats_new_sidebox_product->RecordCount() > 0 ) {
$whats_new_price = zen_get_products_display_price($random_whats_new_sidebox_product->fields['products_id']);
$random_whats_new_sidebox_product->fields['products_name'] = zen_get_products_name($random_whats_new_sidebox_product->fields['products_id']);
$random_whats_new_sidebox_product->fields['specials_new_products_price'] = zen_get_products_special_price($random_whats_new_sidebox_product->fields['products_id']);
require($template->get_template_dir('tpl_whats_new_banner1.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_whats_new_banner1.php');
$title = BOX_HEADING_WHATS_NEW;
$left_corner = false;
$right_corner = false;
$right_arrow = false;
$title_link = FILENAME_PRODUCTS_NEW;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);

}
?>

17 Aug 2006, 1:14 AM
#9
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: Why no support on this site - Sidebox image size question - need help please

JLA,

Point taken...but realize that when you post and also specify the solution that you want. i.e.> We do not want to change this in our admin but instead specify MANUALLY and image size here or use the image size used in the shopping cart
That this limits the number of individuals that can answer this.. You need some one who knows code with more expertise than you have. And I suppose that these are far and few between.

17 Aug 2006, 1:16 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Why no support on this site - Sidebox image size question - need help please

What are your settings for Proportional Images in Admin->Config->Images ?

17 Aug 2006, 1:21 AM
#11
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

DrByte:

What are your settings for Proportional Images in Admin->Config->Images ?

In "Image - Use Proportional Images on Products and Categories" it is set to 1

17 Aug 2006, 1:23 AM
#12
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

kobra:

JLA,

Point taken...but realize that when you post and also specify the solution that you want. i.e.
That this limits the number of individuals that can answer this.. You need some one who knows code with more expertise than you have. And I suppose that these are far and few between.

No problem - sorry to get impatient. And I do know about what you mean regarding the far and few between.

Thanks for answering.

17 Aug 2006, 1:29 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Why no support on this site - Sidebox image size question - need help please

JLA:

Also, looking to display more than 1 product. I assume that the code is here, but not sure what to changeYou'll need to rewrite most of the logic there, as both the query and the randomizer are built to return a single product. You might use the concepts in the upcoming-products or bestsellers sideboxes as an example for how to display more than one item here.

17 Aug 2006, 1:33 AM
#14
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

Here is a screenshot of what we are doing

The two areas circled in red (from https://www.jlaforums.com)

are two of the boxes we have placed

The one on the lower part is fine

We want to place in the top one the item with picture (but picture only 60 pixels tall) and would like to place two pictures

Also figure there is a way to change the limit on the items returned by the randomizer query to be two instead of 1.

Thanks

17 Aug 2006, 1:34 AM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Why no support on this site - Sidebox image size question - need help please

I've not seen your large image come up on any of the links you've provided; granted, if it's randomized, it may not show up frequently. Your forum site takes so long to load each screen, I don't care to look at it anymore refreshing repeatedly.

Please post all your settings in Admin->Configuration->Images.

17 Aug 2006, 1:35 AM
#16
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

DrByte:

You'll need to rewrite most of the logic there, as both the query and the randomizer are built to return a single product. You might use the concepts in the upcoming-products or bestsellers sideboxes as an example for how to display more than one item here.

Ok, I can take a look at those boxes and see the differences in the queries. You would happened to have any further insight on those changes would you?

The image problem is the biggest thing we would like to solve

Thanks

17 Aug 2006, 1:37 AM
#17
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

Images

Title Value Action
Small Image Width 100
Small Image Height 80
Heading Image Width 57
Heading Image Height 40
Subcategory Image Width 100
Subcategory Image Height 57
Calculate Image Size true
Image Required true
Image - Shopping Cart Status 1
Image - Shopping Cart Width 50
Image - Shopping Cart Height 40
Show uploaded images in cart false
Clone Image Dir Owner false
Large Image Maximum Width
Large Image Maximum Height
Product Info - Image Width 150
Product Info - Image Height 120
Product Info - Image Medium Suffix _MED
Product Info - Image Large Suffix _LRG
Small image filetype no_change
Small image background white
Watermark small images False
Small image compression quality 75
Medium image filetype no_change
Medium image background white
Watermark medium images False
Medium image compression quality 75
Large image filetype no_change
Large image background white
Watermark large images True
Large image compression quality 100
Watermark Gravity Center
Select Image Manager GD
ImageMagick path /usr/bin/
ImageMagick library path
Image - Product Listing Width 100
Image - Product Listing Height 80
Image - Product New Listing Width 100
Image - Product New Listing Height 80
Image - New Products Width 100
Image - New Products Height 80
Image - Featured Products Width 100
Image - Featured Products Height 80
Image - Product All Listing Width 100
Image - Product All Listing Height 80
Product Info - Number of Additional Images per Row 3
Product Image - No Image Status 1
Product Image - No Image picture no_picture.gif
Image - Use Proportional Images on Products and Categories 1

Those are the settings

17 Aug 2006, 1:39 AM
#18
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

DrByte:

I've not seen your large image come up on any of the links you've provided; granted, if it's randomized, it may not show up frequently. Your forum site takes so long to load each screen, I don't care to look at it anymore refreshing repeatedly.

Please post all your settings in Admin->Configuration->Images.

The image that is appearing on http://www.jlaforums.com/test1.php

Is the small image size of 100X80

Even when changed to 50, 40 it still showing at 100X80

17 Aug 2006, 1:39 AM
#19
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Why no support on this site - Sidebox image size question - need help please

JLA:

Thank You very much for responding

I did change this to the figure as you suggested and it still just displayed the image the other size (100X80)

I changed it to 50X40

Not sure what is causing the problem

On a fresh install of Zen Cart, I changed this code from includes/templates/MYTEMPLATE/sideboxes/tpl_whats_new.php:```php
$random_whats_new_sidebox_product->fields['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)

to:
```php
$random_whats_new_sidebox_product->fields['products_name'], 15, 15)
```and I get an image that's 15x15.
17 Aug 2006, 1:44 AM
#20
jla avatar

jla

Zen Follower

Join Date:
Jul 2005
Posts:
128
Plugin Contributions:
0

Re: Why no support on this site - Sidebox image size question - need help please

This is the entire text of the template file that is being called for this test at http://www.jlaforums.com/test1.php

<?php // // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | <http://www.zen-cart.com/index.php> | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | <http://www.zen-cart.com/license/2_0.txt>. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | [[email protected]](mailto:[email protected]) so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: tpl_whats_new.php,v 1.1.2.2 2005/05/21 21:05:42 tim Exp $ // $content = ""; $content .= '<div align="center"><a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . zen_image(zen_get_small_image($random_whats_new_sidebox_product->fields['products_image']), $random_whats_new_sidebox_product->fields['products_name'], 50, 40) . '</a><br /><a href="' . zen_href_link(zen_get_info_page($random_whats_new_sidebox_product->fields['products_id']), 'products_id=' . $random_whats_new_sidebox_product->fields['products_id']) . '">' . $random_whats_new_sidebox_product->fields['products_name'] . '</a><br />This text added to show we use correct template<br />' . $whats_new_price . '</div>'; ?>