Skip to content

Module shop cart for TMCms. Can be used for storing any Entity, not only products.

Notifications You must be signed in to change notification settings

neTpyceB/tmcms-module-cart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Example

$articule = new ArticleEntity($post_data['articule_id']);
$product_type = Converter::classWithNamespaceToUnqualifiedShort($articule);

$current_amount = 0;

$current_item_in_cart = ModuleCart::getCurrentCartItems($product_type);
if ($current_item_in_cart) {
    $current_amount = $current_item_in_cart->getAmount();
}

$cart_item = new CartItemEntity();
$cart_item->setAmount($current_amount + $post_data['amount']);
$cart_item->setItemId($articule->getId());
$cart_item->setItemType($product_type);

ModuleCart::addItem($cart_item);

About

Module shop cart for TMCms. Can be used for storing any Entity, not only products.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages