Skip to content

Instantly share code, notes, and snippets.

@Mark-H
Created May 31, 2011 22:29
Show Gist options
  • Save Mark-H/1001424 to your computer and use it in GitHub Desktop.
Save Mark-H/1001424 to your computer and use it in GitHub Desktop.
Create database tables for VisionCart in MODX 2.1+

Use this little snippet to create database tables from the visioncart model to actually use the package when freshly installed.

Put the code in a new snippet, and put the snippet call in any resource. Visit the resource. Try using VisionCart or check your database using PhpMyAdmin to see if the tables were created.

$modx->addPackage('visioncart', $modx->getOption('core_path').'components/visioncart/model/');
$modx->getManager();
$modx->manager->createObjectContainer('vcShop');
$modx->manager->createObjectContainer('vcCategory');
$modx->manager->createObjectContainer('vcProductCategory');
$modx->manager->createObjectContainer('vcProduct');
$modx->manager->createObjectContainer('vcOption');
$modx->manager->createObjectContainer('vcOptionValue');
$modx->manager->createObjectContainer('vcProductOption');
$modx->manager->createObjectContainer('vcModule');
$modx->manager->createObjectContainer('vcOrder');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment