質問 > フロント機能 > Block/cart.twigの問題 |
フロント機能
フラット表示 | 前のトピック | 次のトピック |
投稿者 | スレッド |
---|---|
acxAura |
投稿日時: 2022/10/11 18:33
対応状況: 開発中
|
半人前 登録日: 2022/10/6 居住地: 投稿: 17 |
Block/cart.twigの問題 ▼テンプレート
[EC-CUBE] EC-CUBEの4.1.2 [レンタルサーバ] localhost お世話になっております 現在、Block/cart.twigのイメージを他のイメージに変えようと思って、Controller/Block/CartController.phpを修正して、 if ($route == 'block_cart_sp') { return $this->render('Block/nav_sp.twig', [ 'totalQuantity' => $totalQuantity, 'totalPrice' => $totalPrice, 'Carts' => $Carts, 'images' => $custom_images ]); } else { return $this->render('Block/cart.twig', [ 'totalQuantity' => $totalQuantity, 'totalPrice' => $totalPrice, 'Carts' => $Carts, 'images' => $custom_images ]); } ’images'というのを追加しました しかし、Block/cart.twigに <img src="{{ asset(images[idx]|no_image_product, 'save_image') }}" alt="{{ Product.name }}"> こうimagesを入れても、variable "images" does not existというエラーが出ます。 Block/CartControllerから貰ったimagesというvariableを認識されてないと思ってます。 でも、 {% set Carts = get_all_carts() %} {% set totalPrice = get_carts_total_price() %} {% set totalQuantity = get_carts_total_quantity() %} というCartServiceExtensionを使ってるのを見て、よくわからなくなりました... どうすればimagesを認識させようにできますか? |
フラット表示 | 前のトピック | 次のトピック |
題名 | 投稿者 | 日時 |
---|---|---|
» Block/cart.twigの問題 | acxAura | 2022/10/11 18:33 |
Re: Block/cart.twigの問題 | nanasess | 2022/10/11 23:41 |
Re: Block/cart.twigの問題 | acxAura | 2022/10/12 0:22 |
Re: Block/cart.twigの問題 | nanasess | 2022/10/12 12:01 |
Re: Block/cart.twigの問題 | acxAura | 2022/10/12 13:34 |
Re: Block/cart.twigの問題 | nanasess | 2022/10/17 10:33 |