Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Olav van Schie committed Oct 3, 2015
2 parents 4442d9f + ead1318 commit 7aacfad
Show file tree
Hide file tree
Showing 8 changed files with 230 additions and 99 deletions.
29 changes: 15 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
mageFaker
MageFaker
=========

**Sample data generator for Magento [WIP]**
**Sample data generator for Magento**

This simple module generates sample data for Magento.
U can insert unlimited data of any type. It is not designed for showcase content, due to duplicated product names and limited images, but it is great for development / testing / benchmarking. It uses names and images from the Magento sample data package.
U can insert unlimited data of any type. It is not designed for showcase content, due to duplicated product names and limited images, but is great for development / testing / benchmarking. Names and images come from the Magento sample data package.

#Features

- Add any number of desired content. 1 - 10.000 products for example (large numbers can take a while)
- Add any number of desired data (large numbers can take a while)
- Products can be assigned to multiple categories
- Ability to remove fake data, without losing "real" content
- Quick create custom categories

#Currently supported data types

- Categories
- Simple products
- Configurable products & color swatches
- Product reviews and ratings
- Categories
- Simple products
- Configurable products with color swatches
- Product reviews and ratings

More to come.
More to come.

#Requirements

Expand All @@ -30,11 +31,11 @@ U can insert unlimited data of any type. It is not designed for showcase content

#How to use

- Copy module files to your project root
- Login to your Magento admin
- Go to system -> Faker data
- Choose your options and press start
- Run indexer
1. Copy module files to your project root
2. Login to your Magento admin
3. Go to system -> MageFaker
4. Choose your options and press start
5. Run indexer

#Enable configurable (color) swatch

Expand Down
26 changes: 15 additions & 11 deletions app/code/community/Ovs/Magefaker/Block/Adminhtml/Faker/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
*/
class Ovs_Magefaker_Block_Adminhtml_Faker_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {

public function __construct()
{
/**
* Set basic config
*/
public function __construct() {
parent::__construct();

$this->_objectId = 'id';
Expand All @@ -24,19 +26,21 @@ public function __construct()
), -100);
}

protected function _prepareLayout() {
parent::_prepareLayout();
if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {
$this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);
}
/**
* Set header
*
* @return string
*/
public function getHeaderText() {
return $this->__('MageFaker - Fake data generator');
}

/**
* Remove icon from header class
*
* @return string
*/
public function getHeaderText()
{
return $this->__('Faker data');
public function getHeaderCssClass() {
return 'head-' . strtr($this->_controller, '_', '-');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function __construct(){

$this->setId('faker_tabs');
$this->setDestElementId('edit_form');
$this->setTitle($this->__('Faker data'));
$this->setTitle(' ');
}

/**
Expand All @@ -21,8 +21,7 @@ public function __construct(){
* @return Mage_Core_Block_Abstract
* @throws Exception
*/
protected function _beforeToHtml()
{
protected function _beforeToHtml() {

$this->addTab('adminhtml_tab_insert', 'ovs_magefaker/adminhtml_faker_edit_tabs_insert');
$this->addTab('adminhtml_tab_remove', 'ovs_magefaker/adminhtml_faker_edit_tabs_remove');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected function _prepareForm()
));

$category->addField('categories_insert', 'select', array(
'label' => $this->__('Amount of categories to insert'),
'label' => $this->__('Amount of fake categories to insert'),
'name' => 'categories_insert',
'value' => '0',
'values' => array(
Expand All @@ -43,7 +43,28 @@ protected function _prepareForm()
'100' => '100',
'250' => '250',
'500' => '500'
)
),
'after_element_html' => 'Ignored when using custom categories'
));

$category->addField('categories_custom', 'text', array(
'label' => $this->__('Custom category names'),
'name' => 'categories_custom',
'after_element_html' => 'Use this categories instead of default Faker categories. Comma separated. '
));

$category->addField('categories_anchor', 'checkbox', array(
'label' => $this->__('Make anchor'),
'name' => 'categories_anchor',
'value' => 1,
'checked' => true
));

$category->addField('categories_image', 'checkbox', array(
'label' => $this->__('Include image'),
'name' => 'categories_image',
'value' => 1,
'checked' => true
));

// product
Expand Down Expand Up @@ -94,6 +115,13 @@ protected function _prepareForm()
'checked' => true
));

$product->addField('products_reviews', 'checkbox', array(
'label' => $this->__('Include reviews and ratings'),
'name' => 'products_reviews',
'value' => 1,
'checked' => true
));

$form->setUseContainer(false);
$this->setForm($form);

Expand Down
Loading

0 comments on commit 7aacfad

Please sign in to comment.