Jump to content

razorsite

Members
  • Content count

    14
  • Joined

  • Last visited

1 Follower

Profile Information

  • Real Name
    Peter
  1. razorsite

    PC Pro Creator

    Have this installed, & apart from the dependencies not choosing Intel CPUs properly I really like it. One thing i'd like to know is where I can set the sort order? Nothing is sorted in the pull down menu for parts, with some categories of mine having 30+ records it's hard to find the right part. Anyone know where to change sort? TIA
  2. AHA! Figured it out, it isn't pretty but it works... All I did was create another PRODUCTS table in my SQL database & called it PRODUCTSD (or products delete), code points to it like this, // products_model exists! array_walk($items, 'print_el'); // First we check to see if this is a product in the current db. $result = tep_db_query("SELECT products_id FROM ".TABLE_PRODUCTS." WHERE (products_model = '". $v_products_model . "')"); if (tep_db_num_rows($result) == 0) { // insert into products $sql = "SHOW TABLE STATUS LIKE '".TABLE_PRODUCTS."'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_product_id = $row['Auto_increment']; if (!is_numeric($max_product_id) ){ $max_product_id=1; } $v_products_id = $max_product_id; echo "<font color='green'> !New Product!</font><br>"; $query = "INSERT INTO ".PRODUCTSD." ( products_image, products_model, products_price, products_cost, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( So, if there's a new product it inserts it into a unused table, if it's current it'll go into the proper TABLE.PRODUCTS :thumbsup:.
  3. I've been looking around the easypopulate.php code & can't seem to figure out how to not add new products, what i'm looking to change is this... if ($v_products_model != "") { // products_model exists! array_walk($items, 'print_el'); // First we check to see if this is a product in the current db. $result = tep_db_query("SELECT products_id FROM ".TABLE_PRODUCTS." WHERE (products_model = '". $v_products_model . "')"); if (tep_db_num_rows($result) == 0) { // insert into products $sql = "SHOW TABLE STATUS LIKE '".TABLE_PRODUCTS."'"; $result = tep_db_query($sql); $row = tep_db_fetch_array($result); $max_product_id = $row['Auto_increment']; if (!is_numeric($max_product_id) ){ $max_product_id=1; } $v_products_id = $max_product_id; echo "<font color='green'> !New Product!</font><br>"; $query = "INSERT INTO ".TABLE_PRODUCTS." ( products_image, products_model, products_price, products_cost, products_status, products_last_modified, products_date_added, products_date_available, products_tax_class_id, products_weight, products_quantity, manufacturers_id) VALUES ( I want to change the INSERT INTO to UPDATE, tried commenting the lines, deleting them, changing to update from insert, still no go, gives me an error. I really don't want to update manually every day, there must be a way to tell EP to NOT add new v_products_model, just update if the model exists. Have a 5000 product listing from my supplier, out of those 5000 I carry 1000 of those products, is there another way of going about this? For it to work with EP now i'd need to manually delete 4000 of those records (or cut & paste 1000 of them), too much work! That's why i'd like to just use the 5000 list & have EP ignore the non-existing in my database 4000 records <_<. If anyone knows how to do this please let me know, been playing with code for days now without much luck.
  4. Updating is fine, I want to NOT add new products from the spreadsheet, want to do a daily update & the fastest way is from my suppliers file, not one of my own :).
  5. Thanks, still didn't explain why my simple 7250 record didn't update. Now I figured out why, there was a duplicate in the database, so it was updating the dupe that doesn't show. Is there a way to change EP to not add products, I want to only update exsisting products on the site, but not add. As of now I need to delete about 9500 product records from my database, after that I want to use EP again but worried this will happen again. The tab delimited file i'm working with has around 5000 products, of those my site lists about 500-700 of them, so... Any help with the code? thanks.
  6. Having an issue with model #, from what I gather & have tested, v_products_model doesn't like "/" "\" or "-", these characters can easily be changed with the replace function in excel, but one of my products is simply "72500SZ" & it won't update properly, here's the test file... v_products_model v_products_quantity v_products_cost v_products_price EOREOR 72500SZ 93 40.2 48.2 EOREOR If I change 72500SZ to 7250 it will work, leave it as is (correct model #) it doesn't?! v_products_cost is a new field I added if you were wondering, works fine. Is there a list of suitable characters you can use with v_products_model? I download a tab delimited list from my supplier, add the v_products_cost field, replace the forementioned non-working characters & most of the update works, just a few don't. Please help, TIA.
  7. razorsite

    [Contribution] Adding new fields to Easy Populate

    Hi there, finally figured out how to add a new field & properly upload EP & insert data in the correct spot. Now, final piece of the puzzle :D... The new field i'm using is product_cost, what i'd like to do is take product_cost & times it by 1.10 or 1.15 etc (10%, 15%, etc. profit) & output to product_price. I know this doesn't belong in this post, as it concerns the categories.php file, but this post has helped me alot so I figure someone might know how to do this? TIA!
×