Post by c05338 » Sun Jan 15, 2012 6:59 pm

Any help please I need to know how to show product description in cart at checkout?

Newbie

Posts

Joined
Tue Jan 10, 2012 10:09 pm

Post by c05338 » Mon Jan 16, 2012 8:31 pm

Anybody could help?

Newbie

Posts

Joined
Tue Jan 10, 2012 10:09 pm

Post by OpenCart Addons » Mon Jan 16, 2012 11:44 pm

Hey,

Are you wanting to show a small snippet of the product description in the cart, or the entire thing?


Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by c05338 » Wed Jan 18, 2012 12:37 am

Hi Joel,

Thanks for your reply, if to show small snippet it might be better for using less resources. How is that possible? And if I need to show everything how is possible?

Newbie

Posts

Joined
Tue Jan 10, 2012 10:09 pm

Post by OpenCart Addons » Wed Jan 18, 2012 6:02 am

Hey,

In system / library / cart.php
Find:

Code: Select all

'name'            => $product_query->row['name'],
Add After:

Code: Select all

'description'            => $product_query->row['description'],
In catalog / controller / checkout / cart.php
Find:

Code: Select all

'name'     => $product['name'],
Add After (Whole Description):

Code: Select all

'description'     => htmlspecialchars_decode($product['description']),
Or Add After (400 Character Snippet):

Code: Select all

'description'     => htmlspecialchars_decode(substr($product['description'],0,400)) . '...',
Find:

Code: Select all

'name'     => $result['name'],
Add After (Whole Description):

Code: Select all

'description'     => htmlspecialchars_decode($result['description']),
Or Add After (400 Character Snippet):

Code: Select all

'description'     => htmlspecialchars_decode(substr($result['description'],0,400)) . '...',
In catalog / view / theme / <your theme> / template / checkout / cart.tpl
Find:

Code: Select all

<?php foreach ($product['option'] as $option) { ?>
Before Add:

Code: Select all

<small><?php echo strip_tags($product['description']); ?></small>
<hr align="center" />
I've also added a horizontal line <hr> between the description and product options so they are visibly separated.

Just a quick note that adding the descriptions will throw off the table column widths a little, but this can be fixed by changing
In catalog / view / theme / <your theme> / template / checkout / cart.tpl
Find:

Code: Select all

<td class="remove"><?php echo $column_remove; ?></td>
              <td class="image"><?php echo $column_image; ?></td>
              <td class="name"><?php echo $column_name; ?></td>
              <td class="model"><?php echo $column_model; ?></td>
              <td class="quantity"><?php echo $column_quantity; ?></td>
              <td class="price"><?php echo $column_price; ?></td>
              <td class="total"><?php echo $column_total; ?></td>
Replace With:

Code: Select all

 <td class="remove" width="50px"><?php echo $column_remove; ?></td>
              <td class="image"><?php echo $column_image; ?></td>
              <td class="name"><?php echo $column_name; ?></td>
              <td class="model" width="75px"><?php echo $column_model; ?></td>
              <td class="quantity" width="75px"><?php echo $column_quantity; ?></td>
              <td class="price" width="75px"><?php echo $column_price; ?></td>
              <td class="total" width="75px"><?php echo $column_total; ?></td>
All of these changes can be found in the attached vQmod. Just remove whatever features you don't need.

*EDIT - The most up-to-date version of this vQmod can be found here:
My Site: http://opencartaddons.com/product-description-in-cart
OpenCart: http://www.opencart.com/index.php?route ... on_id=4682

This mod should work on any OpenCart v1.5.x, but it has only been tested with v1.5.1.3.

The final result should look similar to this:
cart_view.jpg

View Of Cart After Modifications - cart_view.jpg (63.94 KiB) Viewed 9694 times

Cheers,
Joel.
Last edited by OpenCart Addons on Thu Jan 19, 2012 1:36 am, edited 1 time in total.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by c05338 » Wed Jan 18, 2012 8:41 am

OpenCart Addons wrote:Hey,

In system / library / cart.php
Find:

Code: Select all

'name'            => $product_query->row['name'],
Add After:

Code: Select all

'description'            => $product_query->row['description'],
In catalog / controller / checkout / cart.php
Find:

Code: Select all

'name'     => $product['name'],
Add After (Whole Description):

Code: Select all

'description'     => htmlspecialchars_decode($product['description']),
Or Add After (400 Character Snippet):

Code: Select all

'description'     => htmlspecialchars_decode(substr($product['description'],0,400)) . '...',
Find:

Code: Select all

'name'     => $result['name'],
Add After (Whole Description):

Code: Select all

'description'     => htmlspecialchars_decode($result['description']),
Or Add After (400 Character Snippet):

Code: Select all

'description'     => htmlspecialchars_decode(substr($result['description'],0,400)) . '...',
In catalog / view / theme / <your theme> / template / checkout / cart.tpl
Find:

Code: Select all

<?php foreach ($product['option'] as $option) { ?>
Before Add:

Code: Select all

<small><?php echo strip_tags($product['description']); ?></small>
<hr align="center" />
I've also added a horizontal line <hr> between the description and product options so they are visibly separated.

Just a quick note that adding the descriptions will throw off the table column widths a little, but this can be fixed by changing
In catalog / view / theme / <your theme> / template / checkout / cart.tpl
Find:

Code: Select all

<td class="remove"><?php echo $column_remove; ?></td>
              <td class="image"><?php echo $column_image; ?></td>
              <td class="name"><?php echo $column_name; ?></td>
              <td class="model"><?php echo $column_model; ?></td>
              <td class="quantity"><?php echo $column_quantity; ?></td>
              <td class="price"><?php echo $column_price; ?></td>
              <td class="total"><?php echo $column_total; ?></td>
Replace With:

Code: Select all

 <td class="remove" width="50px"><?php echo $column_remove; ?></td>
              <td class="image"><?php echo $column_image; ?></td>
              <td class="name"><?php echo $column_name; ?></td>
              <td class="model" width="75px"><?php echo $column_model; ?></td>
              <td class="quantity" width="75px"><?php echo $column_quantity; ?></td>
              <td class="price" width="75px"><?php echo $column_price; ?></td>
              <td class="total" width="75px"><?php echo $column_total; ?></td>
All of these changes can be found in the attached vQmod. Just remove whatever features you don't need.

This mod should work on any OpenCart v1.5.x, but it has only been tested with v1.5.1.3.

The final result should look similar to this:
cart_view.jpg
Cheers,
Joel.
Thank you for your support and extension

Newbie

Posts

Joined
Tue Jan 10, 2012 10:09 pm

Post by Diuana » Wed Jun 06, 2012 9:33 am

Joel, please, I need your help.

The product option appears in cart like that: - option1: Intel Core 2 Duo pr..
How to show the entire text, like that: - option1: Intel Core 2 Duo processor Powered by an Intel Core 2 Duo

Thank you very much.

Newbie

Posts

Joined
Wed Jun 06, 2012 9:20 am

Post by markuswest » Tue Oct 29, 2013 3:48 pm

Hi,

any Idea how to show the product description in OC 1.5.5.1?

--
South Africa, Johannesburg GMT +2


User avatar
New member

Posts

Joined
Wed May 29, 2013 4:22 am
Location - South Africa, Pretoria
Who is online

Users browsing this forum: No registered users and 9 guests