• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CodeCommerce\Category类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中CodeCommerce\Category的典型用法代码示例。如果您正苦于以下问题:PHP Category类的具体用法?PHP Category怎么用?PHP Category使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Category类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: edit

 public function edit($id, Category $category)
 {
     $product = $this->productsmodel->find($id);
     $categories = $category->lists('name', 'id');
     $tags = $product->tag_list;
     return view('products.edit', compact('product', 'categories'), compact('tags'));
 }
开发者ID:mborgesmartins,项目名称:lcodecommerce,代码行数:7,代码来源:ProductsController.php


示例2: porudctTag

 public function porudctTag(Category $category, $id)
 {
     $categories = $category->all();
     $productsTag = $this->tag->find($id);
     $tags = $this->tag->all();
     //  dd($product->tags);
     return view('store.productsTag', compact('categories', 'tags', 'productsTag'));
 }
开发者ID:jaysongyn,项目名称:CodeCommerce,代码行数:8,代码来源:StoreController.php


示例3: edit

 public function edit($id, Category $category)
 {
     $categories = $category->lists('name', 'id');
     $product = $this->product->find($id);
     $tagsString = $this->product->transformaString($product->tags);
     return $this->factory->make('admin.products.edit', compact('product', 'categories', 'tagsString'));
     //return view('admin.products.edit', compact('product', 'categories', 'tagsString'));
 }
开发者ID:shuttzz,项目名称:laravel-commerce,代码行数:8,代码来源:AdminProductsController.php


示例4: edit

 public function edit($id, Category $category)
 {
     $categories = $category->lists('name', 'id');
     $product = $this->products->find($id);
     $tags = $product->tags->lists('name')->toArray();
     $tags = implode(",", $tags);
     return view('admin.products.edit', compact('product', 'categories', 'tags'));
 }
开发者ID:houstonfernandes,项目名称:curso_laravel,代码行数:8,代码来源:AdminProductsController.php


示例5: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id, Category $category, Tag $tag, Color $color)
 {
     // envio as categorias para a view products.create
     $categories = $category->lists('name', 'id');
     $product = $this->model->find($id);
     $tags = $tag->lists('name');
     $colors = $color->lists('name');
     return view('products.edit', compact('product', 'categories', 'tags', 'colors'));
 }
开发者ID:NiltonMorais,项目名称:CodeCommerce,代码行数:15,代码来源:AdminProductsController.php


示例6: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit(Category $category, $id)
 {
     $product = $this->productModel->find($id);
     $categories = $category->lists('name', 'id');
     $tags = '';
     foreach ($product->tags as $tag) {
         $tags .= ' ' . $tag->name . ',';
     }
     return view('products.edit', compact('product', 'categories', 'tags'));
 }
开发者ID:alansslva,项目名称:codecommerce,代码行数:16,代码来源:AdminProductsController.php


示例7: edit

 public function edit($id, Category $category)
 {
     $categories = $category->lists('name', 'id');
     $product = $this->productModel->find($id);
     $tags = array();
     for ($i = 0; $i < count($product->tags); $i++) {
         array_push($tags, $product->tags[$i]->name);
     }
     $tags = implode(', ', $tags);
     return view('products.edit', compact('product', 'categories', 'tags'));
 }
开发者ID:arliton,项目名称:CodeCommerce,代码行数:11,代码来源:AdminProductsController.php


示例8: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id, Category $category)
 {
     $categories = $category->lists('name', 'id');
     $product = $this->productModel->find($id);
     $tags = $product->tags;
     $tags = $product->tags->lists('name');
     $tagFormatada = "";
     foreach ($tags as $t) {
         $tagFormatada .= trim($t) . ",";
     }
     $tagFormatada = trim($tagFormatada);
     return view('products.edit', compact('product', 'categories', 'tagFormatada'));
 }
开发者ID:mlslucio,项目名称:e-commerce-school-of-net,代码行数:19,代码来源:ProductsController.php


示例9: category

 public function category($id)
 {
     $categories = Category::all();
     $category = Category::findOrNew($id);
     $products = Product::ofCategory($id)->get();
     return view('store.category', compact('categories', 'category', 'products'));
 }
开发者ID:nsouza,项目名称:codeCommerce,代码行数:7,代码来源:StoreController.php


示例10: place

 public function place(Order $orderModel, OrderItem $orderItem)
 {
     //Método plcae order, quando acessar esse método ele ira acessar o carrinho de comprar e começar a executar
     //os pedidos
     if (!Session::has('cart')) {
         return false;
     }
     $cart = Session::get('cart');
     // recupera o carrinho de compras
     if ($cart->getTotal() > 0) {
         //Order retorna um id que será o código da ORDER
         $order = $orderModel->create(['user_id' => Auth::user()->id, 'total' => $cart->getTotal()]);
         /*Método all corresponde ao método da classe Cart*/
         foreach ($cart->all() as $k => $item) {
             //Toda vez que der o save tem que passar a instancia lá para dentro
             $order->itens()->create(['product_id' => $k, 'price' => $item['price'], 'qtd' => $item['qtd']]);
         }
         // Para limpar o carrinho de compras
         $cart->clear();
         // Evento Checkout
         // Precisa passar o usuario, nome, order itens do pedido
         event(new CheckoutEvent(Auth::user(), $order));
         //event(new CheckoutEvent());
         return view('store.checkout', compact('order', 'cart'));
     }
     $categories = Category::all();
     return view('store.checkout', ['cart' => 'empty', 'categories' => $categories]);
 }
开发者ID:GabrielApG,项目名称:CodeCommerce,代码行数:28,代码来源:CheckoutController.php


示例11: place

 public function place(Order $orderModel, OrderItem $orderItem, CheckoutService $checkoutService)
 {
     if (!Session::has('cart')) {
         return false;
     }
     $cart = Session::get('cart');
     $categories = Category::all();
     if (count(Auth::user()->address) <= 0) {
         return redirect()->route('account_address')->with('address_exist', 'Você precisa ter um endereço de entrega antes de finalizar compra!');
     }
     if ($cart->getTotal() > 0) {
         $checkout = $checkoutService->createCheckoutBuilder();
         $order = $orderModel->create(['user_id' => Auth::user()->id, 'total' => $cart->getTotal()]);
         foreach ($cart->all() as $k => $item) {
             $checkout->addItem(new Item($k, $item['name'], number_format($item['price'], 2, '.', ''), $item['qtd']));
             $order->items()->create(['product_id' => $k, 'price' => $item['price'], 'qtd' => $item['qtd']]);
         }
         // VER CONFIGURAÇÃO DE EMAIL
         // dd(Config::get('mail'));
         $cart->clear();
         event(new CheckoutEvent(Auth::user(), $order));
         $response = $checkoutService->checkout($checkout->getCheckout());
         // retorna para pagina interna do codecommerce
         //return view('store.checkout', compact('order', 'categories'));
         // retorna para pagina do pagseguro
         return redirect($response->getRedirectionUrl());
     }
     return view('store.checkout', ['cart' => 'empty', 'categories' => $categories]);
 }
开发者ID:sandro-rocha,项目名称:laravel_commerce,代码行数:29,代码来源:CheckoutController.php


示例12: index

 public function index()
 {
     $categories = Category::all();
     $pFeatured = Product::featured()->get();
     $pRecommend = Product::recommend()->get();
     return view('store.index', compact('categories', 'pFeatured', 'pRecommend'));
 }
开发者ID:sandrosales,项目名称:laravel_commerce-Pagseguro02,代码行数:7,代码来源:StoreController.php


示例13: tag

 public function tag($id)
 {
     $categories = Category::all();
     $tag = Tag::find($id);
     $products = $tag->products;
     return view('store.tag', compact('categories', 'products', 'tag'));
 }
开发者ID:NiltonMorais,项目名称:laravel_commerce,代码行数:7,代码来源:StoreController.php


示例14: show

 public function show($id = null)
 {
     $categories = !is_null($id) ? Category::where('id', $id)->get() : Category::all();
     foreach ($categories as $category) {
         echo $category->name . '<br>';
     }
 }
开发者ID:amrigo,项目名称:l5-code-commerce,代码行数:7,代码来源:AdminCategoriesController.php


示例15: place_order

 public function place_order(Order $orderModel, OrderItems $orderItems, CheckoutService $checkoutService)
 {
     if (!Session::has('cart')) {
         return false;
     }
     $cart = Session::get('cart');
     $categories = Category::all();
     if ($cart->getTotal() > 0) {
         $order = $orderModel::create(['user_id' => Auth::User()->id, 'total' => $cart->getTotal(), 'status' => '0']);
         foreach ($cart->all() as $id => $item) {
             $order->items()->create(['order_id' => $order->id, 'product_id' => $id, 'price' => $item['price'], 'qtd' => $item['qtd']]);
         }
         $checkout = $checkoutService->createCheckoutBuilder();
         $checkout->setReference($order->id);
         foreach ($order->items as $order_item) {
             $checkout->addItem(new Item($order_item->product_id, $order_item->product->name, $order_item->price));
         }
         $response = $checkoutService->checkout($checkout->getCheckout());
         $order->update(['payment_code' => $response->getCode()]);
         event(new CheckoutEvent($order, Auth::user()));
         $cart->clear();
         return redirect($response->getRedirectionUrl());
         //return view('checkout.place_order', ['order'=>$order, 'cart'=>'saved', 'categories'=>$categories]);
     }
     return view('checkout.place_order', ['cart' => 'empty', 'categories' => $categories]);
 }
