CSV export for sellers

General Discussion about the commercial Enuuk Auction Platform
Post Reply
bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

CSV export for sellers

Post by bamse » Wed Jun 12, 2013 1:59 pm

I implemented CSV export of auction data for sellers in the same way as in the admin backend. If interested I can post code, but it is really just a copy paste.

One minor thing I got stuck with is the location of the CSV theme file. In class/View/CSV.php I have:

Code: Select all

case 'userAllOffers.php':
                $data['template'] = 'userAllOffersCSV.php';
                $fileName = _('auction');
            break;
and I have the file userAllOffersCSV.php in themes/admin/

Is it possible to somehow (how?) change the file location to themes/default/ and still declare the template in class/View/CSV.php or would I have to write my own user CSV view?

RWAP
Site Admin
Posts: 750
Joined: Fri Jan 08, 2010 2:23 am
Location: Stoke-on-Trent
Contact:

Re: CSV export for sellers

Post by RWAP » Wed Jun 12, 2013 3:09 pm

The problem is in class\View\CSV.php:

Code: Select all

        if($showView){
            extract($data);
            ini_set('short_open_tag','1');
            header("Content-type: application/csv");
            $fileName .= '-'.date('Y-m-d');
            header("Content-Disposition: attachment; filename=".$fileName.".csv");
            require_once('themes/admin/'.$template);
        }
You would need to alter this to :

Code: Select all

            if ($userView){
            	require_once('themes/default/'.$template);
            } else {
	            require_once('themes/admin/'.$template);
            }
And change your code which specifies the template to use, to set

Code: Select all

$userView = true;

bamse
Posts: 220
Joined: Mon Feb 06, 2012 12:05 pm
Contact:

Re: CSV export for sellers

Post by bamse » Fri Jun 14, 2013 6:16 am

Thanks, works like a charm.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest