VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: jmms on December 06, 2012, 14:10:14 PM

Title: Short Description
Post by: jmms on December 06, 2012, 14:10:14 PM
Hi Team... me again  ;)

Can anyone please advice on how I can turn off the short description?

THANKS
Title: Re: Short Description
Post by: Peter Pillen on December 06, 2012, 14:53:46 PM
Just leave it empty I think?
Title: Re: Short Description
Post by: jmms on December 06, 2012, 14:57:58 PM
Problem is that i receive a daily data-feed and it basically fill in the blacks, so i need a way to turn it off and the right info (as supplied) will be added to the correct field
Title: Re: Short Description
Post by: Peter Pillen on December 06, 2012, 15:17:53 PM
Then you will need to change/erase your template for virtuemart. The code you're looking for is something like this

<?php // Product Short Description
if(!empty($product->product_s_desc)) { ?>

<p class="product_s_desc">
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc40'...'?>
</p>
                        <? } ?>


You will find this in /components/com_virtuemart/views/virtuemart/tmpl/default_products.php for the browse view (if you use the default virtuemart template... otherwise it could be located in your own template)

but it depends where you want to erase al these short descriptions. Because it is set in different template views, so you will need to find all the neccesary files and erase or change it.
Title: Re: Short Description
Post by: jmms on December 06, 2012, 19:20:55 PM
Quote from: P2 Peter on December 06, 2012, 15:17:53 PM
Then you will need to change/erase your template for virtuemart. The code you're looking for is something like this

<?php // Product Short Description
if(!empty($product->product_s_desc)) { ?>

<p class="product_s_desc">
<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc40'...'?>
</p>
                        <? } ?>


You will find this in /components/com_virtuemart/views/virtuemart/tmpl/default_products.php for the browse view (if you use the default virtuemart template... otherwise it could be located in your own template)

but it depends where you want to erase al these short descriptions. Because it is set in different template views, so you will need to find all the neccesary files and erase or change it.

I can't seem to find the code in /components/com_virtuemart/views/virtuemart/tmpl/default_products.php
Title: Re: Short Description
Post by: Peter Pillen on December 06, 2012, 21:19:13 PM
indeed... a mistake from my part... Sorry

the following should be correct... /components/com_virtuemart/views/productdetails/tmpl/default.php (for the productdetail view)

    // Product Short Description
    if (!empty($this->product->product_s_desc)) {
?>
        <div class="product-short-description">
    <?php
    
/** @todo Test if content plugins modify the product description */
    echo nl2br($this->product->product_s_desc);
    ?>

        </div>
<?php
    
// Product Short Description END


and /components/com_virtuemart/views/category/tmpl/default.php (for the category view)

<?php // Product Short Description
if (!empty($product->product_s_desc)) {
?>

<p class="product_s_desc">
<?php echo shopFunctionsF::limitStringByWord ($product->product_s_desc40'...'?>
</p>
<?php ?>


and so on... it takes some time to find them all
Title: Re: Short Description
Post by: jmms on December 06, 2012, 21:25:15 PM
THANKS for the GREAT help, it seems to have done the trick



Title: Re: Short Description
Post by: bytelord on December 06, 2012, 22:24:50 PM
Hello,

Please use template overrides for this changes, so each time you update virtuemart 2 to do not loose your changes

Use firebug to examine you site code and css styling: https://forum.virtuemart.net/index.php?topic=102850.0

Template Overrides:
Creating Template overrides: https://forum.virtuemart.net/index.php?topic=98505.0
Template System: https://dev.virtuemart.net/projects/virtuemart/wiki/Hints_for_the_use_of_the_template_system

Also take a look on the fields usage:
Product Fields: http://forum.virtuemart.net/index.php?topic=92756.0
Category fields: http://forum.virtuemart.net/index.php?topic=97744.0
$this vs $product: http://forum.virtuemart.net/index.php?topic=100696.0

Regards
Title: Re: Short Description
Post by: jmms on December 06, 2012, 22:27:33 PM
Thanks, I'll look into that
Title: Re: Short Description
Post by: veer on March 13, 2015, 07:36:40 AM
Thanks for help
for me file path .......components\com_virtuemart\sublayouts\products.php
find code
<?php if(!empty($rowsHeight[$row]['product_s_desc'])){
               ?>
               <p class="product_s_desc">
                  <?php // Product Short Description
                  if (!empty($product->product_s_desc)) {
                     echo shopFunctionsF::limitStringByWord ($product->product_s_desc, 60, ' ...') ?>
                  <?php } ?>
replace value 60 by zero....
Title: Re: Short Description
Post by: loppan on December 27, 2015, 01:44:01 AM
Quote from: veer on March 13, 2015, 07:36:40 AM
Thanks for help
for me file path .......components\com_virtuemart\sublayouts\products.php
find code
<?php if(!empty($rowsHeight[$row]['product_s_desc'])){
               ?>
               <p class="product_s_desc">
                  <?php // Product Short Description
                  if (!empty($product->product_s_desc)) {
                     echo shopFunctionsF::limitStringByWord ($product->product_s_desc, 60, ' ...') ?>
                  <?php } ?>
replace value 60 by zero....

This worked for me as well, on VM 3.0.12, thank you veer!

(A little hint : the sublayouts files can be overriden as well, in my case I edited /templates/mytemplate/html/com_virtuemart/sublayouts/products.php,
instead of /components/com_virtuemart/sublayouts/products.php)