Last active
August 29, 2015 14:23
-
-
Save yireo/d937cb17126d542a69c2 to your computer and use it in GitHub Desktop.
Vm2Mage plugin for manipulate VirtueMart data before migration to Magento
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
defined('_JEXEC') or die(); | |
class PlgSystemCustom extends JPlugin | |
{ | |
/** | |
* Plugin event dealing with raw VirtueMart data | |
*/ | |
public function onVm2MageItemConvertBefore($item, $type) | |
{ | |
if ($type == 'product') | |
{ | |
if (isset($item['dummy_attribute1'])) | |
{ | |
$item['dummy_attribute2'] = $item['dummy_attribute1']; | |
} | |
} | |
} | |
/** | |
* Plugin event dealing with VirtueMart data manipulated by Vm2Mage | |
*/ | |
public function onVm2MageItemConvertAfter($item, $type) | |
{ | |
if ($type == 'product') | |
{ | |
if (isset($item['dummy_attribute1'])) | |
{ | |
$item['dummy_attribute2'] = $item['dummy_attribute1']; | |
} | |
} | |
} | |
/** | |
* Plugin event to change a VirtueMart attribute-name to be Magento compliant | |
*/ | |
public function onVm2MageAttributeLoadName(&$attributeName) | |
{ | |
if ($attributeName == 'colour') | |
{ | |
$attributeName = 'color'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment