0.1.2 • Published 3 years ago

opencart-manager v0.1.2

Weekly downloads
8
License
ISC
Repository
github
Last release
3 years ago

opencart-manager

Node.js package written in Typescript that allows you to manage your opencart store data easily. Create products, attach categories or extract existing entities to edit them. Multilanguage supported.

Installation

npm i opencart-manager

Usage

import opencartManager from 'opencart-manager';

const opencart = opencartManager({
    host: 'host',
    user: 'user',
    password: 'password',
    database: 'database',
});

// Create new product
const product = opencart.product.create()
    .setData({ price: 800 })
    .setDescription({ languageId: 1, name: 'Apple iPhone X 256GB' })
    .setDescription({ languageId: 2, name: 'Apple iPhone X 256ГБ' })

await product.save();

// Attach product to an existing category
const category = await opencart.category.extract({ categoryId: 1 });
await product.toCategory(category);

// Update product
product.setData({ quantity: 250 });
await product.update();

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago