Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

manufacturer image


ce7

Recommended Posts

hi

I have phoenix 1075, modified the manufacturer infobox code so that the manufacturer logo/image will show up,

$manufacturers_list .= '<a class="list-group-item list-group-item-action" href="' . tep_href_link('index.php', 'manufacturers_id=' . $manufacturers['manufacturers_id']) . '">' . tep_image('images/' . $manufacturers['manufacturers_image'], $manufacturers['manufacturers_name'], $width_manuf, $height_manuf) . '&nbsp;' . $manufacturers_name . '</a>';


image.png.4e3793c9ab41ed38658fca3ac06da7b8.png
however if it is more then 9 manufacturers, it will turn into the dropdown list,
even the code for the manufacturers list is with image code but the image will not show up,
image.png.1581f8029dabfa3b82bf26aeeda4fd88.png
for the drop down menu code, i have added 'image' => $manufacturers['manufacturers_image'],

            $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
                                           'image' => $manufacturers['manufacturers_image'],
                                           'text' => $manufacturers['manufacturers_name']); 


but it is still no image to show up, do i need to change any code for this? how to modify the code so that image in the dropdown list will show up? (ideally image show up on the left of the manufacturer name)

                $data .= tep_draw_pull_down_menu('manufacturers_id', $manufacturers_array, (isset($_GET['manufacturers_id']) ? $_GET['manufacturers_id'] : ''), 'onchange="this.form.submit();" style="width: 100%"') . tep_hide_session_id();

 

Link to comment
Share on other sites

The code for the dropdown will ignore the image so adding it to the array won't help. I think changing this line

'text' => $manufacturers['manufacturers_name']);

to this should work though I haven't tested it.

'text' => $manufacturers['manufacturers_image'] . ' ' . $manufacturers['manufacturers_name']);

 

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

hi Jack @Jack_mcs,

Thank you very much for reply.

after you mentioned it will ignore image, I google and read some posts that said that pull down function only check string.

	////
// Output a form pull down menu
  function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
    $field = '<select name="' . tep_output_string($name) . '"';
	    if (tep_not_null($parameters)) $field .= ' ' . $parameters;
	    $field .= ' class="form-control">';
	    if (empty($default)) {
      if (is_string($_GET[$name] ?? null)) {
        $default = stripslashes($_GET[$name]);
      } elseif (is_string($_POST[$name] ?? null)) {
        $default = stripslashes($_POST[$name]);
      }
    }
	    foreach ($values as $value) {
      $field .= '<option value="' . tep_output_string($value['id']) . '"';
      if ($default == $value['id']) {
        $field .= ' selected="selected"';
      }
	      $field .= '>' . tep_output_string($value['text'], ['"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;']) . '</option>';
    }
    $field .= '</select>';
	    if ($required == true) $field .= TEXT_FIELD_REQUIRED;
	    return $field;
  }
	

so is it possible i create function tep_draw_pull_down_menu2 that can show image, do I use <option> </option> so that it can take images?
Any suggestion of how to modify the function?

Link to comment
Share on other sites

Yes, it is possible. As mentioned, I haven't tried it so there may be something else needed to make it work in oscommerce.  But there are many examples of it on the web. Here is one you can probably use.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...