Skip to content

Instantly share code, notes, and snippets.

@yireo
Last active August 29, 2015 14:23
Show Gist options
  • Save yireo/d937cb17126d542a69c2 to your computer and use it in GitHub Desktop.
Save yireo/d937cb17126d542a69c2 to your computer and use it in GitHub Desktop.
Vm2Mage plugin for manipulate VirtueMart data before migration to Magento
<?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