Okay, I have my website up for selling sheds on, and I have an option for shingle color. Each of the option values has an image for the color of each shingle type.
Zencart was showing these image swatches in a vertical line, and I was really unhappy with it, and started researching how to change this. I found this thread here but it didn't seem to help. So, being a hobbyist programmer, I started searching and experimenting with the PHP files and finally found where I could change a line to remove "<br class="clearBoth>" from between the image swatches to display them side-by-side:
Where I finally found this change to make was in the "/includes/modules/attributes.php" file. Line 478 has the text:
$tmp_attributes_image .= '<br class="clearBoth">' . "\n";
Here is the section of code starting about line 470:
Code:
// collect attribute image if it exists and to be drawn in table below
if ($products_options_names->fields['products_options_images_style'] == '0' or ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT or $products_options_names->fields['products_options_type'] == '0') ) {
if ($products_options->fields['attributes_image'] != '') {
$tmp_attributes_image_row++;
// if ($tmp_attributes_image_row > PRODUCTS_IMAGES_ATTRIBUTES_PER_ROW) {
if ($tmp_attributes_image_row > $products_options_names->fields['products_options_images_per_row']) {
$tmp_attributes_image .= '<br class="clearBoth">' . "\n";
$tmp_attributes_image_row = 1;
}
$tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $products_options->fields['products_options_values_name'] : '') . '</div>' . "\n";
}
}
Change it like this:
Code:
// collect attribute image if it exists and to be drawn in table below
if ($products_options_names->fields['products_options_images_style'] == '0' or ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_FILE or $products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_TEXT or $products_options_names->fields['products_options_type'] == '0') ) {
if ($products_options->fields['attributes_image'] != '') {
$tmp_attributes_image_row++;
// if ($tmp_attributes_image_row > PRODUCTS_IMAGES_ATTRIBUTES_PER_ROW) {
if ($tmp_attributes_image_row > $products_options_names->fields['products_options_images_per_row']) {
$tmp_attributes_image .= "\n";
$tmp_attributes_image_row = 1;
}
$tmp_attributes_image .= '<div class="attribImg">' . zen_image(DIR_WS_IMAGES . $products_options->fields['attributes_image']) . (PRODUCT_IMAGES_ATTRIBUTES_NAMES == '1' ? '<br />' . $products_options->fields['products_options_values_name'] : '') . '</div>' . "\n";
}
}
Be sure to remove the "." before the "\n"; . If you forget that, the compiler won't run the page.
Bookmarks