1

(I am not 100% sure that this is the extension but I think so - it is in Community/Webshopapps/ordermanager and looks like the most likely extension listed at http://www.magentocommerce.com/magento-connect/developer/WebShopApps)

I have been asked to remove a line break in one column of the csv file that is exported by Blue Jalappeno Order Export. Some of the "Shipping Street" entries have a line break so that the street address looks like this:

"Appartment 3

6 Main St"

instead of "Appartment 3 6 Main St"

The client is unable to do whatever it is he is trying to do with this csv because of the line break so I want to replace it with a space or a dash. It will be done by a cron job so a simple find/replace on the csv wont work.

I have tried the following:

$file = str_replace(array("\n", "\r"), ' - ', $file); 

in the switch in Webshopapps_Ordermanager_Sales_Order_ExportController

$order = str_replace(array("\n", "\r"), ' - ', $order); 

in the foreach loop in Webshopapps_Ordermanager_Model_Export_Csv::exportOrders($orders)

Has anyone any experience with this extension? Am I on the right track?

2

I would add the check and replace at a lower level.

Have a look in Model/Export/Csv.php and you'll see where it gets the billing and shipping address street. From memory it calls out to a function in Abstractcsv.php to format this. You could modify in the function in Abstractcsv.php to remove any line breaks or do this replace within CSV.php

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.