Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted
Sorry as have done search and sure this must be about but....

 

how do I export my sales data into an excel document please?

 

Been looking for a similar situation, but have come up empty handed. So I spent a few hours bang my head and came up with this.

 

If the only information you need is on the orders page as did I in order to export excel to QIF, then there is a "fix". The default orders.php won't let you cut and paste due to the mouseover and links. You can remove those and be able to cut/paste from the orders list to Excel.

 

First, download and rename orders.php to something else like orders2.php. After you make the change just change the address in your address bar to /catalog/admin/orders2.php... If you like how the change works, then you can make it permanent by naming it back to orders.php. Note: the language/filenames won't recognize this change, but no big deal if you just want to cut/paste and then go back to your normal orders.php.

 

I realize that my orders.php already has some mods so this may not be the default.

 

I found this (line 370 of stock file):

 

if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
	echo '			  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID', 'action')) . 'oID=' . $oInfo->orders_id . '&action=edit') . '\'">' . "\n";
  } else {
	echo '			  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, tep_get_all_get_params(array('oID')) . 'oID=' . $orders['orders_id']) . '\'">' . "\n";
  }
?>

 

and changed it to this:

 

if (isset($oInfo) && is_object($oInfo) && ($orders['orders_id'] == $oInfo->orders_id)) {
	echo '			  <tr id="defaultSelected" class="dataTableRowSelected">' . "\n";
  } else {
	echo '			  <tr class="dataTableRow">' . "\n";
  }
?>

 

Now I can cut and paste from the orders list to Excel. For me I wanted to remove all the hyperlinks and images that copy over, it took seconds to find the macros on google to do both.

 

Remove hyperlinks:

Sub RemoveHyperlinks()

'Remove all hyperlinks from the active sheet
ActiveSheet.Hyperlinks.Delete

End Sub

 

Remove images:

Sub tester()
Dim DrObj
Dim Pict
Set DrObj = ActiveSheet.DrawingObjects
For Each Pict In DrObj
If Left(Pict.Name, 7) = "Picture" Then
Pict.Select
Pict.Delete
End If
Next
End Sub

 

So cut and paste away!

 

orders.jpg

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...