Jump to content

Deju

Members
  • Content count

    4
  • Joined

  • Last visited

  1. Hi Guys, I've been using SEO URLs for a while now and really like the contribution. I was wondering if anyone could advise me on how to tweak the URLs slightly. Specifically, for subcategory URLS I would like to be able to remove all parent category IDs from the URL and only have the subcategory ID in the URL without upsetting, for example, the category menus. A current example of a URL of a subcategory would be: /home-gifts-terramundi-money-pots-c-2_43.html (where the parent category ID is 2 and the subcatgory ID is 43) I would like to be able to change this to: /home-gifts-terramundi-money-pots-c-43.html (ie. the parent category ID has been removed, leaving only the subcategory id 43) I've had a few attempts so far, but when I change the code in seo.class.php to achieve the above, my category menus are no longer active for the parent category. Can anyone advise? Thanks!
  2. Deju

    Batch Order Center Update 1.1

    This code change addresses any issues people might be getting where the correct number of orders is not returned in the PDF file. I think the problem stems from extracting info from the orders_status_history table. Firstly, the original query only extracts orders where the order id is present in both the orders status history AND the orders tables (the h.orders_id = o.orders_id part of the original query below). Therefore if you have never set the status for any orders, these won't appear in your PDF when the query is run. Secondly, if you have never set the status of the order in the orders status history table, the query won't extract any information. I replaced the original queries in the admin/batch_print.php (see below): // if there is a invoice number use first order query otherwise use second date style order query if ($invoicenumbers != '') { $orders_query = tep_db_query("select o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where o.orders_id in (" . tep_db_input($invoicenumbers) . ") and h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id'); } else { $orders_query = tep_db_query("select o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where o.date_purchased between '" . tep_db_input($startdate) . "' and '" . tep_db_input($enddate) . " 23:59:59' and h.orders_id = o.orders_id" . $pull_w_status . $get_customer_comments . ' group by o.orders_id'); } With: $orders_status_history_query = tep_db_query("select * from " . TABLE_ORDERS_STATUS_HISTORY); // if there is a invoice number use first order query otherwise use second date style order query if ($invoicenumbers != '') { // if there is a invoice number use first order query otherwise use second date style order query if (tep_db_num_rows($orders_status_history_query) > 0){ $orders_query = tep_db_query("select o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where o.orders_id in (" . tep_db_input( $invoicenumbers) . ")" . $pull_w_status . $get_customer_comments . ' group by o.orders_id'); } else { $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where orders_id in (" . tep_db_input( $invoicenumbers) . ")" . $pull_w_status . $get_customer_comments . ' group by orders_id'); } } else { if (tep_db_num_rows($orders_status_history_query) > 0){ $orders_query = tep_db_query("select o.orders_id,h.comments,MIN(h.date_added) from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_STATUS_HISTORY . " h where o.date_purchased between '" . tep_db_input($startdate) . "' and '" . tep_db_input($enddate) . " 23:59:59'" . $pull_w_status . $get_customer_comments . ' group by o.orders_id'); } else { $orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where date_purchased between '" . tep_db_input($startdate) . "' and '" . tep_db_input($enddate) . " 23:59:59'" . $pull_w_status . $get_customer_comments . ' group by orders_id'); } } This only includes info from the orders status history table if there is anything in it. Otherwise, it doesn't access the table at all. I've also removed the condition which says that the order id has to be present in both the orders status history table and the orders table (h.orders_id = o.orders_id). The result for me is that all the relevant orders are produced in the PDF file. I am not however a PHP coder, so if there are any ommissions or glaring errors with this code change, please let me know!
×