VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: psm on April 02, 2020, 09:45:10 AM

Title: Add products into article content
Post by: psm on April 02, 2020, 09:45:10 AM
Hello,
I installed plugin vmimport to add products into article content. But there is problem, that it shows long description of products info and I need short.

Could you please help me how to reach it? I have this code:
<?php if($showProductDescription){?>
<div class="product_desc_container" style="color:<?php echo $desc_color;?>">
<?php echo $list->product_desc?>
</div>
<?php ?>

I tried to change it by product_s_desc, but it does not know it.

Thank you
Title: Re: Add products into article content
Post by: beltoforion on April 02, 2020, 19:58:31 PM
Hello psm this, I found answer to that question here: http://forum.virtuemart.net/index.php?topic=106587.0


The right one is    <?php echo $this->product->product_s_desc ?>

and better to use

if (!empty($this->product->product_s_desc)) {
      <?php echo $this->product->product_s_desc;
   } ?>

$this refers to the current product. The code that you post is for category page.

More information regarding $this vs $product explained here: http://forum.virtuemart.net/index.php?topic=100696.0

Product page fields: http://forum.virtuemart.net/index.php?topic=92756.0

Category page fields: http://forum.virtuemart.net/index.php?topic=97744.0
Title: Re: Add products into article content
Post by: psm on April 03, 2020, 07:29:46 AM
Hello, thank you for response, I tried exsctly this solution also befroe, but it is not working in joomla article. And I do not know why.
Title: Re: Add products into article content
Post by: Studio 42 on April 03, 2020, 10:04:58 AM
Use print_r or var_dump to see the $list content
Check with the Dev, I dont mean that this is a Virtuemart team plugin ?
Title: Re: Add products into article content
Post by: Jörgen on April 03, 2020, 10:12:43 AM
You have to modify the default.php file of the joomdev plugin, not the tmpl/default.php.

The plugin simply doesn´t put the product_s_desc in the $list structure. You have to make it happen. This is done in the main file for the pugin not the tmpl file.

Jörgen @ Kreativ Fotografi