Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento 1.9.3 #208

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
de93c85
Magento 1.9.3 launcher compatibility
magentix Oct 19, 2016
caee758
Fixed BO ACL permissions
magentix Oct 19, 2016
888189f
Code readability for insertFromSelect
magentix Nov 4, 2016
e43ab14
Assets import improvement
magentix Nov 4, 2016
83fb8b7
Fix product entity type id
magentix Nov 4, 2016
942cc0b
Removed hardcoded entity type id and default attribute set id
hackwell Feb 23, 2017
73c27b3
Merge pull request #185 from Flagbit/magento-1.9.3
magentix Mar 20, 2017
01edb27
SCP connexion added for images download
magentix Nov 4, 2016
279431b
Useless initialisation deleted
magentix Mar 20, 2017
954cceb
Merge pull request #192 from Agence-DnD/master
magentix Mar 20, 2017
1b97a96
Configurable product improvement with variant axis
magentix Mar 20, 2017
f5468f1
Shell command line added
magentix Mar 20, 2017
be3d899
Fix prefixed tables for asset import
magentix May 17, 2017
5c9fa06
use default locale for family import
torhoehn Aug 4, 2017
dc60cf8
use attributes from family import for mapping
torhoehn Aug 7, 2017
32aa255
refactoring loop
torhoehn Aug 7, 2017
f798828
delete relations table contents before import
torhoehn Aug 8, 2017
f7db7e2
set attribute as configurable
torhoehn Aug 21, 2017
e5b787b
Merge pull request #202 from torhoehn/feature/native-family-export
magentix Aug 28, 2017
2eb5cd6
Merge pull request #203 from torhoehn/feature/native-attribute-export
magentix Aug 28, 2017
aa9c2a8
Merge pull request #197 from seblepers/dev/add-config-deleting-file-a…
magentix Aug 28, 2017
1119229
Merge pull request #196 from seblepers/dev/fix-perf-on-removing-produ…
magentix Aug 28, 2017
9a97e38
Merge pull request #198 from seblepers/dev/removed-hardcoded-entity-t…
magentix Aug 28, 2017
1404f84
Attribute options match improvement
magentix Aug 28, 2017
d27c638
Merge pull request #204 from torhoehn/feature/set-attribute-as-config…
magentix Aug 28, 2017
4a43206
updated readme
torhoehn Aug 28, 2017
006822c
Merge pull request #207 from torhoehn/feature/readme
magentix Aug 28, 2017
a0c9545
Asset association improvement
magentix Sep 4, 2017
7328df8
Fix single image association
magentix Oct 5, 2017
acc0aa1
Add LOCAL option to LOAD DATA INFILE statement in configuration
magentix Oct 6, 2017
16593f1
Fix prefixed table for variant & asset
magentix Oct 9, 2017
89bbac0
#213 - Fix wrong function call to replace ->getDefaultAttributSetId()…
barig Oct 12, 2017
c459d13
Add SCP authentication with ssh key
DnD-Magnum Nov 6, 2017
de271f7
Fix check config for CRON enabled
DnD-Magnum Nov 6, 2017
6a2c707
Fixes #219 creates custom source model for connexion type
riconeitzel Nov 7, 2017
88a2952
Merge pull request #220 from riconeitzel/issue-219
Nov 10, 2017
1c6d542
Fixes #223
riconeitzel Dec 4, 2017
bb893c7
Missing event added
magentix Jan 10, 2018
cf398ad
Merge pull request #224 from riconeitzel/patch-2
magentix Feb 1, 2018
1dd3f29
Images: Removed hardcoded entity type id
Oct 18, 2017
b060f62
[BUGFIX] GITHUB-215 Remove UTF8-BOM from values that come from CSV th…
kanduvisla Oct 17, 2017
063b8e3
Asset added to shell import
magentix Feb 1, 2018
d5056a0
Fix asset sort order while importing product
DnD-Hellion Feb 1, 2018
7450f57
Fix family update in attribute import for prefixed tables
DnD-Hellion Nov 10, 2017
f3c83ef
Readme Updated
magentix Feb 1, 2018
c69b22d
Documentation added
magentix Feb 1, 2018
18f5812
#1.4-dev : Create module Pimgento_VarientFamily
Dnd-Clowny Feb 28, 2018
a9221c0
#1.4-dev : adapt Pimgento_Variant import to akeneo2
Dnd-Clowny Feb 28, 2018
ce5c3c2
#1.4-dev : create pimgento_variantfamily import
Dnd-Clowny Feb 28, 2018
2a293a7
fixed bug in product import
josefbehr Feb 15, 2018
3338c18
#all : Add PIMGento official website mention
Feb 28, 2018
7f43a88
Fix asset configuration wrongly named causing asset download and conf…
DnD-Hellion Mar 7, 2018
8731f0d
Code fix & style
magentix Apr 24, 2018
39628b2
Fill configurable attributes with product model data
magentix Apr 24, 2018
bc767ce
Attribute configurable option automatically updated
magentix Apr 24, 2018
37661d9
Merge pull request #232 from Agence-DnD/1.4-dev
magentix Apr 24, 2018
6f91b13
Translation updated
magentix Apr 25, 2018
4d0e316
Documentation updated
magentix Apr 25, 2018
a6e222c
variant-family-cron : Update Pimgento_VariantFamily_Model_Cron class …
Dnd-Gimix Oct 18, 2018
be1c512
documentation : Update readme and wrong tagging for different Magent…
Dnd-Gimix Oct 18, 2018
c0b45cf
Merge pull request #238 from Agence-DnD/feature/documentation_1.9.3
Dnd-Gimix Oct 18, 2018
67c0e7f
Merge pull request #239 from Agence-DnD/feature/variant_family_cron
Dnd-Gimix Oct 18, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 17 additions & 126 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# PIMGento