开发者ID:mborgesmartins,项目名称:lcodecommerce,代码行数:26,代码来源:CheckoutController.php


示例16: place

 public function place(Order $orderModel, OrderItem $ordemItem, CheckoutService $checkoutService)
 {
     if (!Session::has('cart')) {
         return "FALSE";
     }
     $cart = Session::get('cart');
     $categories = Category::all();
     if ($cart->getTotal() > 0) {
         $checkout = $checkoutService->createCheckoutBuilder();
         //pagseguro
         $order = $orderModel->create(['user_id' => Auth::user()->id, 'total' => $cart->getTotal()]);
         //inclui na tabela
         foreach ($cart->all() as $k => $item) {
             $checkout->addItem(new Item($k, $item['name'], number_format($item['price'], 2, ".", ""), $item['qtd']));
             //pagseguro
             $order->items()->create(['product_id' => $k, 'price' => $item['price'], 'qtd' => $item['qtd']]);
             //inclui na tabela
         }
         $cart->clear();
         event(new CheckoutEvent(Auth::user(), $order));
         $response = $checkoutService->checkout($checkout->getCheckout());
         //pagseguro
         return redirect($response->getRedirectionUrl());
         //pagseguro
         #return view('store.checkout', compact('cart', 'order', 'categories'));
     } else {
         return view('store.checkout', ['cart' => 'empty', 'categories' => $categories]);
     }
 }
开发者ID:ecmattos,项目名称:codecommerce,代码行数:29,代码来源:CheckoutController.php


示例17: tag

 public function tag($name)
 {
     $tagName = $name;
     $categories = Category::Available()->get();
     $products = Product::select(['products.id as id', 'products.name as name', 'products.description as description', 'products.price as price'])->ByTagName($name)->get();
     return view('store.tag', compact('categories', 'products', 'tagName'));
 }
开发者ID:adlersd,项目名称:CodeCommerce,代码行数:7,代码来源:StoreController.php


示例18: edit

 public function edit($id)
 {
     $list_options = ['Não', 'Sim'];
     $categories = Category::lists('name', 'id');
     $product = $this->productModel->find($id);
     return view('products.edit', compact('product', 'list_options', 'categories'));
 }
开发者ID:efraimsantana,项目名称:CodeCommerce,代码行数:7,代码来源:AdminProductsController.php


示例19: run

 public function run()
 {
     DB::table('categories')->truncate();
     $faker = Faker::create('pt_BR');
     foreach (range(1, 15) as $i) {
         Category::create(['name' => $faker->title(), 'description' => $faker->sentence()]);
     }
 }
开发者ID:acsk,项目名称:CODECOMMERCE,代码行数:8,代码来源:CategorySeeder.php


示例20: place

 public function place(\CodeCommerce\Order $orderModel, \CodeCommerce\OrderItem $ordemItem, \CodeCommerce\Category $category)
 {
     if (!Session::has('cart')) {
         return false;
     }
     $cart = Session::get('cart');
     if ($cart->getTotal() > 0) {
         $order = $orderModel->create(['user_id' => Auth::user()->id, 'total' => $cart->getTotal()]);
         foreach ($cart->all() as $k => $item) {
             $items = $ordemItem->create(['order_id' => $order->id, 'product_id' => $k, 'price' => $item['price'], 'qtd' => $item['qtd']]);
         }
         $cart->clear();
         event(new \CodeCommerce\Events\CheckoutEvent(Auth::user(), $order));
         return view('store.checkout', compact('order'));
     }
     $categories = $category->all();
     return view('store.checkout', ['cartEmpty' => true, 'categories' => $categories]);
 }
开发者ID:eduardolcouto,项目名称:laravel-commerce,代码行数:18,代码来源:CheckoutController.php



注:本文中的CodeCommerce\Category类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Repositories\ProjectRepository类代码示例发布时间:2022-05-23
下一篇:
PHP Util\Stub类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap