Version number in the main file is set back at 1.3.2 it should be 1.3.5 by now
Printable View
Version number in the main file is set back at 1.3.2 it should be 1.3.5 by now
Hello, I'm using v 1.3.3 of the plug-in. This is a fantastic tool for doing all kinds of free-style analysis of orders. Thanks to all who created it and contributed to it. I'd like to learn how to extend it just a bit. In the Select File Layout to Export section, when I select the " 1 Product per row" radio, I would like to include the Category of the product in the CSV. Can someone tell me what file(s) I need to hack up? I'm no php dev, but I think I can follow existing code, and do this myself, given a little lead. I'll post my code once I nut it out, and if swguy thinks it's worthwhile, you can publish an update to the plugin.
Thanks for the help!
Thanks for your contribution!
Well, you're welcome swguy, but I haven't contributed anything yet, :smile:, but I will.
So I downloaded the latest ver and took a look at the files, and surprisingly there are only four .php's It looks like /admin/shipping_export.php is the file to tweak. It looks like lines 73-75 is where the solution is, and I'd stick the category name at the bold.
if ($_POST['filelayout'] == 2) { // 1 Product Per row RADIO
$order_info = "SELECT o.orders_id, customers_email_address, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, shipping_method, customers_telephone, order_total, op.products_model, products_name, categories_name, op.products_price, final_price, op.products_quantity, date_purchased, ot.value, orders_products_id, order_tax, o.orders_status, o.payment_method";
Simple enought, BUT . . .
I said I'm not a PHP dev, but I now see ya gotta know your way around mysql, too. :shocking: (Note the twitch, ha-ha) I do know that anywere you have a "SELECT" you have to have a matching FROM which I see a little further down. Got no idea how to insert CATEGORIES_DESCRIPTIONS.categories_name into this:
$order_info = $order_info . " FROM (" . TABLE_ORDERS . " o LEFT JOIN " . TABLE_ORDERS_PRODUCTS . " op ON o.orders_id = op.orders_id), " . TABLE_ORDERS_TOTAL . " ot";
if ($_POST['iso_country2_code'] == 1 || $_POST['iso_country3_code'] == 1) {
$order_info = $order_info . ", " . TABLE_COUNTRIES . " cc";
};
Anyone?
Well, simply adding categories_name to the SELECT string does not work, I get a column not found error. That would be because the FROM statement does not include the CATEGORIES_DESCRIPTIONS table, categories_name column.
$order_info = $order_info . " FROM (" . TABLE_ORDERS . " o LEFT JOIN " . TABLE_ORDERS_PRODUCTS . " op ON o.orders_id = op.orders_id), " . TABLE_ORDERS_TOTAL . " ot";
I've pasted the original select / from statement in my my phpmyadmin sql window and cleaned out the PHP coding, and tried about 30 different combos of sql runs but cannot get just this original query to run. Do not find the "o", "op" and "ot" syntax in mysql documentation, so don't know their significance.
Much less do I know how to add the CATEGORIES_DESCRIPTION.categories_name to the FROM. So I guess hacking this myself is beyond my capabilities. Swguy, I'd sure appreciate your help in getting the FROM statement right. Then I think the adding categories_name to the select will work.
Hadda at least try. Thanks for any help.
No, you can't retrieve category information from that table, because that table doesn't contain those details.
In fact, none of the "order"-related tables contain anything related to the category in which a product existed at any point in time.
If the product actually still exists in the database, then you could manually query for the "master" category ID that the product belongs to, but you can't get what "linked" category the customer might have been shopping in when adding the item to their cart.
To do that, you could use:
zen_get_category_name(zen_get_products_category_id($products_id)) ... but you'll have to also get $products_id when querying the orders_products table by adding products_id to the appropriate query.
Is there a way i can set it up so that i don't have to go threw and pick each box every time? If so how can i do that?
From memory it is covered in this thread. Run a search for defaults.
Hi All,
Just installed Export shipping / order information and it works a treat but what I want to do is add some more fields for it to download which are:
Product shipping weight
Product length
Product width
Product height
If anyone could assist on where and what files I need to adjust it would be a great help.