![alt text][logo]
[logo]: http://i.imgur.com/0KabJ2e.png "PIMGento : "

PIMGento is a Magento extension that allows you to import your catalog from Akeneo CSV files into Magento.

# Magento >= 1.9.3
You can discover PIMGento on the official website (https://www.pimgento.com/docs/v1.0/).

## Documentation

For Magento >= 1.9.3, referer to branch magento-1.9.3
PIMGento complete documentation is available [here](doc/summary.md).

## How it works

Expand All @@ -23,11 +22,16 @@ With PIMGento, you can import :
* Products
* Products positions by category
* Images
* Variants or Product Model (Akeneo >= 2.0)
* Variant family (Akeneo >= 2.0)
* Stocks
* Assets (Akeneo E.E >= 1.5)

**Note:** Pimgento_VariantFamily must be disabled for Akeneo < 2.0

## Features

* **Plug and Play:** We payed attention to the code and followed the Magento code instructions so you can easily install this extension on your store without any troubleshooting (see [installation](#installation)).
* **Plug and Play:** We payed attention to the code and followed the Magento code instructions so you can easily install this extension on your store without any troubleshooting.

* **Totally flexible:** We added plenty of configurations. We didn't write any specific value in our code : No hard coding.

Expand All @@ -46,7 +50,7 @@ With PIMGento, you can import :
* **Multi-X:** PIMGento supports all types of Magento structure. If you have multi-website and multi-store with lot of different languages, imports will still work well.

## Demo / POC
* Magento setup with Akeneo sample data in less than [4 minutes !] (https://www.youtube.com/watch?v=MpC01qVIVFA )
* Magento setup with Akeneo sample data in less than [4 minutes !](https://www.youtube.com/watch?v=MpC01qVIVFA)

<a href="http://www.youtube.com/watch?feature=player_embedded&v=MpC01qVIVFA
" target="_blank"><img src="http://img.youtube.com/vi/MpC01qVIVFA/0.jpg"
Expand All @@ -57,134 +61,21 @@ alt="Video PIMGento for Akeneo" width="240" height="180" border="10" /></a>
## Requirements

* Akeneo PIM >= 1.3 (CE & EE)
* Akeneo Enhanced Connector
* Magento >= 1.9 CE
* Magento >= 1.14 EE
* Set local_infile mysql variable to TRUE
* Database encoding must be UTF-8
* Flash Player

You have to install the EnhancedConnectorBundle (https://github.com/akeneo-labs/EnhancedConnectorBundle/) in order to generate appropriate CSV files for Magento.

> Compatibility for previous Magento versions are in development (see [roadmap](#roadmap))

## Installation

### Manually
* Copy the folder _app/code/community/Pimgento_ and paste it in the folder _app/code/community_
* Copy the folder _app/design/adminhtml/default/default/template/pimgento_ and paste it in the folder _app/design/adminhtml/default/default/template_
* Copy the file _app/design/adminhtml/default/default/layout/pimgento.xml_ and paste it in the folder _app/design/adminhtml/default/default/layout_
* Copy the file _app/etc/modules/Pimgento_All.xml_ and paste it in the folder app/etc/modules
* Copy the folder _skin/adminhtml/default/default/pimgento_ and paste it in the folder _skin/adminhtml/default/default_
* Clear the cache (System > Cache Management)
* Disconnect / reconnect to the Back Office
* Refresh Magento compilation (System > Tools > Compilation)

### Via composer

- Add into in the `require` section:

`"agence-dnd/pimgento":"dev-master"`

- Add into the `repositories` section:

```
{
"type": "vcs",
"url": "[email protected]:Agence-DnD/PIMGento.git"
}
```

### Via modman

`modman clone [email protected]:Agence-DnD/PIMGento.git`

## Configuration and Usage

* Allow magento to follow symlinks in "System > Advanced > Developer > Templates Settings" (set to "yes")
* Configure your store language and currency before import
* After category import, set the "Root Category" for store in "System > Manage Store"
* After attributes import, set attributes used to create configurable products

> All PIMGento configurations can be found in the Magento Back-end at this path:
**System > Configuration > Catalog > Pimgento**

* **General**
* **_Enable Log_:_** if set Yes, write everything happens during the import in a file.
* **_Log file:_** Log file name in var/log directory.
* **_CSV line ending:_** Choose the character used to make a carriage return.
* **_CSV delimiter:_** Choose the delimiter of your CSV files.
* **_Admin language:_** Default language for admin values (products, categories, attributes, options). Example: en_US, de_DE, fr_FR...
* **_Add website mapping:_** Match Magento website with PIM channel

* **Categories**
* **_Enable Cron:_** if set Yes, you can enable the automatic import.
* **_CRON expression:_** Configure when the automatic import will execute.
* **_File:_** The filename of the CSV file used for the automatic import.
* **_Clear cache:_** Choose which cache you want to clear after the import.
* **_PIM code exclusion:_** PIM codes not to add in Magento, comma separated. Example: CAT01,CAT18,CAT56
* **_Category depth:_** Choose the depth of your e-commerce navigation.
* **_Is anchor:_** If set yes, all categories will be created as an anchor category.
* **_Update url key:_** If set yes, it will create automatically an URL rewrite if the category name changed.

* **Families**
* **_Enable Cron:_** if set Yes, you can enable the automatic import.
* **_CRON expression:_** Configure when the automatic import will execute.
* **_File:_** The filename of the CSV file used for the automatic import.
* **_Clear cache:_** Choose which cache you want to clear after the import.
* **_PIM code exclusion:_** PIM codes not to add in Magento, comma separated. Example: FAM01,FAM18,FAM56

* **Attributes**
* **_Enable Cron:_** if set Yes, you can enable the automatic import.
* **_CRON expression:_** Configure when the automatic import will execute.
* **_File:_** The filename of the CSV file used for the automatic import.
* **_Clear cache:_** Choose which cache you want to clear after the import.
* **_PIM code exclusion:_** PIM codes not to add in Magento, comma separated. Example: ATT01,ATT18,ATT56
* **_Specific types:_** You can make a mapping between PIM and MAGENTO attributes types.

* **Options**
* **_Enable Cron:_** if set Yes, you can enable the automatic import.
* **_CRON expression:_** Configure when the automatic import will execute.
* **_File:_** The filename of the CSV file used for the automatic import.
* **_Clear cache:_** Choose which cache you want to clear after the import.
* **_PIM code exclusion:_** PIM codes not to add in Magento, comma separated. Example: OPT01,OPT18,OPT56

* **Products**
* **_Enable Cron:_** if set Yes, you can enable the automatic import.
* **_CRON expression:_** Configure when the automatic import will execute.
* **_File:_** The filename of the CSV file used for the automatic import.
* **_Clear cache:_** Choose which cache you want to clear after the import.
* **_PIM code exclusion:_** PIM codes not to add in Magento, comma separated. Example: SKU01,SKU18,SKU56
* **_Match attributes:_** You can make a mapping between PIM and MAGENTO attributes for simple product.
* **_Default tax class:_** Choose the default tax class for each product imported.
* **_Create Configurable:_** If set yes, it will create configurable product from the simple product data.
* **_Configurable attributes:_** attributes to use for create configurable products
* **_Configurable values:_** You can make a mapping between PIM and MAGENTO attributes for configurable product.

* **Images**
* **_Enable Cron:_** if set Yes, you can enable the automatic import.
* **_CRON expression:_** Configure when the automatic import will execute.
* **_File:_** The filename of the CSV file used for the automatic import.
* **_Delete image:_** If set Yes, delete all images used for the import.

* **Stock**
* **_Enable Cron:_** if set Yes, you can enable the automatic import.
* **_CRON expression:_** Configure when the automatic import will execute.
* **_File:_** The filename of the CSV file used for the automatic import.

* **Product position**
* **_Enable Cron:_** if set Yes, you can enable the automatic import.
* **_CRON expression:_** Configure when the automatic import will execute.
* **_File:_** The filename of the CSV file used for the automatic import.

> **NB**: PIMGento uses native Magento Cronjob, so you have nothing to add in your Crontab.
## Installation, Configuration and Usage

If you want to know how to install, configure or use PIMGento, please check [how to...](doc/important_stuff/how_to.md) section. We advise you to start here!

## Roadmap

* Compatibility with Magento >= 1.6 CE
* Compatibility with Magento >= 1.10 EE
* Create this type of product : Bundle, packed, virtual and downloadable products.
* Think about a way to delete data
We have updated our roadmap. Just go [here](doc/important_stuff/roadmap.md).

## About us

Founded by lovers of innovation and design, [Agence Dn'D] (http://www.dnd.fr) assists companies for 11 years in the creation and development of customized digital (open source) solutions for web and E-commerce.
Founded by lovers of innovation and design, [Agence Dn'D](http://www.dnd.fr) assists companies for 11 years in the creation and development of customized digital (open source) solutions for web and E-commerce.
2 changes: 1 addition & 1 deletion app/code/community/Pimgento/Asset/Model/Cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Pimgento_Asset_Model_Cron extends Pimgento_Core_Model_Cron
*/
public function run(Mage_Cron_Model_Schedule $schedule)
{
if (!Mage::getStoreConfig('pimdata/attribute/cron_enabled')) {
if (!Mage::getStoreConfig('pimdata/asset/cron_enabled')) {
return $this;
}

Expand Down
54 changes: 38 additions & 16 deletions app/code/community/Pimgento/Asset/Model/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public function insertData($task)
public function updateColumns($task)
{
$adapter = $this->getAdapter();
$resource = $this->getResource();

/* Clean Up */
$adapter->delete($this->getTable(), array('reference_file = ""'));
Expand All @@ -76,7 +77,7 @@ public function updateColumns($task)
$websites = unserialize(Mage::getStoreConfig('pimdata/general/websites'));

$codes = $adapter->fetchPairs(
$adapter->select()->from($adapter->getTableName('core_website'), array('code', 'website_id'))
$adapter->select()->from($resource->getTable('core/website'), array('code', 'website_id'))
);

$adapter->addColumn($this->getTable(), 'website_id', 'INT(11) NULL');
Expand All @@ -102,7 +103,7 @@ public function updateColumns($task)
$stores = $adapter->fetchPairs(
$adapter->select()
->from(
$adapter->getTableName('core_store'),
$resource->getTable('core/store'),
array('website_id', $this->_zde('GROUP_CONCAT(`store_id` SEPARATOR ",")'))
)
->where('website_id <> ?', 0)
Expand All @@ -122,7 +123,7 @@ public function updateColumns($task)
foreach ($ids as $storeId) {
$local = $adapter->fetchOne(
$adapter->select()
->from($adapter->getTableName('core_config_data'), array('value'))
->from($resource->getTable('core/config_data'), array('value'))
->where('path = ?', 'general/locale/code')
->where('scope_id = "' . $storeId . '" OR scope_id = 0')
->order('scope_id DESC')
Expand Down Expand Up @@ -151,10 +152,13 @@ public function updateColumns($task)
*/
public function updateTable($task)
{
$adapter = $this->getAdapter();
$adapter = $this->getAdapter();

/* @var $resource Mage_Core_Model_Resource */
$resource = Mage::getSingleton('core/resource');

/* Clean up table */
$adapter->truncateTable($adapter->getTableName('pimgento_asset'));
$adapter->truncateTable($resource->getTableName('pimgento_asset'));

/* Insert data from tmp table */
$select = $adapter->select()->from(
Expand Down Expand Up @@ -184,7 +188,7 @@ public function updateTable($task)
'thumbnail' => $file,
);

$adapter->insert($adapter->getTableName('pimgento_asset'), $data);
$adapter->insert($resource->getTableName('pimgento_asset'), $data);
}
}

Expand All @@ -202,6 +206,8 @@ public function dropTable($task)
{
$this->getRequest()->dropTable($this->getCode());

Mage::dispatchEvent('task_executor_drop_table_after', array('task' => $task));

return true;
}

Expand All @@ -214,13 +220,16 @@ public function dropTable($task)
*/
public function downloadImages($task)
{
$adapter = $this->getAdapter();
$adapter = $this->getAdapter();

/* @var $resource Mage_Core_Model_Resource */
$resource = Mage::getSingleton('core/resource');

try {
$connexion = Mage::getStoreConfig('pimdata/asset/connexion');

$select = $adapter->select()->from(
$adapter->getTableName('pimgento_asset'),
$resource->getTableName('pimgento_asset'),
array('file', 'image')
);

Expand All @@ -239,7 +248,7 @@ public function downloadImages($task)
$config = array(
'host' => Mage::getStoreConfig('pimdata/asset/host'),
'user' => Mage::getStoreConfig('pimdata/asset/user'),
'password' => Mage::getStoreConfig('pimdata/asset/password'),
'password' => Mage::getStoreConfig('pimdata/asset/ftp_password'),
);

if (Mage::getStoreConfig('pimdata/asset/directory')) {
Expand All @@ -260,7 +269,7 @@ public function downloadImages($task)
$config = array(
'host' => Mage::getStoreConfig('pimdata/asset/host'),
'username' => Mage::getStoreConfig('pimdata/asset/user'),
'password' => Mage::getStoreConfig('pimdata/asset/password'),
'password' => Mage::getStoreConfig('pimdata/asset/ftp_password'),
);

$ftp->open($config);
Expand All @@ -286,12 +295,25 @@ public function downloadImages($task)
}

} elseif ($connexion == 'scp') {
$connection = ssh2_connect(Mage::getStoreConfig('pimdata/asset/host'), 22);
ssh2_auth_password(
$connection,
Mage::getStoreConfig('pimdata/asset/user'),
Mage::getStoreConfig('pimdata/asset/password')
);
$connexionType = Mage::getStoreConfig('pimdata/asset/connexion_type');

if($connexionType == 'password'){
$connection = ssh2_connect(Mage::getStoreConfig('pimdata/asset/host'), 22);
ssh2_auth_password(
$connection,
Mage::getStoreConfig('pimdata/asset/user'),
Mage::getStoreConfig('pimdata/asset/scp_password')
);
}else{
$connection = ssh2_connect(Mage::getStoreConfig('pimdata/asset/host'), 22, array('hostkey'=>'ssh-rsa'));
ssh2_auth_pubkey_file(
$connection,
Mage::getStoreConfig('pimdata/asset/user'),
Mage::getBaseDir('var') . DS . Mage::getStoreConfig('pimdata/asset/ssh_public_key'),
Mage::getBaseDir('var') . DS . Mage::getStoreConfig('pimdata/asset/ssh_private_key'),
Mage::getStoreConfig('pimdata/asset/ssh_passphrase')
);
}

while (($row = $query->fetch())) {
if (is_file($directory . $row['image'])) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php
/**
* @author Rico Neitzel, Büro 71a <[email protected]>
* @copyright Copyright (c) 2017 Büro 71a, Neitzel und Klose GbR (buro71a.de)
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

class Pimgento_Asset_Model_System_Config_Source_Connexion_Type
{

/**
* Options getter
*
* @return array
*/
public function toOptionArray()
{
$options = array(
array(
'value' => 'password',
'label' => Mage::helper('core')->__('Password'),
),
array(
'value' => 'key',
'label' => Mage::helper('core')->__('Key file'),
),
);

return $options;
}

/**
* Get options in "key-value" format
*
* @return array
*/
public function toArray()
{
$options = array(
'password' => Mage::helper('core')->__('Password'),
'key' => Mage::helper('core')->__('Key file'),
);

return $options;
}

}
Loading