Latest News: (loading..)

Kawazu

Members
  • Content count

    55
  • Joined

  • Last visited

About Kawazu

  • Birthday 05/01/1987

Profile Information

  • Real Name
    Ian Osos
  • Gender
    Male
  • Location
    Indianapolis - USA
  • Interests
    Video games, computers, music, the tuba, D&D, food, and mythical folklore of the Nordic variety.
  • Website
  1. Hey... I was wondering if anyone could help me with a quick question. My company is currently in the process of setting up a new osC store along with the one we currently have running. We want to develop/implement a method of controlling both databases together or independently based on the situation. For example store A (our current store) has 1000+ products and we're going to be using many of the same products in store B. However, while most of the time the information will be identical there might be instances where, although it's the same product, we might need to make separate changes on a store-by-store basis (i.g. the description for product 1 in store A should be "Cheese Monster," but the same product's description in store B should be "Dairy Deity"). After reading the documentation I am not sure whether or not this is possible... it states that the product catalogs are indeed independent, but all it gives as an example is the ability to enable or disable per store... it doesn't say anything about individually editing per store. So, in short: is it possible to edit the product details for the same product per store, or if the product is the same do they have to be identical? Thank you very much in advance for you responses.
  2. I have the same problem... anyone have any suggestions? Thanks in advance.
  3. Gah... finally... I just ended up rewriting the MySQL query, changed a few things around and made it a little cleaner, and now things seem to be working fine.
  4. Hello, I've recently been having a problem with my store feeds. Every time I try to run a feed I get a MySQL error message which basically says that there's an unknown column (example: ": SQL error Unknown column 'products.manufacturers_id' in 'on clause'| sql = SELECT..."). If I go in and delete that particular line of code, it says the same thing with another column and if I delete that it does the same thing again picking a different column. I know those columns exist because otherwise my store wouldn't work. I'm pretty sure it's connecting to the right database and everything because there's no connection errors. I've used this before with no problems, but when I went to update the feeders for this month everything just broke. Has anyone else had this problem? Does anyone have any ideas how to fix it? Any help is greatly appreciated and I thank you in advance. -Ian
  5. Hello, I've recently been having a problem with my store feeds. Every time I try to run a feed I get a MySQL error message which basically says that there's an unknown column (example: ": SQL error Unknown column 'products.manufacturers_id' in 'on clause'| sql = SELECT..."). If I go in and delete that particular line of code, it says the same thing with another column and if I delete that it does the same thing again picking a different column. I know those columns exist because otherwise my store wouldn't work. I'm pretty sure it's connecting to the right database and everything because there's no connection errors. I've used this before with no problems, but when I went to update the feeders for this month everything just broke. Has anyone else had this problem? Does anyone have any ideas how to fix it? Any help is greatly appreciated and I thank you in advance. -Ian
  6. I doubt that this is a problem with the database because MySQL makes it rather difficult to make duplicates. It's much more likely that it's a problem with the actual code (this happened to me when I tried to implement this contrib in a hurry... I had two sets of Edit, Delete, Move, and Copy To buttons in the admin categories section). I would recommend you redo the categories.php file from your backup, or, if it's easy enough, to go through and clean it up. Hope that helps. -Ian
  7. Okay... I'm getting rather tired of this. In the second section of new code find: '" . $HTTP_GET_VARS['products_id'] . "%' and replace it with: '%[zero][zero]" . $HTTP_GET_VARS['products_id'] . "%' And then replace the two [zero]'s with actual numerical 0's. There... THAT should do it *grumbles under his breath*
  8. Let's try it this way... In /catalog/includes/modules/master_products.php find the following code: } if($HTTP_GET_VARS['products_id'] < '1000'){ if($HTTP_GET_VARS['products_id'] < '100'){ $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; }else{ $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '%0" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; } }else{ $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '%" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; } }
  9. Hrmmmm... apparently I typed something up wrong... or copied it wrong... or something. Edit: Okay... something's wrong when I post to the forums... it's leaving a rather critical part of the code out. Don't do anything yet, I'll post the REAL fix as soon as I get things working.
  10. Alright... I think I found a less temporary fix for my problem for anyone that's interested. The following changes will fix the whole problem with scanning the products_master field and adding slaves that do not belong to that master because of the LIKE command and the product_id's... see my previous posts if you don't know what I'm talking about. It will also generate the extra 0's in the "Products Master: (products_id)" text field when you select a master. I went ahead and changed it so that you'll be okay until your products_id's are more that 9999... so, in theory, this means until you have more that 9,999 products for sale. ***IMPORTANT*** Be warned that before everything works correctly you MUST go through every slave that you added before this change and make it four digits by adding extra 0's in front of the products_id's already in the field. For instance, if you have a field that says "32 567 100 8641" you must change it to "0032 0567 0100 8641." Because of this change you might want to alter the database field "products_master" in the "products" table so that it can support more characters. You can do this a number of ways, but through the MySQL command line one way you can do it (what I did) is like this: alter table products modify products_master VARCHAR(500); ALSO, I am an amateur programmer therefore I do not guarantee that these changes will work correctly with your store. I also do not guarantee that these changes will not break your store. I am using these changes on my store, and everything appears to be running smoothly, but my store is heavily modified with many changes. It SHOULD work, and I can see no reason why it would not work, BUT use at your own risk... BACKUPS BACKUPS BACKUPS ***/IMPORTANT*** Now that we've gotten through that, here are the changes. In /catalog/admin/categories.php find the following code: function updateProductsMaster() { var selected_value = document.forms["new_product"].products_master_select.selectedIndex; var masValue = document.forms["new_product"].products_master_select[selected_value].value; var theValue = document.forms["new_product"].products_master.value; if(theValue != '0' && theValue != '' && masValue != ''){ document.forms["new_product"].products_master.value = theValue+' '+masValue; }else{ document.forms["new_product"].products_master.value = masValue; } } and replace it with: function updateProductsMaster() { var selected_value = document.forms["new_product"].products_master_select.selectedIndex; var masValue = document.forms["new_product"].products_master_select[selected_value].value; var theValue = document.forms["new_product"].products_master.value; if(theValue != '0' && theValue != '' && masValue != ''){ if(masValue < 1000){ if(masValue < 100){ document.forms["new_product"].products_master.value = theValue+' '+0+0+masValue; }else{ document.forms["new_product"].products_master.value = theValue+' '+0+masValue; } }else{ document.forms["new_product"].products_master.value = theValue+' '+masValue; } }else{ if(masValue < 1000){ if(masValue < 100){ document.forms["new_product"].products_master.value = 0+0+masValue; }else{ document.forms["new_product"].products_master.value = 0+masValue; } }else{ document.forms["new_product"].products_master.value = masValue; } } } In /catalog/includes/modules/master_products.php find the following code: } $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '%" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; } and replace it with: } if($HTTP_GET_VARS['products_id'] < '1000'){ if($HTTP_GET_VARS['products_id'] < '100'){ $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; }else{ $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '%0" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; } }else{ $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '%" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; } } *Note: this is assuming you have not already altered this particular block of code. If you already implemented the change that I presented before, simply find the block of new code and replace that. That should just about do it. If you need anymore help; more or less digits for your product_id's, implementing, etc.; let me know and I'll do what I can. -Ian
  11. Unfortunately I have not yet been a able to find a permanent solution to the problem, but I have set up a temporary solution. First, locate the /catalog/includes/modules/master_products.php file. Find the following block of code: } $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '%" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; } and change it to: } if($HTTP_GET_VARS['products_id'] < '100'){ $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '%0" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; }else{ $master_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master LIKE '%" . $HTTP_GET_VARS['products_id'] . "%' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'"; } } After this when you add masters to a slave in the admin section locate the section where numbers (the master's product_id) are generated in the text field below the selection list; make sure every number has at least three digits. For instance, if the product_id added to the field is "45" change it to "045" by adding a 0 in front of it, but if it's "456" you do not need to alter it at all. Of course, if you have product_id's higher than 999 things will need to be changed around (if this is the case let me know and I'll be happy to alter the code/directions... if you want me to, that is). As I said, a temporary solution but it's got things working for now. I think I'm going to alter the code in the /catalog/admin/categories.php file to simply generate extra 0's when necessary rather than rewrite the module... if you can't beat them, join them/shortcuts are fun/etc.! As for your other question; I have not had that problem before, but I will test it a bit and let you know if anything pops up. If you need anything else just let me know; always glad to help. -Ian
  12. Yeah... I already tried that, but since the products_master field is a string of various id's (ie. "310 56 107 209") separated only by spaces it doesn't work. If the product's ID is 45 then it checks to see if any of any of those fields are equal to 45; you could only have one master for the product and it would have to be 45 for it to work properly... it can't be 45 AND 317, for instance, because "45" != "45 317". Thanks for the response though, I appreciate your time and input. -Ian
  13. >__< I was just a couple seconds too late to edit... *sigh* For anyone who's interested in the problem, it appears to be caused by the fact that it selects the elements from the database using the LIKE operator and the products_master field (which is a string of various products_id's). I don't know of another way in which you could draw various products from a string without the LIKE operator, but that's what's causing it.
  14. I found a temporary fix to this problem by altering the mySQL query, but I would still like a permanent solution. Any help is greatly appreciated. -Ian
  15. Hello, I am currently having a problem with this particular contribution. While revamping the site for a relaunch we noticed that multiple masters were being assigned to slaves, but we were not selecting these masters. After some investigation and some testing I have since discovered that if you assign a product whose product_id is three digits (or possibly more) as a master, the product whose product_id is the last two digits (and possibly the first digit, but I no longer have any one digit product_id's) of the first product is also assigned as a master. In other words, if I assign a product whose id is 645 as a master then the product whose id is 45 will also be assigned. If anyone is aware of a fix for this I would most like to hear it. Thank you very much for your time. -Ian