Jump to content

jacenstuff

Members
  • Content count

    153
  • Joined

  • Last visited

1 Follower

About jacenstuff

  • Birthday 03/03/1981

Profile Information

  • Real Name
    Jacen Andrews
  • Location
    Sunnyside, NY
  • Interests
    Paintball, Technology, Snowboarding, Gaming, Warhammer 40K, Guitar and Skateboarding
  • Website
  1. jacenstuff

    Automatically send data feed to Froogle

    The only file missing from the package is the googlefeeder.php file. Is there a place to get the latest, complete php file? The instructions seem easy to follow by the way, can't wait to try this out.
  2. I use this and contrib and was planning on using Options as Images as well, However when I turn on options as images, the Option Type Feature ceases to work, giving me dropdown list rather then text boxes. Why would this occur? I highly doubt that one could affect the other.
  3. jacenstuff

    [CONTRIB] Options as Images for MS2

    I thought I covered all the steps, either that or I made a typo in that file, but I fixed it regardless i hope. I'm gonna look into the display aspects in a bit. yeah, keep me up to date if you solve it first :) and the dropdown images would be AWESOME...no clue how to do it though. Maybe if there was a database entry for a dropdown list with images instead of text? I know nothing about databases... I guess I'll take a closer look at how this works, and see if I can switch where it creates a radio button, to a dropdown menu.
  4. I was jsut looking voer the .sql files I used to install the contrib and I did not notice sucha field to be created int he database. However, pouring over the instructions I posted earlier for you, you'll notice it in there, but it's not referring to the database as it's a value within the PHP code. Here is the SQL scripts I used for the contrib, psoted below. Compare them to yours to see if there are any differences: ALTER TABLE products_options ADD products_options_type INT( 5 ) NOT NULL , ADD products_options_length SMALLINT( 2 ) DEFAULT '32' NOT NULL , ADD products_options_comment VARCHAR( 32 ); ALTER TABLE customers_basket_attributes ADD products_options_value_text text; INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 1, 'TEXT'); INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 2, 'TEXT'); INSERT INTO products_options_values (products_options_values_id, language_id, products_options_values_name) VALUES (0, 3, 'TEXT'); those are what iw as working with. I hope this helps you, even if it's just a little bit.
  5. jacenstuff

    [CONTRIB] Options as Images for MS2

    Okay scratch all that I figured out what to do. After careful examining, the instructions for install were incorrect(at least, they did not work for me) in catalog/admin/includes/boxes/catalog.php it says to : In the file /admin/includes/boxes/catalog.php find this line:- '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' . and add this after it:- '<a href="' . tep_href_link(FILENAME_OPTIONS_IMAGES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_OPTIONS_IMAGES . '</a><br>' . the whole, "FILENAME_OPTIONS_IMAGES," does not work for me, what I did was replace that tiny piece with: 'options_images.php' and it loaded without an issue. so now I can access it, but if I tried to sift through the options in the dropdown list I got the SAME EXACT ERROR, so I figured take what I just did as a fix and apply the same thing to the options_images.php file itself. So booted up my fave editor (Gedit in Debian) and did a search for anything saying FILENAME_OPTIONS_IMAGES and told it to replace it with 'options_images.php' (for those unfamiliar with PHP that are being adventurous and fixing it yourself, first off, good for you, second off, the quotes are very important). That fixed EVERYTHING now all is well. So I fixed my problems, thanks guys. now I have a new question.... -Without messing up my store through tinkering too much, can someone explain to me how to manipulate the display of the images? Was thinking of spacing out the images a bit more. -second question, is there a way to make a dropdown list of available options with images and titles(or even jsut images alone) in the dropdown list? I wanted to sell different colored items and have swatches of the colors in a dropdown list. So you'd see a small rectangle or red,blue,green etc. to choose from ina droplist, to save space on the product info page. thanks in advance for any assistance thats headed my way :)
  6. jacenstuff

    [CONTRIB] Options as Images for MS2

    btw I forgot to mention that /shop/TheFort/ is my admin dir.
  7. jacenstuff

    [CONTRIB] Options as Images for MS2

    Just installed this contrib. on the customer end, everything seems fine(haven't activated it yet though). but on the admin side, I went to check out what options were available, see how it works, etc.... and under the categories box, I go to click "Option as Images" and I get : Not Found The requested URL /shop/TheFort/FILENAME_OPTIONS_IMAGES was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. I looked over the code in /admin/includes/boxes/catalog.php and it seems correct, and I checked to make sure Options_images.php in /admin existed and it's there... so what gives?
  8. I'm not that great with the technical backend. I know very little about PHP,javascript and even LESS about database stuff. I just followed directions to the T, but the directions I downloaded seperately from the contrib, and after I followed those, I ran the SQL file that came with the contrib ONCE. I'm about to paste the manual instructions I used, I know there is one typo, and I think it's in the list of which files to modify(think it says product_attribute.php rather than product_attributes.php[notice the plural of attribute]). So try these instructions while installing 1.7.2 of the Option Type Feature, and run the sql file included with that. Mine worked out of the box. I hope it does for you too if you try this. l8er : Product Attributes - Option Type Feature (manual installation) This file was created to allow the manual addition of "Product Attributes - Option Type Feature" Contribution for OsCommerce. The original contribution was created by Chandra Roukema <chandra@OpenStoreSolutions.com> This file is dated 28th August 2006 and was created with OsCommerce 2.2 Milestone 2 060817 by PD_Steve Files to modify /catalog/checkout_process.php /catalog/product_info.php /catalog/shopping_cart.php /catalog/stylesheet.css /catalog/includes/configure/php /catalog/includes/classes/order.php /catalog/includes/classes/shopping_cart.php /catalog/includes/functions/general.php /catalog/admin/product_attibutes.php /catalog/admin/includes/languages/english/product_attributes.php (where 'catalog' is your install directory) NOTE: AT THIS POINT YOU SHOULD BACK UP YOUR COMPLETE DATABASE AND ALL OSCOMMERCE FILES. THIS IS A VERY COMPLEX INSTALLATION AND THINGS MAY GO WRONG. ---------------------------------------------------------------- INSTALLATION ---------------------------------------------------------------- Open /catalog/checkout_process.php ----------------------- FIND: (around line 199) 'products_options_values' => $attributes_values['products_options_values_name'], REPLACE with 'products_options_values' => $order->products[$i]['attributes'][$j]['value'], ----------------------- FIND: (around line 211) $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . $attributes_values['products_options_values_name']; REPLACE with $products_ordered_attributes .= "\n\t" . $attributes_values['products_options_name'] . ' ' . tep_decode_specialchars($order->products[$i]['attributes'][$j]['value']); ---------------------------------------------------------------- Open /catalog/product_info.php ---------------------- FIND: (around line 27) <script language="javascript"> function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } ADD BELOW: /* DDB - 041031 - Form Field Progress Bar */ /*********************************************** * Form Field Progress Bar- By Ron Jonk- http://www.euronet.nl/~jonkr/ * Modified by Dynamic Drive for minor changes * Script featured/ available at Dynamic Drive- http://www.dynamicdrive.com * Please keep this notice intact ***********************************************/ function textCounter(field,counter,maxlimit,linecounter) { // text width// var fieldWidth = parseInt(field.offsetWidth); var charcnt = field.value.length; // trim the extra text if (charcnt > maxlimit) { field.value = field.value.substring(0, maxlimit); } else { // progress bar percentage var percentage = parseInt(100 - (( maxlimit - charcnt) * 100)/maxlimit); document.getElementById(counter).style.width = parseInt((fieldWidth*percentage)/100)+"px"; document.getElementById(counter).innerHTML="Limit: "+percentage+"%" // color correction on style from CCFFF -> CC0000 setcolor(document.getElementById(counter),percentage,"background-color"); } } function setcolor(obj,percentage,prop){ obj.style[prop] = "rgb(80%,"+(100-percentage)+"%,"+(100-percentage)+"%)"; } ---------------------- FIND: (around line 157) <?php $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { REPLACE with: <?php //clr 030714 update query to pull option_type $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name, popt.products_options_type, popt.products_options_length, popt.products_options_comment from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name"); while ($products_options_name = tep_db_fetch_array($products_options_name_query)) { //clr 030714 add case statement to check option type switch ($products_options_name['products_options_type']) { case PRODUCTS_OPTIONS_TYPE_TEXT: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $tmp_html = '<input type="text" name ="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" size="' . $products_options_name['products_options_length'] .'" maxlength="' . $products_options_name['products_options_length'] . '" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] .'"> ' . $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .')'; } ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_TEXTAREA: //CLR 030714 Add logic for text option $products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); $tmp_html = '<textarea onKeyDown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onKeyUp="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" onFocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" wrap="soft" name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" rows=5 id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" value="' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '"></textarea> <div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div> <script>textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?> <!-- DDB - 041031 - Form Field Progress Bar //--> <tr> <?php if ($products_attribs_array['options_values_price'] != '0') { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ' ' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . ')'; ?></td> <?php } else { ?> <td class="main"><?php echo $products_options_name['products_options_name'] . '<br>(' . $products_options_name['products_options_comment'] . ')'; ?></td> <?php } ?> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_RADIO: //CLR 030714 Add logic for radio buttons $tmp_html = '<table>'; $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . $products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . $languages_id . "'"); $checked = true; while ($products_options_array = tep_db_fetch_array($products_options_query)) { $tmp_html .= '<tr><td class="main">'; $tmp_html .= tep_draw_radio_field('id[' . $products_options_name['products_options_id'] . ']', $products_options_array['products_options_values_id'], $checked); $checked = false; $tmp_html .= $products_options_array['products_options_values_name']; $tmp_html .=$products_options_name['products_options_comment']; if ($products_options_array['options_values_price'] != '0') { $tmp_html .= '(' . $products_options_array['price_prefix'] . $currencies->display_price($products_options_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } $tmp_html .= '</tr></td>'; } $tmp_html .= '</table>'; ?> <tr> <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td> <td class="main"><?php echo $tmp_html; ?></td> </tr> <?php break; case PRODUCTS_OPTIONS_TYPE_CHECKBOX: //CLR 030714 Add logic for checkboxes $products_attribs_query = tep_db_query("select distinct patrib.options_values_id, patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'"); $products_attribs_array = tep_db_fetch_array($products_attribs_query); echo '<tr><td class="main">' . $products_options_name['products_options_name'] . ': </td><td class="main">'; echo tep_draw_checkbox_field('id[' . $products_options_name['products_options_id'] . ']', $products_attribs_array['options_values_id']); echo $products_options_name['products_options_comment']; if ($products_attribs_array['options_values_price'] != '0') { echo '(' . $products_attribs_array['price_prefix'] . $currencies->display_price($products_attribs_array['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } echo '</td></tr>'; break; default: //clr 030714 default is select list //clr 030714 reset selected_attribute variable $selected_attribute = false; ---------------------- FIND: (around line 264) <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> </tr> <?php } ?> REPLACE with <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute) . $products_options_name['products_options_comment']; ?></td> </tr> <?php } //clr 030714 end switch } //clr 030714 end while ?> ---------------------------------------------------------------- Open catalog/shopping_cart.php ---------------------- FIND: (around line 81) echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); REPLACE with (comment out) //clr 030714 move hidden field to if statement below //echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); ---------------------- FIND: (around line 92) $attributes_values = tep_db_fetch_array($attributes); ADD BELOW: //clr 030714 determine if attribute is a text attribute and assign to $attr_value temporarily if ($value == PRODUCTS_OPTIONS_VALUE_TEXT_ID) { echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . TEXT_PREFIX . $option . ']', $products[$i]['attributes_values'][$option]); $attr_value = $products[$i]['attributes_values'][$option]; } else { echo tep_draw_hidden_field('id[' . $products[$i]['id'] . '][' . $option . ']', $value); $attr_value = $attributes_values['products_options_values_name']; } FIND: (around line 95) $products[$i][$option]['products_options_values_name'] = $attributes_values['products_options_values_name']; REPLACE with: //clr 030714 assign $attr_value $products[$i][$option]['products_options_values_name'] = $attr_value; ---------------------------------------------------------------- Open catalog/stylesheet.css ADD AT END OF FILE: /* DDB - 041031 - Form Field Progress Bar */ .progress{ width: 1px; height: 14px; color: white; font-size: 12px; overflow: hidden; background-color: navy; padding-left: 5px;} } ---------------------------------------------------------------- Open catalog/includes/configure.php ADD BEFORE ENDING ?> // CLR 020605 defines needed for Product Option Type feature. define('PRODUCTS_OPTIONS_TYPE_SELECT', 0); define('PRODUCTS_OPTIONS_TYPE_TEXT', 1); define('PRODUCTS_OPTIONS_TYPE_RADIO', 2); define('PRODUCTS_OPTIONS_TYPE_CHECKBOX', 3); define('PRODUCTS_OPTIONS_TYPE_TEXTAREA', 4); define('TEXT_PREFIX', 'txt_'); define('PRODUCTS_OPTIONS_VALUE_TEXT_ID', 0); //Must match id for user defined "TEXT" value in db table TABLE_PRODUCTS_OPTIONS_VALUES ---------------------------------------------------------------- Open catalog/includes/class/order.php ----------------------- FIND: (around line 232) $attributes = tep_db_fetch_array($attributes_query); ADD BELOW: //clr 030714 Determine if attribute is a text attribute and change products array if it is. if ($value == PRODUCTS_OPTIONS_VALUE_TEXT_ID){ $attr_value = $products[$i]['attributes_values'][$option]; } else { $attr_value = $attributes['products_options_values_name']; } ----------------------- FIND: (around line 240) 'value' => $attributes['products_options_values_name'], REPLACE with 'value' => $attr_value, ---------------------------------------------------------------- Open catalog/includes/class/shopping_cart.php ---------------------- FIND: (around line 36) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "')"); REPLACE with //clr 031714 udate query to include attribute value. This is needed for text attributes. $attr_value = $this->contents[$products_id]['attributes_values'][$option]; tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')"); ---------------------- FIND: (around line 52) $attributes_query = tep_db_query("select products_options_id, products_options_value_id from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'"); REPLACE with //CLR 020606 update query to pull attribute value_text. This is needed for text attributes. $attributes_query = tep_db_query("select products_options_id, products_options_value_id, products_options_value_text from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products['products_id']) . "'"); ---------------------- FIND: (around line 54) while ($attributes = tep_db_fetch_array($attributes_query)) { $this->contents[$products['products_id']]['attributes'][$attributes['products_options_id']] = $attributes['products_options_value_id']; ADD BELOW //CLR 020606 if text attribute, then set additional information if ($attributes['products_options_value_id'] == PRODUCTS_OPTIONS_VALUE_TEXT_ID) { $this->contents[$products['products_id']]['attributes_values'][$attributes['products_options_id']] = $attributes['products_options_value_text']; } ---------------------- FIND: (around line 88) $products_id_string = tep_get_uprid($products_id, $attributes); $products_id = tep_get_prid($products_id_string); if (is_numeric($products_id) && is_numeric($qty)) { $check_product_query = tep_db_query("select products_status from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $check_product = tep_db_fetch_array($check_product_query); if (($check_product !== false) && ($check_product['products_status'] == '1')) { REPLACE with $products_id = tep_get_uprid($products_id, $attributes); ---------------------- FIND: (around line 97) if ($this->in_cart($products_id_string)) { $this->update_quantity($products_id_string, $qty, $attributes); } else { $this->contents[$products_id_string] = array('qty' => $qty); REPLACE with if ($this->in_cart($products_id)) { $this->update_quantity($products_id, $qty, $attributes); } else { $this->contents[] = array($products_id); $this->contents[$products_id] = array('qty' => $qty); ---------------------- FIND: (around line 99) if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') . "')"); REPLACE with if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "')"); ----------------------- FIND: (around line 105) $this->contents[$products_id_string]['attributes'][$option] = $value; REPLACE with //CLR 020606 check if input was from text box. If so, store additional attribute information //CLR 020708 check if text input is blank, if so do not add to attribute lists //CLR 030228 add htmlspecialchars processing. This handles quotes and other special chars in the user input. $attr_value = NULL; $blank_value = FALSE; if (strstr($option, TEXT_PREFIX)) { if (trim($value) == NULL) { $blank_value = TRUE; } else { $option = substr($option, strlen(TEXT_PREFIX)); $attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES); $value = PRODUCTS_OPTIONS_VALUE_TEXT_ID; $this->contents[$products_id]['attributes_values'][$option] = $attr_value; } } if (!$blank_value) { $this->contents[$products_id]['attributes'][$option] = $value; ----------------------- FIND: (around line 106) if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$option . "', '" . (int)$value . "')"); REPLACE with //CLR 020606 update db insert to include attribute value_text. This is needed for text attributes. //CLR 030228 add tep_db_input() processing if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " (customers_id, products_id, products_options_id, products_options_value_id, products_options_value_text) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . (int)$option . "', '" . (int)$value . "', '" . tep_db_input($attr_value) . "')"); } ----------------------- FIND: (around line 117) // assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure $this->cartID = $this->generate_cart_id(); } } } REPLACE with // assign a temporary unique ID to the order contents to prevent hack attempts during the checkout procedure $this->cartID = $this->generate_cart_id(); } ----------------------- FIND: (around line 123) $products_id_string = tep_get_uprid($products_id, $attributes); $products_id = tep_get_prid($products_id_string); REPLACE with if (empty($quantity)) return true; // nothing needs to be updated if theres no quantity, so we return true.. ----------------------- FIND: (around line 126) if (is_numeric($products_id) && isset($this->contents[$products_id_string]) && is_numeric($quantity)) { $this->contents[$products_id_string] = array('qty' => $quantity); REPLACE with $this->contents[$products_id] = array('qty' => $quantity); ----------------------- FIND: (around line 128) if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); REPLACE with if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET . " set customers_basket_quantity = '" . $quantity . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "'"); ----------------------- FIND: (around line 133) $this->contents[$products_id_string]['attributes'][$option] = $value; REPLACE with //CLR 020606 check if input was from text box. If so, store additional attribute information //CLR 030108 check if text input is blank, if so do not update attribute lists //CLR 030228 add htmlspecialchars processing. This handles quotes and other special chars in the user input. $attr_value = NULL; $blank_value = FALSE; if (strstr($option, TEXT_PREFIX)) { if (trim($value) == NULL) { $blank_value = TRUE; } else { $option = substr($option, strlen(TEXT_PREFIX)); $attr_value = htmlspecialchars(stripslashes($value), ENT_QUOTES); $value = PRODUCTS_OPTIONS_VALUE_TEXT_ID; $this->contents[$products_id]['attributes_values'][$option] = $attr_value; } } if (!$blank_value) { $this->contents[$products_id]['attributes'][$option] = $value; ----------------------- FIND: (around line 135) if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id_string) . "' and products_options_id = '" . (int)$option . "'"); REPLACE with //CLR 020606 update db insert to include attribute value_text. This is needed for text attributes. //CLR 030228 add tep_db_input() processing if (tep_session_is_registered('customer_id')) tep_db_query("update " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " set products_options_value_id = '" . (int)$value . "', products_options_value_text = '" . tep_db_input($attr_value) . "' where customers_id = '" . (int)$customer_id . "' and products_id = '" . tep_db_input($products_id) . "' and products_options_id = '" . (int)$option . "'"); ----------------------- FIND: (around line 186) global $customer_id; ADD BELOW: //CLR 030228 add call tep_get_uprid to correctly format product ids containing quotes $products_id = tep_get_uprid($products_id, $attributes); ----------------------- FIND: (around line 305) 'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : '')); REPLACE with 'attributes' => (isset($this->contents[$products_id]['attributes']) ? $this->contents[$products_id]['attributes'] : ''), 'attributes_values' => (isset($this->contents[$products_id]['attributes_values']) ? $this->contents[$products_id]['attributes_values'] : '')); ---------------------------------------------------------------- Open catalog/includes/functions/general.php --------------------- FIND: (around line 25) function tep_redirect($url) { if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) { tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false)); } REPLACE with function tep_redirect($url) { ---------------------- FIND: (around line 970) //// // Return a product ID with attributes function tep_get_uprid($prid, $params) { if (is_numeric($prid)) { $uprid = $prid; if (is_array($params) && (sizeof($params) > 0)) { $attributes_check = true; $attributes_ids = ''; reset($params); while (list($option, $value) = each($params)) { if (is_numeric($option) && is_numeric($value)) { $attributes_ids .= '{' . (int)$option . '}' . (int)$value; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { $uprid = tep_get_prid($prid); if (is_numeric($uprid)) { if (strpos($prid, '{') !== false) { $attributes_check = true; $attributes_ids = ''; // strpos()+1 to remove up to and including the first { which would create an empty array element in explode() $attributes = explode('{', substr($prid, strpos($prid, '{')+1)); for ($i=0, $n=sizeof($attributes); $i<$n; $i++) { $pair = explode('}', $attributes[$i]); if (is_numeric($pair[0]) && is_numeric($pair[1])) { $attributes_ids .= '{' . (int)$pair[0] . '}' . (int)$pair[1]; } else { $attributes_check = false; break; } } if ($attributes_check == true) { $uprid .= $attributes_ids; } } } else { return false; } } return $uprid; } REPLACE with //// // Return a product ID with attributes function tep_get_uprid($prid, $params) { $uprid = $prid; if ( (is_array($params)) && (!strstr($prid, '{')) ) { while (list($option, $value) = each($params)) { //CLR 030714 Add processing around $value. This is needed for text attributes. $uprid = $uprid . '{' . $option . '}' . htmlspecialchars(stripslashes(trim($value)), ENT_QUOTES); } //CLR 030228 Add else stmt to process product ids passed in by other routines. } else { $uprid = htmlspecialchars(stripslashes($uprid), ENT_QUOTES); } return $uprid; } ADD before ending >? // Decode string encoded with htmlspecialchars() function tep_decode_specialchars($string){ $string=str_replace('>', '>', $string); $string=str_replace('<', '<', $string); $string=str_replace(''', "'", $string); $string=str_replace('"', "\"", $string); $string=str_replace('&', '&', $string); return $string; } ---------------------------------------------------------------- Open catalog/admin/product_attributes.php ---------------------- FIND: (around line 30) $option_name_array = $HTTP_POST_VARS['option_name']; for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "')"); REPLACE with $option_name_array = $HTTP_POST_VARS['option_name']; $option_type = $HTTP_POST_VARS['option_type']; //clr 030714 update to add option type to products_option $option_length = $HTTP_POST_VARS['option_length']; //clr 030714 update to add option length to products_option for ($i=0, $n=sizeof($languages); $i<$n; $i ++) { $option_name = tep_db_prepare_input($option_name_array[$languages[$i]['id']]); $option_comment = $HTTP_POST_VARS['option_comment']; //clr 030714 update to add option comment to products_option tep_db_query("insert into " . TABLE_PRODUCTS_OPTIONS . " (products_options_id, products_options_name, language_id, products_options_type, products_options_length, products_options_comment) values ('" . (int)$products_options_id . "', '" . tep_db_input($option_name) . "', '" . (int)$languages[$i]['id'] . "', '" . $option_type . "', '" . $option_length . "', '" . $option_comment[$languages[$i]['id']] . "')"); if($option_type != 0 && $option_type != 2){
  9. jacenstuff

    [Contribution] Extra Fields

    thats odd, because I have it setup for the create account page and NOT the product page. :( so umm, I guess i have to go over the instructions again. because customers have been telling me how they found me using this mod in thier create account page, and I needed this mod for products for custom text... i'm all confused I gotta go lie down. thanks though :P
  10. I'll help you out kapearl, I just hope i can explain it clearly enough for you, as I tend to ramble. First things first, create your product, for this instructional purpose we will call this imaginary object "memopad". So we want to set text attributes for Memopad. 1- Go into the admin panel -> Catalog -> Product Attributes and look for product options(should be on the upper left quarter of the page Now we need to setup an attribute before we can apply the attribute to the product, So we want to give our customer an option to have their name printed on the stationary memopad, that would call for a textbox. 2- Under the en:(short for english)[or whatever language you're setup for] type in what you want to call this attribute, we'll write in "Custom Header Text" i.- in the box below titled "Comment" we can write, "enter your memopad's headline here" ii.- in the box to the right called length we'll type in a MAXIMUM amount of letters they can type for this title, [ our imaginary memopad is only 4"W x 6"L, so they can't fit much] we'll give it a number value of 12 iii.- We select "text" from the dropdown list to the right of the "length" box 3.- now we click "insert" Now we have the attribute setup, thats just one textbox attribute for our memopad product, if we want more like a space for an address and a space for a phone number, we just go through the same process but title them differently. BUT before I go on and show you how to apply the attribute, let me just tell you that if you wanted all that information from the customer, instead of 5 seperate textboxes, we can just create a textarea instead. Following the same steps as before except you'd change the length value to something a bit higher, I tend to use 128 in a textarea for my customers to give me placement instructions on custom clothing, and select "Textarea" instead of text. Now lets give our attribute some values. On the right side of the attribtue page, upper right quarter, there is a section called "Option values". 4.- Select "Customer Header Text" from the first dropdown list. i.- Under the langauage textbox area(i.e. en:) merely type in how you'd liek to refer to it, i'd call it something like, "Headertext" 5.- click "insert" Now let's apply our attribute to our product. Down below, on the lower half of the attribute page, is an area titled, "Product Attributes" this is where we will be working. Now let's get to it: 6.- Locate the dropdown list below and find our product, "memopad" i.- Next to that dropdown list is another called "Option Name", we want to select, "Custom Header Text"(thats the title we gave the attribute we created) ii.- next to that is a drop list for "Option Values" and we'll select,"HeaderText" (optional)iii.- Under value Price we can charge for this customization, I'll place 1.00, meaning we're charging a buck to add this custom text for our customer. If this is a free feature, leave blank or put in 0. a.- if we're charging for this feature, we want to put a "+" under the "Prefix" column. 7. - Click insert and we're done! :) very wordy, but when you have to explain it, but as you can see by doing it, it's really simple. I hope this helped you, if not.... well you didn't pay for my advice :) Any other questions I'm sure these guys can help you out. Goodluck.
  11. jacenstuff

    [Contribution] Extra Fields

    Hey that's friggin' awesome. How come when I go to setup and Extra field it ONLY shows up in the Create-an-account page? Thats why i decided to make the "hwo'd you find us" part. I couldn't add it to other pages like product_info and stuff. I like what you did there, But I don't know how to do that. also, I noticed there is a slight problem with alignment on that example you showed me, i'm running firefox 1.5 in Debian in a 1280x1024 resolution, if that helps you out.
  12. jacenstuff

    [Contribution] Extra Fields

    Ah, pretty cool, thanks pixclinic, but...now that I have this already installed, what would I use it for? hehe... my mind draws a blank now :(
  13. Just did a sample order using this feature, so far no glitches EXCEPT, the title of My text area and text boxes are not carried over into the invoice or the e-mails sent out confirming the order. it basically says - Sample Shirt $2.99 - Hey this is my shirt! Color - black - place centered and 3 inches from the neck Any to control this so it can be announce the titles of the attribute(like it states color): Sample Shirt $2.99 Custom Text - Hey this is my shirt! Color- black Placement Instruction - place centered and 3 inches from the neck This would help customer understand exactly what they ordered when looking at thier invoices. I notice in the e-mails sent it doesn't even have the " - " between the attribute title and the selected variable so it's basically: Products ------------------------------------------------------ 1 x sampleshirt (sample) = $2.99 Hey this is my shirt! Color Black place centered and 3 inches from the neck ------------------------------------------------------ I mean not only is this atrocious looking, I only understand what it says because I'm the admin. It's like writing a letter without using commas or period.(my grammar is poor I know, but thats a different topic). Any ideas on how to improve this?
  14. Wow, I came here to ask one question but reading post I have about a total of three now. First things first: 1- Has anyone got a textcounter working with this contrib for people who do letter customizationf or products and charge by the letter? (i.e. First ten letters typed are free for a product but anything after that is .50 cents per letter and added to the total, so a mug with 12 letters would be (price of mug) +($1.00 for extra letters)) 2- I notice lots of you talking about checkboxes and radio buttons, but I see no options for this in the contribution I installed, all i see are textareas and textboxes. How'd you accomplish this as I would like this to :) 3- Has anyone gotten something working in a way that , how can I explain this.... You get to choose an image and a color out of two drop down list right? ... but after that you want another image(and to specify it's color), so you click the checkbox "Want another image" and when you check it, the two droplist for images and colors popup for this second image selection process.(this has sparked another question) 4- Has anyone gotten a setup going where I, let's say, chose a siez of a shirt, the colors available for that shirt in a seperate droplist would update to colors available? (i.e. say I sell Small, Medium, and large shirts T-shirts, when you select medium as your preferred size all colors are available in medium, but Large and small are only available in few colors, not all) I'm sure this is just messing with the attributes function, but right now it escapes me of how I would set this up. Thanks so much for hearing me out guys(and ladies), if you have the answer to ANY of these please let me know, ESPECIALLY for the text counter deal. OH speaking of which, I know of a site that implements the textcounter and it IS an OSC store(i know because i used to work for them). HOWEVER, because they outsource thier admin and such they cannot and will not (especially since i no longer work there) give me the info I need on hwo to get it to work. but looking at thier source I've come up with this information (posted below), and I think this is part of my solution for the textcounting, but I cannot figure out how to implement it with the Option Type feature :( Can this help anybody in helping me figure this out? If I can get this to work, I will submit this to the creators of this Contribution so everybody can have this option, as I've seen others looking for the same option with no results either. here is what i've found in their source from product_info.php: <script LANGUAGE="JavaScript"> function textCounter(field,cntfield,xtrafield) { if (field.value == '') { cntfield.value = 0; }else{ var charCount=0; for (var i = 0; i < field.value.length; i++) { if (field.value.charAt(i) != " ") charCount++; } cntfield.value = charCount; } if (cntfield.value >14) { xtrafield.value=(cntfield.value-14)*0.65; }else{ xtrafield.value=0; } } </script> That's the script and this is the html/php used in the actual products attribute listing (when selecting size, colors,text and such). It's only the simplified html/php code used for display purposes, not the actual useful code(i'm pretty sure), but I figure someone seeing this will realize how it works and can help me out. <tr><Td valign=top><img src="images/icons/step_4.gif" width=50 height=50 name=img_3 hspace=5 border=0></a></Td><td class="main" valign=top><big><b>Custom Text</b></big><br>What's it going to say? The first 14 letters are free, after that each letter is ?65<br><input onKeyDown="textCounter(document.cart_quantity.id_3,document.cart_quantity.idlen_3,document.cart_qua ntity.idxtra_3)" onKeyUp="textCounter(document.cart_quantity.id_3,document.cart_quantity.idlen_3,document.cart_qua ntity.idxtra_3)" type=text maxlength=250 value="" id="id_3" name="id[3]"><bR>Total Letters Used <input type=text size=3 id="idlen_3"> Extra Charge <input type=text id="idxtra_3" size=3><br><!--<input type=checkbox name="idnotxt[3]" id="idnotxt_3" onClick="notxtitems();">I'd actually prefer not to have any text on my order (Reduce Order Cost by $10)--></td></tr> <script>textCounter(document.cart_quantity.id_3,document.cart_quantity.idlen_3,document.cart_qua ntity.idxtra_3);</script> Thanks again
  15. jacenstuff

    [Contribution] Extra Fields

    I think this is the same extra fields contrib I use and I had a simple question. When i originally downloaded it and installed I thought an extra field feature would be(but is not) setting up a droplist. Is there a way or an update to implement this as an extra field? I wnated to give my customers a choice of options when i'd asked them how they heard about my store (i.e. yahoo, google, advertising in paper, etc.). Any ideas?
×