Skip to content

Instantly share code, notes, and snippets.

@real34
Last active August 29, 2015 14:06
Show Gist options
  • Save real34/7d36c50d024849c1c3a2 to your computer and use it in GitHub Desktop.
Save real34/7d36c50d024849c1c3a2 to your computer and use it in GitHub Desktop.
Generates a valid CSV file for french stores for the Magento Store Locator extension. http://www.magentocommerce.com/magento-connect/store-locator-extension-1.html
<?php
require_once __DIR__ . '/vendor/autoload.php';
$faker = Faker\Factory::create('fr_FR');
$output = fopen('php://output', 'w+');
$headers = [
'storelocator_id',
'name',
'status',
'address',
'city',
'state',
'country',
'zipcode',
'latitude',
'longtitude',
'fax',
'phone',
'email',
'link',
'zoom_level',
'image_name',
'tag_store'
];
fputcsv($output, $headers);
for ($i = 0; $i < 200; $i++) {
fputcsv($output, [
$faker->unique()->randomNumber,
$faker->company,
'Enabled',
$faker->streetAddress,
$faker->city,
$faker->departmentName,
'FR',
$faker->postcode,
'',
'',
'',
$faker->phoneNumber,
$faker->companyEmail,
$faker->url,
12,
'',
'',
]);
}
fclose($output);
@real34
Copy link
Author

real34 commented Sep 17, 2014

Much better indeed! I updated the gist in case someday someone will read it :)
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment