Version number in the main file is set back at 1.3.2 it should be 1.3.5 by now
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!
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
Well, you're welcome swguy, but I haven't contributed anything yet,, 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.(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?
Last edited by greg_beyer; 8 Feb 2021 at 05:45 PM.
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.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
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?
We sell ATV, Dirtbike, Streetbike, Snowmobile, Watercraft & Custom stickers & Banners. Check us out www.AD-DiscountPerformance.com
We sell ATV, Dirtbike, Streetbike, Snowmobile, Watercraft & Custom stickers & Banners. Check us out www.AD-DiscountPerformance.com
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.
Outdoorking
www.outdoorking.com.au
Bookmarks