Jump to content
Sign in to follow this  
NeverOff

Вывод корзины(товаров) при оформление заказа

Recommended Posts

Здравствуйте, необходимо вывести корзину при оформление заказа:

Такой же вывод как в checkout.tpl

 

Что необходимо добавить в контроллер checkout.php и шаблон checkout.tpl 

 

Нужен вывод именно через php, не через ajax

Заранее спасибо

post-703349-0-57019400-1480093027_thumb.jpg

Edited by NeverOff

Share this post


Link to post
Share on other sites

Добавил в checkout.php

$this->data['products'][] = array(
   'name'     => $product['name']
);

и в checkout.tpl

<?php foreach ($products as $product) { ?>
     <div><?php echo $product['name']; ?></div>
<?php } ?>

Но выводит только последний добавленный товар, почему так?

Share this post


Link to post
Share on other sites

потому что глупостями занимаешься.

товары итпд и так есть в оформлении - на последнем шаге.

если хочется всегда показывать - смотри в сторону simplecheckout (или других модулей упрощенного оформления заказов).

Share this post


Link to post
Share on other sites

Добавь это в checkout.php

И потом в checkout.tpl foreach ($products as $product) { $product['name'] }  все параметры в массиве

$data['products'] = array();
 
            foreach ($this->cart->getProducts() as $product) {
                $data['products'][] = array(
                    'cart_id' => $product['cart_id'],
                    'product_id' => $product['product_id'],
                    'name' => $product['name'],
                    'model' => $product['model'],
                    'quantity' => $product['quantity'],
                    'subtract' => $product['subtract'],
                    'price' => $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']),
                    'total' => $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')) * $product['quantity'], $this->session->data['currency']),
                    'href' => $this->url->link('product/product', 'product_id=' . $product['product_id'])
                );
            }

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.