News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Short Description

Started by jmms, December 06, 2012, 14:10:14 PM

Previous topic - Next topic

jmms

Hi Team... me again  ;)

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

THANKS

Peter Pillen

Just leave it empty I think?

jmms

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

Peter Pillen

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.

jmms

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

Peter Pillen

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

jmms

THANKS for the GREAT help, it seems to have done the trick




bytelord

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
Production: Joomla 2.5.8 | VM 2.0.14 | PHP 5.3.13
Testing     : Joomla 2.5.8 | VM 2.0.16 | PHP 5.3.8
Testing     : Joomla 2.5.8 |    VM 2.1   | PHP 5.3.8

- Don't Forget to mark thread as solved when it is solved!
- Please do not PM with support questions, use the forum!

jmms

Thanks, I'll look into that

veer

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....

loppan

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)