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

Product short description do not accept {loadposition modulename}

Started by visitmontaione, December 21, 2022, 18:20:34 PM

Previous topic - Next topic

visitmontaione

Joomla 4.2.6 VirtueMart 4.0.12 10777

Because I have to add a short text/ a customer advice, per each product, in the short description of a product I've added a module with the text that I want to add.

By the way when I add the module in this way (I am using modules anywhere but it the same with the standard module recall)

<div class="avvisopeso">{modulepos avvisopeso}</div> the output is with "/> at the end of the module. (see attachment)

The module is perfectly clean without double "/>  and it works fine if I call this module in a page.

So the problem is a conflict within Product description and the syntax of {modulepos avvisopeso}

jenkinhill

Occasionally I have seen problems like yours, and while searching for a proper codefix have used Rereplacer, and useful plugin from Regularlabs -  https://regularlabs.com/rereplacer   It replaces odd characters on any page "on the fly".
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

visitmontaione

Thank you for your reply jenkinhill.

I also use rereplacer from Regularlabs, but I don't know how to use this time.

If I call this module via {modulepos avvisopeso} on a normal page, it load correctly. But if I call it inside the product short description, than I can see this "/>

Look at here:

<!-- START: Modules Anywhere -->
    <div class=" avvisopeso"="">Poichè si tratta di un prodotto artigianale, il peso del prodotto consegnato potrebbe essere diverso da quello indicato di circa +/- 10%.
</div>
<!-- END: Modules Anywhere -->"/&gt;


It's quite a mess...

I can assure that the html into the module is correct (otherwise it shouldn't work properly if I load into a normal page)

It happen only if I call the module into the product short description. That's way i am afraid this could be a bug.

sirius

Hi
(I use Module anywhere too on VM)
because it works on normal page, I suggest you first to make your {modulepos avvisopeso} as a simple string custom field and add your own position in the product template.
and do you use an editor on the short description field ?
By my side I call my module with id only but hardcoded in my product category template (./category/default.php), to make it appear just below the category description.
Just like so:
<?php if(empty($this->keyword) && !empty($this->category) && !empty($this->category->category_description)) : ?>
<div class="category-desc-cont">
<?php echo $this->category->category_description?>
</div>
        {module 138}
<?php endif; ?>
J3.10.12 | PHP 7.4.33 + APC + Opcode
VM Prod : 3.8.6 | VM Test : 4.4.0.11095

visitmontaione

Quote from: sirius on December 27, 2022, 17:02:16 PM
Hi
(I use Module anywhere too on VM)
because it works on normal page, I suggest you first to make your {modulepos avvisopeso} as a simple string custom field and add your own position in the product template.
and do you use an editor on the short description field ?
By my side I call my module with id only but hardcoded in my product category template (./category/default.php), to make it appear just below the category description.
Just like so:
<?php if(empty($this->keyword) && !empty($this->category) && !empty($this->category->category_description)) : ?>
<div class="category-desc-cont">
<?php echo $this->category->category_description?>
</div>
        {module 138}
<?php endif; ?>


Thank you Sirius, at the end I found a solution similar to your.

I've created a custom filed (string) with the content of the module "avvisopeso". Than I've positioned the custom filed in position "ontop" to show it just under the short description of the product.


Milbo

Yes, the joomla content triggers are not used for the short description, just for the main text, imho.

But both of you have smart and interesting solutions :-) Great.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

hazael

This problem can be circumvented in a very simple way - works with any variable
Quote<?php echo JHtml::_('content.prepare', $product->product_s_desc); ?>