osCmax v2.5 User Manual
Results 1 to 3 of 3

Make attributes an image instead of text

This is a discussion on Make attributes an image instead of text within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; I've been trying to find a contribution that lets you make your attributes be shown on the product description page(s) ...

      
  1. #1
    New Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    0


    Default Make attributes an image instead of text

    I've been trying to find a contribution that lets you make your attributes be shown on the product description page(s) as an image instead of the word or text....like a red color swatch instead of the word 'red' would be next to the radio box/checkbox. I've found this contribution and it allows only the text....the code is posted below....from looking at the code is there a way to make the attributes an image instead of a word?
    open and edit catalog/product_info.php

    find:


    <td class="main" colspan="2"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>


    replace with:

    <td class="main" colspan="2"><?php echo tep_draw_radio_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>

    ================================================== =====================

    edit catalog/includes/functions/html_output.php
    add this new function tep_draw_radio_menu

    add this in somewhere before the final ?>

    ////
    // Output a form radio menu for product info page maniac101
    function tep_draw_radio_menu($name, $values, $default = '', $parameters = '', $required = false) {
    $field ='<table border="0" cellspacing="0" cellpadding="0"><tr><td class="main">';
    if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);

    for ($i=0, $n=sizeof($values); $i<$n; $i++) {
    $value = tep_output_string($values[$i]['id']);
    $field .= '<input type="radio" name="' . $name . '" value="' . $value . '"';
    if ($i == 0) $field .= ' checked';

    $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '&quot;', ''' => ''', '<' => '&lt;', '>' => '&gt;')) . '<br />';
    }
    $field .= '</td></tr></table>';

    if ($required == true) $field .= TEXT_FIELD_REQUIRED;

    return $field;
    }

    ////
    Here is what the products listing page looks like. I want to change the text (32mb, etc) to an image....

  2. #2
    osCMax Development Team
    ridexbuilder's Avatar
    Join Date
    Jul 2008
    Location
    Haggisland
    Posts
    3,014
    Rep Power
    36


    Lightbulb Re: Make attributes an image instead of text

    Google is your friend - oscommerce attributes as images.
    Hosting plans with installation, configuration, contributions, support and maintenance.

  3. #3
    New Member
    Join Date
    Mar 2010
    Posts
    10
    Rep Power
    0


    Default Re: Make attributes an image instead of text

    I have been looking but the 1 that I found were a little "iffy"....one was written by someone who really had no clue what they were doing....words were spelled wrong and pieces of code were not right.....I'll try to find another one....

Similar Threads

  1. How to make Product Titles text wrap?
    By Marotta1 in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 07-13-2008, 12:30 PM
  2. how to make the image on product page
    By johnkwok in forum osCMax v2 Features Discussion
    Replies: 0
    Last Post: 05-20-2006, 01:55 PM
  3. no text field in attributes - please help!
    By johnr3 in forum osCmax v2 Installation issues
    Replies: 4
    Last Post: 05-16-2006, 09:47 AM
  4. Make the mainpage text allign to the top of the page.
    By chrisrex in forum osCmax v2 Customization/Mods
    Replies: 3
    Last Post: 10-28-2005, 09:06 AM
  5. please help! why are product attributes in a text box
    By thinkweb in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 01-29-2005, 12:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •