Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

carmelos

Archived
  • Posts

    6
  • Joined

  • Last visited

Everything posted by carmelos

  1. I just got a Apostrophe FIX, that works pretty neat... here what you need to do: in admin/categories.php: find: if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields. foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) { if (isset($extra_product_entry[$key])) { // an entry exists if ($val == '') tep_db_query("DELETE FROM " . products_to_products_extra_fields . " where products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key); else tep_db_query("UPDATE " . products_to_products_extra_fields . " SET products_extra_fields_value = '" . tep_db_prepare_input($val) . "' WHERE products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key); } else { // an entry does not exist if ($val != '') tep_db_query("INSERT INTO " . products_to_products_extra_fields . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_prepare_input($val) . "')"); } } } and replace with: if ($HTTP_POST_VARS['extra_field']) { // Check to see if there are any need to update extra fields. foreach ($HTTP_POST_VARS['extra_field'] as $key=>$val) { if (isset($extra_product_entry[$key])) { // an entry exists if ($val == '') tep_db_query("DELETE FROM " . products_to_products_extra_fields . " where products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key); else tep_db_query("UPDATE " . products_to_products_extra_fields . " SET products_extra_fields_value = '" . tep_db_input($val) . "' WHERE products_id = " . (int)$products_id . " AND products_extra_fields_id = " . $key); } else { // an entry does not exist if ($val != '') tep_db_query("INSERT INTO " . products_to_products_extra_fields . " (products_id, products_extra_fields_id, products_extra_fields_value) VALUES ('" . (int)$products_id . "', '" . $key . "', '" . tep_db_input($val) . "')"); } } } (I replaced tep_db_prepare_input($val) to tep_db_input($val)) And then in catalog/product_info.php find: $extra_fields['value'] and replace with: stripslashes($extra_fields['value']) -the last one is needed to get rid of the slashes, that your data are stored with in the database. (this also a fix for 1064 error, which I was getting when trying to add some data with slashes). Should work fine... :)
  2. ahh..I finally decided to give up with this contribution until it's bugs free... I have Registered Globals off contribution installed, and it's causing a problem, which I don't know how to repair. After I transfered my files from Windows to Unix-based Server I got this error: ... Warning: array_key_exists(): The first argument should be either a string or an integer in /home/xxxx/xxxxx/html/catalog/admin/includes/functions/sessions.php on line 99 ... (and on line 138) ... Session not registered - You cant access this page directly I tried to fix the function (in admin/includes/functions/sessions.php): function tep_session_is_registered($variable) { // >>> BEGIN REGISTER_GLOBALS // return session_is_registered($variable); return (isset($_SESSION) && array_key_exists($variable,$_SESSION)); // <<< END REGISTER_GLOBALS } with replacing: return (isset($_SESSION) && array_key_exists($variable,$_SESSION)); with return (isset($_SESSION[$variable])); and also: if (array_key_exists($var_name,$GLOBALS)) { to if (isset($GLOBALS[$var_name])) { which should do the trick... However - it does not :( as I'm left with: Session not registered - You cant access this page directly and the contribution does not load :( It's a problem of array_key_exists function and it's probably PHP version fault (I found some information on the web, that it depends on Zend something version), so I guess I can't do much about it... However some argue it's not: http://bugs.php.net/bug.php?id=34419&edit=1. So for now, I changed to attributes copier and sorter. Maybe it does not look as good as AJAX AM, and is not that flexible, but does pretty much the same... :)
  3. :) While trying to add a new attribute I was getting this error: 1366 - Incorrect decimal value: '' for column 'options_values_price' at row 1 insert into products_attributes (products_id, options_id, options_values_id, options_values_price, price_prefix, products_options_sort_order) values ('10', '1', '12', '', '', '') btw. I also added '+' for Prefix, '0' for price and '0' for sortorder .. in order to have default values written inside (just find and replace appropriate place in attributeManager/attributeManager.php): <td valign="top"> Prefix: <?php echo drawDropDownPrefix('id="prefix_0"', '+')?> </td> <td valign="top"> Price: <?php echo tep_draw_input_field('newPrice','0','size="4" id="newPrice"'); ?> </td> <?php if(AM_USE_SORT_ORDER) { ?> <td valign="top"> Sort: <?php echo tep_draw_input_field('newSort','0','size="4" id="newSort"'); ?> </td> <?php } else { ?> <td valign="top"> <?php echo tep_draw_hidden_field('newSort','0','size="4" id="newSort"'); ?> </td> ahh.. I like the template system! :rolleyes: but it needs a small fix for 'am_attributes_to_templates' table. there was no 'products_options_sort_order' column, as when I tried to save the template I was getting some 1054 error (I hope that's the one) saying the column was missing or so... (to add it I simply used phpMyAdmin, and copied the structure to make it the same as other columns.) you could also run a query: DROP TABLE IF EXISTS `am_attributes_to_templates`; CREATE TABLE IF NOT EXISTS `am_attributes_to_templates` ( `template_id` int(5) unsigned NOT NULL, `options_id` int(5) unsigned NOT NULL, `option_values_id` int(5) unsigned NOT NULL, `products_options_sort_order` int(5) unsigned NOT NULL, KEY `template_id` (`template_id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin2;
  4. I just wanted to share some pretty simple info for those who have problems with adding new Attributes: :-" I added: if(empty($price)){$price=0;} if(empty($sortOrder)){$sortOrder=0;} in attributeManagerInstant.class.php after: $this->getAndPrepare('option_id', $get, $optionId); $this->getAndPrepare('option_value_id', $get, $optionValueId); $this->getAndPrepare('price', $get, $price); $this->getAndPrepare('prefix', $get, $prefix); $this->getAndPrepare('sortOrder', $get, $sortOrder); :huh: btw. I wonder what exactly is the difference between: attributeManagerInstant.class.php and attributeManagerAtomic.class.php ? I haven't figured out this yet...:/ and is there any progress with works on Qty Pro add on? would be really useful to have it in one place... I wish that the complete version of AM was released already... :rolleyes:
  5. Hi! I think this is really a great contrib! However, I have a small problem with it: My problem looks like this: I have Auto-generate images ON. If I have a product without an image in my database, and then I add an image (say: img.jpg) everything works great: in Products table I get: products_image : products/category/subcategory/imgs.jpg, products_image_med : products/category/subcategory/imgm.jpg, products_image_pop : products/category/subcategory/img.jpg This is perfect. However problems come if I want to add an image while creating a new product and I do something wrong: i.e.: I get an error if I forget to specify manufacturer and then I go back to the product page and try to edit it again. then I have this as a result in my database table 'product': products_image : C:WINDOWSTEMPphp25A.tmp, products_image_med : NULL, products_image_pop : products/category/subcategory/img.jpg The same thing happens if the img.jpg file had been already added (either in another product, or as a result of doing a mistake, or when adding an image first with Auto-generate images OFF and then turning it ON) 1. I wonder how are the Images generated, in which file? 2. Where are the images added to table products (in which file?) 3. How do I turn on debugging mode? 4. Is there a way to check, if the file of a specyfic name had been already added to the system (and is therefore casing a problem), and if so delete it (or let the user choose to delete it?) ps. I'm using this for now on my test site on Windows platform. I'm using PHP5, MySQL5, Apache2. I have a few contribs already installed: Register Globals Off, Easy Populate, Qty Pro, Featured Products, Header Tags, Extra Products Fields, News Desk, CSSMenu - but I don't thing any of those should have significant meaning...
  6. Hi! This is my first post, but I found a solution to a little bug in this contrib, and maybe this will be useful for somebody. I was having this error: 1406 - Data too long for column 'products_head_title_tag' at row 1 This was because the database type for products_head_title_tag is VARCHAR(80) and I added tinyMCE contrib before, which was adding a lot of text to textareafield. Solution? you should change only 1 line in admin/categories.php find: <td class="main"><?php echo tep_draw_textarea_field('products_head_title_tag[' . $languages[$i]['id'] . ']', 'soft', '70', '5', (isset($products_head_title_tag[$languages[$i]['id']]) ? stripslashes($products_head_title_tag[$languages[$i]['id']]) : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id']))); ?></td> and replace with: <td class="main"><?php echo tep_draw_input_field('products_head_title_tag[' . $languages[$i]['id'] . ']', (isset($products_head_title_tag[$languages[$i]['id']]) ? stripslashes($products_head_title_tag[$languages[$i]['id']]) : tep_get_products_head_title_tag($pInfo->products_id, $languages[$i]['id']))); ?></td> :rolleyes:
×
×
  • Create New...