RuKoder.ru RUKODER.ru
06 ФЕВР 2018
0

laracart - пакет для создания товарной корзины в laravel

PHP
LaraCart::add(
    $itemID,
    $name = null,
    $qty = 1,
    $price = '0.00',
    $options = [],
    $taxable = true,
    $lineItem = false
)

// Adding an item to the cart
LaraCart::add(2, 'Shirt', 200, 15.99, [
    'size' => 'XL'
]);

// If you need line items rather than just updating the qty you can do
LaraCart::addLine(2, 'Shirt', 200, 15.99, [
    'size' => 'XL'
]);

// Also you can have your item not taxed
$item = LaraCart::addLine(2, 'Shirt', 200, 15.99, [
    'size' => 'XL'
    ],
    $taxable = false
);

https://github.com/lukepolo/laracart

Добавить комментарий

Категории:

  • CSS (121)
  • PHP (301)
  • JavaScript (704)

Оставить на заметку в:

© 2023 RuKoder.ru