opencart/docs/api/Opencart.System.Library.Cart.Cart.html
2024-03-04 23:29:14 +08:00

773 lines
18 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Class Opencart\System\Library\Cart\Cart | OpenCart API API</title>
<link rel="stylesheet" href="http://localhost\opencart-master/docs/api/assets/main.css">
<script src="http://localhost\opencart-master/docs/api/assets/main.js" defer></script>
</head>
<body class="layout">
<div class="layout-aside">
<div class="menu">
<div class="menu-section">
<h3>Namespaces</h3>
<ul>
<li class="menuGroup-item active">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.html">Opencart</a>
<ul>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Admin.html">Admin</a>
</li>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.Catalog.html">Catalog</a>
</li>
<li class="menuGroup-item active">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.html">System</a>
<ul>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Engine.html">Engine</a>
</li>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Helper.html">Helper</a>
</li>
<li class="menuGroup-item active">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.html">Library</a>
<ul>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.Cache.html">Cache</a>
</li>
<li class="menuGroup-item active">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.Cart.html">Cart</a>
</li>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.DB.html">DB</a>
</li>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.Mail.html">Mail</a>
</li>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.Session.html">Session</a>
</li>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.Template.html">Template</a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li class="menuGroup-item">
<a href="http://localhost\opencart-master/docs/api/namespace-none.html">none</a>
</li>
</ul>
</div>
<div class="menu-section">
<h3>Classes</h3>
<ul>
<li class="active">
<a href="http://localhost\opencart-master/docs/api/Opencart.System.Library.Cart.Cart.html">
Cart
</a>
</li>
<li>
<a href="http://localhost\opencart-master/docs/api/Opencart.System.Library.Cart.Currency.html">
Currency
</a>
</li>
<li>
<a href="http://localhost\opencart-master/docs/api/Opencart.System.Library.Cart.Customer.html">
Customer
</a>
</li>
<li>
<a href="http://localhost\opencart-master/docs/api/Opencart.System.Library.Cart.Length.html">
Length
</a>
</li>
<li>
<a href="http://localhost\opencart-master/docs/api/Opencart.System.Library.Cart.Tax.html">
Tax
</a>
</li>
<li>
<a href="http://localhost\opencart-master/docs/api/Opencart.System.Library.Cart.User.html">
User
</a>
</li>
<li>
<a href="http://localhost\opencart-master/docs/api/Opencart.System.Library.Cart.Weight.html">
Weight
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="layout-main">
<div class="layout-navbar">
<nav class="navbar">
<div class="navbar-left">
<ul class="navbar-links">
<li>
<a href="http://localhost\opencart-master/docs/api/index.html">Overview</a>
</li>
<li>
<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.Cart.html">Namespace</a>
</li>
<li class="active"><a href="http://localhost\opencart-master/docs/api/Opencart.System.Library.Cart.Cart.html">Class</a></li> <li>
<a href="http://localhost\opencart-master/docs/api/tree.html">Tree</a>
</li>
</ul>
</div>
<div class="navbar-right">
<div class="search" data-elements="http://localhost\opencart-master/docs/api/assets/elements.js">
<input class="search-input" placeholder="Search class, function or namespace" autofocus>
<ul class="search-results"></ul>
</div>
</div>
</nav>
</div>
<div class="layout-content">
<h1>
Class <a href="http://localhost\opencart-master/docs/api/namespace-Opencart.html">Opencart</a>\<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.html">System</a>\<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.html">Library</a>\<a href="http://localhost\opencart-master/docs/api/namespace-Opencart.System.Library.Cart.html">Cart</a>\<a href="http://localhost\opencart-master/docs/api/Opencart.System.Library.Cart.Cart.html">Cart</a>
</h1>
<table class="classLikeSignatureTable">
</table>
<div class="classLikeDescription">
<div class="description"><p>Class Cart</p>
</div>
</div>
<div class="classLikeSection">
<b>Located at</b> <a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#8" title="Go to source code">system\library\cart\cart.php</a><br>
</div>
<table class="table" id="methods">
<tr>
<th class="table-heading sortable" colspan="3" title="Switch between natural and alphabetical order">Methods</th>
</tr>
<tr class="expandable collapsed" data-order="__construct" id="___construct">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#38-71" title="Go to source code">__construct</a>(<span><a href="http://localhost\opencart-master/docs/api/Opencart.System.Engine.Registry.html"><span title="Opencart\System\Engine\Registry">Registry</span></a> <var>$registry</var></span>)</code>
<div class="expandable-collapsedView">
<p>Constructor</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>Constructor</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#___construct">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="getProducts" id="_getProducts">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#73-359" title="Go to source code">getProducts</a>(): array&lt;int, array&lt;string, mixed&gt;&gt;</code>
<div class="expandable-collapsedView">
<p>getProducts</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>getProducts</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_getProducts">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="add" id="_add">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#361-387" title="Go to source code">add</a>(
<span>int <var>$product_id</var></span>,
<span>int <var>$quantity</var> = <span class="php-num">1</span></span>,
<span>array&lt;mixed&gt; <var>$option</var> = []</span>,
<span>int <var>$subscription_plan_id</var> = <span class="php-num">0</span></span>,
<span>bool <var>$override</var> = <span class="php-kw">false</span></span>,
<span>float <var>$price</var> = <span class="php-num">0</span></span>,
): void</code>
<div class="expandable-collapsedView">
<p>Add</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>Add</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_add">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="update" id="_update">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#389-405" title="Go to source code">update</a>(<span>int <var>$cart_id</var></span>, <span>int <var>$quantity</var></span>): void</code>
<div class="expandable-collapsedView">
<p>Update</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>Update</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_update">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="has" id="_has">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#407-416" title="Go to source code">has</a>(<span>int <var>$cart_id</var></span>): bool</code>
<div class="expandable-collapsedView">
<p>Has</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>Has</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_has">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="remove" id="_remove">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#418-429" title="Go to source code">remove</a>(<span>int <var>$cart_id</var></span>): void</code>
<div class="expandable-collapsedView">
<p>Remove</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>Remove</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_remove">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="clear" id="_clear">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#431-440" title="Go to source code">clear</a>(): void</code>
<div class="expandable-collapsedView">
<p>Clear</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>Clear</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_clear">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="getSubscriptions" id="_getSubscriptions">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#442-457" title="Go to source code">getSubscriptions</a>(): array&lt;int, array&lt;string, mixed&gt;&gt;</code>
<div class="expandable-collapsedView">
<p>getSubscriptions</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>getSubscriptions</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_getSubscriptions">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="getWeight" id="_getWeight">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#459-474" title="Go to source code">getWeight</a>(): float</code>
<div class="expandable-collapsedView">
<p>getWeight</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>getWeight</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_getWeight">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="getSubTotal" id="_getSubTotal">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#476-489" title="Go to source code">getSubTotal</a>(): float</code>
<div class="expandable-collapsedView">
<p>getSubTotal</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>getSubTotal</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_getSubTotal">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="getTaxes" id="_getTaxes">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#491-514" title="Go to source code">getTaxes</a>(): array&lt;int, float&gt;</code>
<div class="expandable-collapsedView">
<p>getTaxes</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>getTaxes</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_getTaxes">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="getTotal" id="_getTotal">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#516-529" title="Go to source code">getTotal</a>(): float</code>
<div class="expandable-collapsedView">
<p>getTotal</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>getTotal</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_getTotal">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="countProducts" id="_countProducts">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#531-546" title="Go to source code">countProducts</a>(): int</code>
<div class="expandable-collapsedView">
<p>countProducts</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>countProducts</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_countProducts">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="hasProducts" id="_hasProducts">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#548-555" title="Go to source code">hasProducts</a>(): bool</code>
<div class="expandable-collapsedView">
<p>hadProducts</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>hadProducts</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_hasProducts">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="hasSubscription" id="_hasSubscription">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#557-564" title="Go to source code">hasSubscription</a>(): bool</code>
<div class="expandable-collapsedView">
<p>hasSubscription</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>hasSubscription</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_hasSubscription">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="hasStock" id="_hasStock">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#566-579" title="Go to source code">hasStock</a>(): bool</code>
<div class="expandable-collapsedView">
<p>hasStock</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>hasStock</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_hasStock">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="hasShipping" id="_hasShipping">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#581-594" title="Go to source code">hasShipping</a>(): bool</code>
<div class="expandable-collapsedView">
<p>hasShipping</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>hasShipping</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_hasShipping">#</a>
</td>
</tr>
<tr class="expandable collapsed" data-order="hasDownload" id="_hasDownload">
<td class="table-cell table-shrink">
<code class="nowrap">
public
</code>
</td>
<td class="table-cell">
<code><a href="http://localhost\opencart-master/docs/api/source-system.library.cart.cart.html#596-609" title="Go to source code">hasDownload</a>(): bool</code>
<div class="expandable-collapsedView">
<p>hasDownload</p>
</div>
<div class="expandable-expandedView">
<div class="description"><p>hasDownload</p>
</div>
</div>
</td>
<td class="table-anchor">
<a href="#_hasDownload">#</a>
</td>
</tr>
</table>
</div>
<div class="layout-footer">
OpenCart API API documentation generated by <a href="https://www.apigen.org">ApiGen dev-master</a>
</div>
</div>
<div class="layout-rest">
<div class="navbar"></div>
</div>
</body>
</html>