Beispiel #1
0
 public function cart_addproduct()
 {
     $data = Input::all();
     $product = Product::find((int) $data['id']);
     if ($product->getDiscount) {
         $price = getItemPrice($product->price, $product->getTax, $product->getDiscount);
     } else {
         $price = getItemPrice($product->price, $product->getTax);
     }
     $images = getProductImages($product);
     $maxQty = $product->quantity;
     $quantity = ceil($data['stock']);
     // ceil for the abuse floats and decimals
     if ($quantity >= $maxQty) {
         $quantity = $maxQty;
     } elseif ($quantity < 0) {
         $quantity = 1;
     }
 }
Beispiel #2
0
 public function post_JXcreate()
 {
     $data = Input::all();
     $product = Product::find((int) $data['id']);
     $price = getItemPrice($product);
     $images = getProductImages($product);
     $maxQty = $product->quantity;
     $quantity = ceil($data['stock']);
     // ceil for the abuse floats and decimals
     //Checking measures of our number if negative or is float or its more than our stock.
     if ($quantity >= $maxQty) {
         $quantity = $maxQty;
     } elseif ($quantity < 0) {
         $quantity = 1;
     }
     $Identifier = $this->getIdentifier();
     if (Cache::has('user_cart.' . $Identifier)) {
         $currentcart = Cache::get('user_cart.' . $Identifier);
         if (array_key_exists($product->id, $currentcart)) {
             $currentcart[$product->id]['_qty'] = $currentcart[$product->id]['_qty'] + $quantity;
             //999
             if ($currentcart[$product->id]['_qty'] >= $maxQty) {
                 $currentcart[$product->id]['_qty'] = $maxQty;
                 //girilen sayı, toplam stoktaki sayıdan büyük veya eşitse her daim max stok sayısı gir.
             }
             Cache::forever('user_cart.' . $Identifier, $currentcart);
             $message = Lang::line('cart_lang.add_cart_fix', array('name' => $product->getDetail->name, 'number' => $quantity))->get();
         } else {
             $currentcart[$product->id] = array('_sku' => $product->sku, '_qty' => $quantity);
             Cache::forever('user_cart.' . $Identifier, $currentcart);
             $message = Lang::line('cart_lang.add_cart', array('name' => $product->getDetail->name))->get();
         }
     } else {
         $arrayval = array($product->id => array('_sku' => $product->sku, '_qty' => $quantity));
         Cache::forever('user_cart.' . $Identifier, $arrayval);
         $message = Lang::line('cart_lang.add_cart', array('name' => $product->getDetail->name))->get();
     }
     $images = $images != null ? $images->main->tiny : null;
     return Response::json(array('product_name' => $product->getDetail->name, 'product_price' => $price, 'variant' => $product->getDetail->variant, 'img' => $images, 'message' => $message));
 }
											<input type="file" name="userfile[]"></td>
										<td  align="center">
											<input type="hidden" name="active[]" value="1" class="active" />
											<input type="radio" name="activeImage[]" checked="" onclick="$('.active').val(0);$(this).prev().val(1)" value="1" />
										</td>
										<td align="center">
											<div id="imageAdd" onclick="imageAdd()" style="font-size:20px;color:#00c0ff;cursor:pointer"><i class="fa fa-plus-square"></i></div>
										</td>
									</tr>
								</tbody>
							</table>
							
						</div>
					</div>
					<?php 
$images = getProductImages($product);
?>
					<div class="row-fluid">
						<div class="span12">
							<div class="row-fluid">
							    <ul class="thumbnails">
							    @foreach($images->images as $item)
							    	<li class="span2">
							   			<div class="thumbnail">
							    			<img src="<?php 
echo $item->tinym;
?>
" />
							    			<p><a id="del-image" style="cursor:pointer" data-id="{{$item->id}}"><i class="fa fa-times"></i> Sil</a></p>
						    			</div>
							    	</li>
<div class="row-fluid">
	<div class="span12">
		<div class="block-header">
			<p>EN BEĞENİLEN ÜRÜNLER</p>
		</div>
	</div>
	<div class="row-fluid">
	@foreach($result as $res)
		@if($res->getProductsMostView4sq)
			<?php 
$count = 0;
$numItems = count($res->getProductsMostView4sq);
?>
			@foreach($res->getProductsMostView4sq as $item)
				<?php 
$images = getProductImages($item);
?>
				@if($item->getImages)
					<?php 
$price = getItemPrice($item);
?>
				@endif
					<div class="span3">
					  <div class="thumbnail" style="padding: 0">
						<div style="padding:4px">
						@if($item->getImages)
							<a href="{{URL::base()}}/product/<?php 
echo $item->alias;
?>
" class="thumbnailimg">
							<img alt="{{$item->getDetail->name}}" src="{{$images->main->small}}" style="display:block;margin:0 auto;" /></a>
				<tr>
					<th style="width: 5%"><p class="text-center">Sipariş</p></th>
					<th style="width: 10%"><p class="text-left">Ürün Bilgileri</p></th>
					<th style="width: 5%"><p class="text-center">Adet</p></th>
					<th style="width: 10%"><p class="text-center">Fiyat</p></th>
					<th style="width: 7%"><p class="text-center">Kargo Bilgileri</p></th>
					<th style="width: 15%"><p class="text-center">Sipariş Durumu</p></th>
					<th style="width: 10%"><p class="text-center">Sipariş Tarihi</p></th>
				</tr>
			</thead>
			<tbody>
				@foreach($order as $item)
				<tr>
					<td><a href="/user/order/{{$hasher->encrypt($item->id)}}">{{$hasher->encrypt($item->id)}}</a></td>
					<?php 
$images = getProductImages($item->getProduct);
$price = getItemPrice($item->getProduct->price, $item->getProduct->getTax, $item->getProduct->getDiscount);
?>
					<td>
					<div class="order-prod">
					<img alt="{{$item->getProduct->getDetail->name}}" src="<?php 
echo $images->main->tinym;
?>
">
					<p class="text-center"><strong><?php 
echo $item->getProduct->getDetail->name;
?>
</strong></p>
					<span><?php 
echo $item->getProduct->getDetail->variant;
?>
@layout('layouts.default')

@section('content')

{{-- Getting Images --}}
<!-- TODO: fiyatlara cache ekle ürün başına -->
<?php 
$productObj = $product->getProducts[0];
$images = getProductImages($productObj);
$price = getItemPrice($productObj);
?>
{{-- Getting Images --}}
<div class="row-fluid">
	<div class="span12">
		<div id="breadcrumb">
			<ul class="breadcrumb" style="margin-bottom: 5px;">
			<li>
				<a href="{{URL::base()}}">Ana Sayfa</a>
				<span class="divider">/</span>
			</li>
			<li>
				Ana Kategori : <a href="{{URL::base()}}/category/{{$product->getTopCat->getDescriptions->alias}}">{{$product->getTopCat->getDescriptions->name}}</a>
				<span class="divider">/</span>
			</li>
			<li>
				Kategori : <a href="{{URL::base()}}/category/{{$product->getDescriptions->alias}}">{{$product->getDescriptions->name}}</a>
				<span class="divider">/</span>
			</li>
			<li class="active">{{$productObj->getDetail->name}}</li>
			</ul>
		</div>