Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

neillo

Archived
  • Posts

    1
  • Joined

  • Last visited

Posts posted by neillo

  1. No, my problem is that the category that the customer selected is not the category that the product shows up in. The added product always shows up in the top level and not the selected category. The second problem is, in the notification email to the admin. Where is says "New product was added to :", the category is blank.

     

    Seso

     

    This is a great contribution - my thanks!

     

    I think I can help with your problem if it is still relevant.

    Yeah, I noticed / have been trying to get the products to add into the correct category rather than just some in on top level. Here's a dirty but effective fix. Find the following line which adds the product "corresponding to category" in the relevant database table in account_add.php

     

    -----------------

     

    tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$category_id . "')");

     

    -----------------

     

    Replace this with

     

    -----------------

     

    $chosencategory = $_POST['category_id'];

     

    tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . $chosencategory . "')");

     

    -----------------

     

    This will revive the original category posted from the add product form (category_id) which appears to get lost between being posted / reaching the preview page / and being saved. Didnt find out where this happens, but this fix appears to work so didnt bother seaching further. Note there is no validation of this variable here - is there any security risk?

     

    Also going to try to tie in this whole add products contrib with the affiliate sales contrib - so affiliates can add products too. Should be fun : )

     

    Cheers

×
×
  • Create New...