Re: Orders Exporter Module
I had a DUH moment today. I didn't realize that I needed to edit the sort orders in the /admin/includes/language/english/orders_export.php file to align the proper datafields. I found the 'v_orders_comment' setting that you mentioned, changed to 0 and the duplicates disappeared.
Now to figure out how to prevent sorting so that the order attributes appear in the download file in the same order they appear on the printed invoice.
Looking good now. Knowing where and how to edit will make this very useful for almost anyone.
Re: Orders Exporter Module
I will make the editing instructions a bit more explicit in the readme, to help people understand how to customize their reports. The attributes are output in the same order that the SQL query retrieves them, which probably has nothing to do with the way they are sorted for display in product pages or official invoices. It may be possible to add to the query to sort by attribute sort order where relevant... not something I had planned on doing, but I will keep it in mind as a future enhancement.
Re: Orders Exporter Module
No problems. I thought that might be the case for sorting and must be a difference between the different ZC versions. There is no logic that I can see to the order.
Thank you for taking the time to make this valuable pluging compatable with the latest version and provide the options for easy customization.
Re: Orders Exporter Module
It just occurred to me that your issue with the output not changing even when the source changes within a day may be due to some kind of query caching. If the system thinks the SQL query has already been run and is still good, it may fetch a cached copy instead of searching again. There was a reset button at the bottom of the page from the earliest version of the mod, and it might be useful for flushing the cache and forcing a new search... don't know enough about it to be sure.
Re: Orders Exporter Module
I have the order comments output rebuilt and working correctly on my test site, and the readme brought fully up to date. I want to test it on my live site before submitting to Plugins just to make sure. There is one nagging item, which does not cause any problems I can see, but ought not to be happening. When selecting an export range, two odd elements are added to the URL in the address bar. They vary seemingly at random in the numbers, but always look like ...&x=23&y=9.
For example:
Code:
http://localhost/zc151/my_admin/orders_export.php?from_oid=1&to_oid=99&x=38&y=6
I don't know what in the form submission would insert that, and would like to eliminate it.
PHP Code:
<div class="oidSetting"> <!-- Order ID setting inputs -->
<h2><?php echo ORDERSEXPORT_PAGE_HEADING_OID; ?></h2>
<?php echo zen_draw_form('oid_range', FILENAME_ORDERSEXPORT, '', 'get');
echo '<div class="oidInput">' . OEX_FROM_OID_PRE . zen_draw_input_field('from_oid', $limits['orders_id'][0], 'size="10"') . '</div>';
echo '<div class="oidInput">' . OEX_TO_OID_PRE . zen_draw_input_field('to_oid', $limits['orders_id'][1], 'size="10"') . '</div>';
echo '<div class="oidSubmit">' . zen_image_submit('button_save.gif', IMAGE_SAVE) . '</div>';//form submit
echo '</form>';?>
</div>
Re: Orders Exporter Module
This may be something above both our paygrades.
Not sure where the logic gets its order but the data in the csv is not in the same order as the databaseID or invoice. At first I thought it was the attributes but just looked and see that the products are not in the same order as the invoice.
I cannot find any consistency to the order. Sometimes A-Z, sometimes Z-A, sometimes neither by product name.
In our case, it makes things very difficult when using the CSV data and it is not in the same order as the invoice. Since we jumped from ZC1.3.9h to ZC1.5.3, I have no way of knowing if it is due to changes in DB structure or changes in how the file gets generated from the data.
We use the CSV to generate product labels and it can be a nightmare when the labels do not match the invoices.
Re: Orders Exporter Module
The construction of the SQL query, aside from range limitations, has not changed since its original version. Did you have or notice this issue before?
I don't know how mySQL decides to order its results in the absence of specific "order by" commands... that needs someone with expert knowledge. Is there actually a definite order, or does it depend on some random access effects from efficient searching techniques? It might be possible to add an "order by products_id" clause in the right sequence so the overall results keep orders together. I would have to research the sequence of operation of multiple items in the "order by".
Are you wanting the CSV product output to match the invoice order? Does the invoice order match the db stored order, and does that match the order in which the customer actually added the products to the cart?
Re: Orders Exporter Module
I appreciate everything you've done and realize sometimes there are limitations.
Quote:
Originally Posted by
gjh42
The construction of the SQL query, aside from range limitations, has not changed since its original version. Did you have or notice this issue before?
It may be differences caused by database upgrades.
CSV generated from within ZC v1.3.9h was always in the same order as invoices
Previous version also included customer and order info on a line by line basis. Now it seems to be only associated with the first line of an order.
Quote:
Originally Posted by
gjh42
I don't know how mySQL decides to order its results in the absence of specific "order by" commands... that needs someone with expert knowledge. Is there actually a definite order, or does it depend on some random access effects from efficient searching techniques? It might be possible to add an "order by products_id" clause in the right sequence so the overall results keep orders together. I would have to research the sequence of operation of multiple items in the "order by".
I'll have to do a bit more detailed looks but from what I can tell, the csv now appears to be in alpha-numerical order by product name.
I made a lame attempt at using the orders_products_id which I believe to be associated with specific attribute order that matches the invoice order.
Quote:
Originally Posted by
gjh42
Are you wanting the CSV product output to match the invoice order? Does the invoice order match the db stored order, and does that match the order in which the customer actually added the products to the cart?
Yes, the CSV output matched invoice order before now. The invoice order matches the db as best I have been able to tell.
Re: Orders Exporter Module
I checked my files to see if I had added any ordering by product, and I had not. So I don't know why it should now be doing that. I used a natsort() on the query fields, but that is before the query is run, so it can't affect the returned results.
Re: Orders Exporter Module
I did add processing to strip the redundant order and customer info from rows after the first in each order. This should make it easier to read the output and understand which products are in the same order. Is there some reason this causes a problem for you, or was it just an observation?