</svg> </button> </div> <div id="cart-preview-pane"> <div id="section-top"> <h2>Your sweet jar</h2> <button id="close-cart-preview" class="close seamless">x</button> </div> <div id="preview-form"> <div id="items"> <div class="cart-item"> <?php $cartItem = $store->pull_product(1); ?> <div class="product-image" style="background-image: url( <?php echo $cartItem->image_source(); ?> );"></div> <div class="product-content"> <div class="details"> <span> <?php echo $cartItem->name; ?> </span> </div> <div class="cart-item-actions">
<?php require_once './../persistence.class.php'; require_once './../Store.class.php'; require_once './../Product.class.php'; $productSharedID = $_POST['sharedID']; $idpattern = "/^(\\w+)-(\\d+)\$/"; preg_match($idpattern, $productSharedID, $match); $section = $match[1]; $store = new Store($section); $product = $store->pull_product($productSharedID); $user = persistence::user(); $user->cart->add($product);