cchhita Posted January 2, 2007 Posted January 2, 2007 Hi Everyone. I am creating a website that sells watches and am using Oscommerce. There is one feature that has totally eluded me so far and I need some help!! Many of the watches have the same features, i.e. Alarm, 12/24 hour display, Light etc etc. I was wondering if there was a module of any kind that will give me tick boxes or drop down boxes so I can quickly add them to each product description instead of typing them in for every watch I add!! Also, going one step further from this, I would like to made these features displayed as little symbols or images. My customers would already be familiar with the symbols that represent an alarm, light 12/24 hour display etc. Can anyone help me out? If so, I would greatly appreciate it! Thanks
xXDesertRoseXx Posted January 2, 2007 Posted January 2, 2007 You can use the attributes copier module Rose The strong survive BUT the best succeed !! 1064 - You have an error in your SQL syntax
pafranklin Posted January 2, 2007 Posted January 2, 2007 Hi Everyone.I am creating a website that sells watches and am using Oscommerce. There is one feature that has totally eluded me so far and I need some help!! Many of the watches have the same features, i.e. Alarm, 12/24 hour display, Light etc etc. I was wondering if there was a module of any kind that will give me tick boxes or drop down boxes so I can quickly add them to each product description instead of typing them in for every watch I add!! Also, going one step further from this, I would like to made these features displayed as little symbols or images. My customers would already be familiar with the symbols that represent an alarm, light 12/24 hour display etc. Can anyone help me out? If so, I would greatly appreciate it! Thanks Attribute sets would be well worth a look as this saved me huge amounts of time. This can be seen here.... http://www.oscommerce.com/community/contri...attributes+sets Alternatively there is a contrib called Attribute sets Plus which also looks as though it may fit your purpose http://www.oscommerce.com/community/contri...ibute+sets+plus You will never learn if you don't try. And boy am I trying....!
cchhita Posted January 5, 2007 Author Posted January 5, 2007 Hi, Thanks for the reply. I am not sure if I made myself clear on this one :( I had a look at the attribute sets and copier, but all that does is gives me the Item I want i.e. Contains Alarm..... and then a drop down box!! I would like to simply have a list of attributes (without drop down boxes next to them), that I can select from for each product. EG. Watch W342 has a 10 year battery life, alarm and 12/24 hour display Watch w325 has a 10 year battery life, and alarm Watch w455 has 10 year battery life...... I would like a list that I could select '10 year battery life' and allocate this description to multiply products, and have it show up in the items description. The attribute sets are great if you want the customer to choose sizes, colours etc, but I dont think it does what I want. Any more suggestions? Cheers
Guest Posted January 5, 2007 Posted January 5, 2007 You could add the Extra Fields contrib to your site, and simply add additional attributes as is needed, eg "Alarm", "Battery Life", etc.. After installing the contrib, put in the extra attributes as are needed in the admin panel. Then, you go visit one of your products, and view its source. It should look something like this: <tr bgcolor="#FFFFF"> <td class="main">Alarm:</td> <td class="main"><img src="images/pixel_trans.gif" border="0" alt="" width="24" height="15"> <input type="text" name="extra_field[8]" value="Yes" size="50"></td> </tr> Keep note of the name of the input tag (in the case above its "extra_field[8]"). Go edit the categories.php file in your ADMIN/ subdirectory. And right after the extra fields addition, put this in: <tr> <td class="main"><?php echo 'Alarm'; ?></td> <td class="main"><?php echo '<select name="extra_field[8]"><option value="Mild">A mild alarm</option><option value="Annoying">An annoying alarm</option><option value="Ear Piercing">Ear Piercing!</option></select>'; ?></td> </tr> This'll give you a dropdown menu of 3 options you can select to display, Mild, Annoying, or Ear Piercing. Just set it to anything you want, and how many you want. Voila. I installed Extra Fields v 2.0j by the way.
Guest Posted January 5, 2007 Posted January 5, 2007 As to the images for attributes thing, I solved this by going to the products_info.php file in the root directory, and placing extra codes to check if a particular value exists in the extra_fields array. I first separated the name from the value into two arrays, which I can convienently call later at my pleasure. Example: while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { if (! $extra_fields['status']) // show only enabled extra field continue; $i++; $info_attrib[$i]=$extra_fields['name']; $info_value[$i]=$extra_fields['value']; } So for example: $info_attrib[1] = Alarm $info_value[1] = Yup $info_attrib[2] = Date $info_value[2] = Yup etc.. I then set a basic if then else thing exactly where I wanted it in the page, and displayed the icon appropriately. Here's an example: if (eregi("(Alarm)", $info_name[1])) {echo '<img src="images/icon1.gif" alt="This Gadget has an alarm" title="alarm">';} The eregi is there in case I use it for the $info_value array, sometimes I have lots of features I put in like "rubbery, fetish, chains, pierce, etc..". Using the "eregi" thing, I can ask whether it has "fetish" or "pierce" or any string I want to locate easily. You can view it in action in my site, I used icons to display features from the gadgets I list.
cchhita Posted January 7, 2007 Author Posted January 7, 2007 Hi Uncle Bob, Thanks for the reply! I have tried to install this Contribution, but with no success! It broke my site, so I had to restore the backup. I am using oscommerce-2.2ms2-051113 which was part of a templatemonster.com template! So unfortunately I am stuck with this version becuase it contains the template I want to use. I am guessing this is the reason why that contribution keeps breaking the site! I will see if I can manually install this. Thanks
cchhita Posted January 11, 2007 Author Posted January 11, 2007 Hi Unclebob, I have managed to get the Contribution to work! I like your idea of having a drop down box with options, but is it possible to simply have a tick box? When I tried to do what you suggested with the Drop down box, for some reason It came up with Alarm twice in the admin section. It had 'Alarm:' with an empty text box next to it. And further down the page, it had 'Alarm:" with a drop down box with the options I added :( I.e. If the box is ticked, it will come up with 'Alarm' in the description. If not, nothing is displayed. This would work much better for my purposes. Any idea on how this can be done? Thanks in advance
Guest Posted January 11, 2007 Posted January 11, 2007 Yes it comes up twice, the first time via the Extra Fields Contrib, and the second by your addition. It should be harmless because you're entering the values further down the page. But you can take the extra one away if you want. Just put an extra condition in the Extra Fields addition above to look for a certain attribute to ignore, and therefore place a space. Like so (just update this section in yoy admin/categories.php file, don't add the whole thing again :)): <?php // START: Extra Fields Contribution (chapter 1.4) // Sort language by ID for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $languages_array[$languages[$i]['id']]=$languages[$i]; } $extra_fields_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_EXTRA_FIELDS . " ORDER BY products_extra_fields_order"); while ($extra_fields = tep_db_fetch_array($extra_fields_query)) { // Display language icon or blank space if ($extra_fields['languages_id']==0 && $extra_fields['products_extra_fields_name']=='Alarm') { $m=tep_draw_separator('pixel_trans.gif', '24', '15'); } else $m= tep_image(DIR_WS_CATALOG_LANGUAGES . $languages_array[$extra_fields['languages_id']]['directory'] . '/images/' . $languages_array[$extra_fields['languages_id']]['image'], $languages_array[$extra_fields['languages_id']]['name']); ?> <tr bgcolor="#ebebff"> <td class="main"><?php echo $extra_fields['products_extra_fields_name']; ?>:</td> <td class="main"><?php echo $m . ' ' . tep_draw_input_field("extra_field[".$extra_fields['products_extra_fields_id']."]", $pInfo->extra_field[$extra_fields['products_extra_fields_id']], 'size="50"'); ?></td> </tr> <?php } // END: Extra Fields Contribution ?> To get a checkbox style arrangement, you can tweak the HTML script a bit: <tr> <td class="main"><?php echo 'Alarm'; ?></td> <td class="main"><?php echo '<input type="radio" name="extra_field[8]" value="" CHECKED >No Alarm<br><input type="radio" name="extra_field[8]" value="Available">Alarm available'; ?></td> </tr> I haven't tested this one yet, but with a null value, it shouldn't be displayed on your page. Personally I'd place a "None" there so it'd be less confusing, but thats just me :).
Recommended Posts
Archived
This topic is now archived and is closed to further replies.