Displaying the SHORT DESCRIPTION on the VM Product Page

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Sun May 26, 2013 5:53 pm
Reply with quote
Report this post
Hi.

On every individual product page, within the VM shop, I would like to display the SHORT DESCRIPTION below the PRODUCT NAME.

So for example, on http://demo.gavick.com/joomla25/bikesto ... ter-detail I would like the Short Description to display below KELLYS Master and above the Rating and Manufacturer.

How do I do this?

Thx
User avatar
Gold Boarder

teitbite
Mon May 27, 2013 8:09 am
Reply with quote
Report this post
Hi

Unfortuntely you are right. There is no shop component rzadu for J3 and responsive yet. I think I've read that K2store will be first to deliver such, so please check if they keep their promise.
User avatar
Moderator

GK User
Mon May 27, 2013 1:26 pm
Reply with quote
Report this post
Teitbite, sorry - I am using the 2.5 component with Virtuemart so surely this is possible?

Thnx
User avatar
Gold Boarder

teitbite
Tue May 28, 2013 9:25 am
Reply with quote
Report this post
Hi

Sorry, looks like I've mistaken questions ;/ Please show me an exact page You would like to add this short descriptions.
User avatar
Moderator

GK User
Wed May 29, 2013 10:08 am
Reply with quote
Report this post
Did you get my PM?
User avatar
Gold Boarder

teitbite
Thu May 30, 2013 3:57 pm
Reply with quote
Report this post
Hi

Yes I did. Do You mean this as short description "[edited by moderator]" ?

If Yes than You need to edit /html/com_virtuemart/productdetails/default.php and add this code in the place You want it to show:

Code: Select all
echo substr( $this->product->product_desc, 0, 15);
User avatar
Moderator

GK User
Thu May 30, 2013 4:58 pm
Reply with quote
Report this post
Yes, that is exactly what I wanted to achieve.

I added echo substr( $this->product->product_desc, 0, 15); to default.php
Code from line 116 looks like...

<?php // Product Title ?>
<h1><?php echo $this->product->product_name ?></h1>
<?php // Product Title END ?>
<?php // Pack Size END ?>
echo substr( $this->product->product_desc, 0, 15);
<?php // afterDisplayTitle Event
echo $this->product->event->afterDisplayTitle ?>
<?php // Product Edit Link
echo $this->edit_link;
// Product Edit Link END ?>

Unfortunately, this only results in the actual code echo substr( $this->product->product_desc, 0, 15); being displayed on the product page rather than the short description.

Please help!
User avatar
Gold Boarder

teitbite
Sat Jun 01, 2013 4:58 pm
Reply with quote
Report this post
Hi

You just need to put this into php signs: <?php ?>, so should looks like this

Code: Select all
<?php echo substr( $this->product->product_desc, 0, 15); ?>
User avatar
Moderator

GK User
Mon Jun 03, 2013 11:02 am
Reply with quote
Report this post
Hi. Thanks for this. Now I get a blank space displayed when I use this code (rather than the actual code itself).
I've read about this product_desc issue elsewhere and wonder does it need to be called somehow in the header of the code?
User avatar
Gold Boarder

teitbite
Mon Jun 03, 2013 4:05 pm
Reply with quote
Report this post
Hi

It's possible that description is kept in a different variable. Please take a look at the original VM code for that:

Code: Select all
               <?php // Product Short Description
                  if(!empty($product->product_s_desc)) { ?>
               <p class="product_s_desc">
                  <?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?>
               </p>
               <?php } ?>


and try using $product->product_s_desc instead $this->product->product_desc in the previous code.

Unfortunately I cannot be sure which one is right (if any) without making a dump of this values and for that I would need an ftp to check it.
User avatar
Moderator

GK User
Tue Jun 04, 2013 12:45 pm
Reply with quote
Report this post
Great teitbite. Thanks for this - I think the solution is just around the corner.

Sorry though - I am unclear on one of two things here.

Instead of <?php echo substr( $this->product->product_desc, 0, 15); ?>
do I now add the code <?php // Product Short Description
if(!empty($product->product_s_desc)) { ?>
<p class="product_s_desc">
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?>
</p>
<?php } ?>

I tried this with no joy. Are you happy to have a look if I set you up FTP access?
User avatar
Gold Boarder

teitbite
Tue Jun 04, 2013 10:04 pm
Reply with quote
Report this post
Hi

Yes, but just replace it with this part:

Code: Select all
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc, 40, '...') ?>
User avatar
Moderator

GK User
Wed Jun 05, 2013 11:35 am
Reply with quote
Report this post
Sorry Teitbite - still no joy.

I tried putting the code in place of the product title to make sure it was in the right place too.

Any further advice?
User avatar
Gold Boarder

teitbite
Wed Jun 05, 2013 11:08 pm
Reply with quote
Report this post
Hi

I got a PM from You. Sure no problem, but You need to send me FTP access again. I've deleted it.
User avatar
Moderator

GK User
Thu Jun 06, 2013 12:36 pm
Reply with quote
Report this post
OK, thanks Teitbite. Can you PM me your static IP address again?
User avatar
Gold Boarder

teitbite
Sat Jun 08, 2013 3:18 pm
Reply with quote
Report this post
Hi

It's not a secret :) Here is my IP: 84.10.239.173
User avatar
Moderator

teitbite
Sun Jun 16, 2013 12:06 pm
Reply with quote
Report this post
Hi

Sorry for delay. I've marked PM with access from You as read by accident.

I've added this code in line 116 of file /html/com_virtuemart/productdetails/default.php

Code: Select all
   <?php if($this->product->product_desc): ?>
      <div class="productShortDescription"><?php echo substr( $this->product->product_desc, 0, 140 ); ?>...</div>
   <?php endif; ?>



Please let me know if this is what You were asking for.
User avatar
Moderator

GK User
Mon Jun 17, 2013 9:45 am
Reply with quote
Report this post
Thanks very much Teitbite. Your code has solved the problem!
The only thing I should add is that I had to change product_desc to product_s_desc ;-)
I am very grateful to you for solving this for me.
User avatar
Gold Boarder

teitbite
Mon Jun 17, 2013 3:00 pm
Reply with quote
Report this post
Hi

Och, Your's right short description is stored in product_s_desc instead of product_desc :) Thanks for pointing this out.
User avatar
Moderator

teitbite
Tue Jun 18, 2013 9:48 am
Reply with quote
Report this post
Hi

Thread edited on user request.
User avatar
Moderator


cron