1. Go to this page and download the library: Download amreljako/cybercart library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
namespace Amreljako\CyberCart\Models;
use Illuminate\Database\Eloquent\Model;
use Amreljako\CyberCart\Traits\HasBarcode;
class ProductVariant extends Model
{
use HasBarcode;
}
use Amreljako\CyberCart\Facades\Cart;
// Add an item, running pessimistic row-level validation checks
Cart::addToCart($productVariantId = 1, $quantity = 2);
// Retrieve verified cart contents, checked directly against the product table
$cart = Cart::getCartContent();
$subtotal = $cart['subtotal'];
$items = $cart['items'];
{{-- Render a Code 128 barcode inline as SVG --}}
{!! $productVariant->renderBarcodeSvg() !!}
{{-- Render a QR code linking to the order's tracking page --}}
{!! $productVariant->renderQrCodeSvg('https://yourdomain.com/orders/' . $order->order_number) !!}