Hi,
Please take a look at http://www.semineemures.ro/produse/accesorii/demo-1/Idro-50-1
As you can see, on the right side there's the short description, and under the image there's the "long description".
The problem is that the short description doesn't supports WYSIWYG or HTML.
We would like to insert formatted text/WYSIWYG both in the description, which is ok right now, PLUS on the right side, where we have the short description right now.
Is there any way to activate formatted text/html/WYSIWYG for the short description? Or can we define a new field/secondary description? How can we accomplish that?
Thanks!
The short description does not allow to use html? I wonder, please try if you can add manually html code
You could also add the editor
http://www.joomlahackers.net/virtuemart-tutorials/adding-rich-text-and-images-to-the-short-description.html
Quote from: Milbo on September 27, 2011, 15:01:58 PM
The short description does not allow to use html? I wonder, please try if you can add manually html code
I did, it doesn't...else I wouldn't opened this topic... :) Any HTML code is removed after saving the product.
Quote from: zarisko on September 27, 2011, 15:14:18 PM
You could also add the editor
That folder/file doesn't exists in V2. <?php echo $db->sf("product_s_desc"); ?> doesn't exists in any file...
sorry i didn't realise it was a VM2 topic.
but maybe the solution is the same, just different folder/file paths.
administrator/components?com_virtuemart/views/product_edit_description.php
Change this
<textarea class="inputbox" name="product_s_desc" id="short_desc" cols="65" rows="3" ><?php echo $this->product->product_s_desc; ?></textarea>
To this
<?php echo $this->editor->display('product_s_desc', $this->product->product_s_desc, '100%;', '550', '75', '20', array('pagebreak', 'readmore') ) ; ?>
then see what happens. The database field should allow it. BUT there might be a function stripping it.
JUST tested it, and it does strip the field of html.
there is a function to allow html in product_desc
administrator/virtuemart/controllers product.php
function save(){
$product_desc = JRequest::getVar('product_desc','','post','STRING',JREQUEST_ALLOWRAW);
$data = JRequest::get('post');
$data['product_desc'] = $product_desc;
// vmdebug('my data in product save ',$data);
if(!class_exists('Permissions')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'permissions.php');
if(Permissions::getInstance()->check('admin')){
// $data['product_desc'] = JRequest::getVar('product_desc','','post','STRING',JREQUEST_ALLOWHTML);
$data['product_desc'] = JRequest::getVar('product_desc','','post','STRING',2);
}
parent::save($data);
}
I believe you can use the same for product_s_desc
Quote from: BanquetTables.pro on September 27, 2011, 19:51:48 PM
administrator/components?com_virtuemart/views/product_edit_description.php
Change this
<textarea class="inputbox" name="product_s_desc" id="short_desc" cols="65" rows="3" ><?php echo $this->product->product_s_desc; ?></textarea>
To this
<?php echo $this->editor->display('product_s_desc', $this->product->product_s_desc, '100%;', '550', '75', '20', array('pagebreak', 'readmore') ) ; ?>
then see what happens. The database field should allow it. BUT there might be a function stripping it.
Yup, WYSIWYG appeared!
Quote from: BanquetTables.pro on September 27, 2011, 20:03:38 PM
there is a function to allow html in product_desc
administrator/virtuemart/controllers product.php
function save(){
$product_desc = JRequest::getVar('product_desc','','post','STRING',JREQUEST_ALLOWRAW);
$data = JRequest::get('post');
$data['product_desc'] = $product_desc;
// vmdebug('my data in product save ',$data);
if(!class_exists('Permissions')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'permissions.php');
if(Permissions::getInstance()->check('admin')){
// $data['product_desc'] = JRequest::getVar('product_desc','','post','STRING',JREQUEST_ALLOWHTML);
$data['product_desc'] = JRequest::getVar('product_desc','','post','STRING',2);
}
parent::save($data);
}
I believe you can use the same for product_s_desc
Defined:
function save(){
$product_s_desc = JRequest::getVar('product_s_desc','','post','STRING',JREQUEST_ALLOWRAW);
$data = JRequest::get('post');
$data['product_s_desc'] = $product_s_desc;
// vmdebug('my data in product save ',$data);
if(!class_exists('Permissions')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'permissions.php');
if(Permissions::getInstance()->check('admin')){
// $data['product_s_desc'] = JRequest::getVar('product_s_desc','','post','STRING',JREQUEST_ALLOWHTML);
$data['product_s_desc'] = JRequest::getVar('product_s_desc','','post','STRING',2);
}
parent::save($data);
}
After saving the product I get
Fatal error: Cannot redeclare VirtuemartControllerProduct::save() in /home/semineem/public_html/administrator/components/com_virtuemart/controllers/product.php on line 124
when accesing Joomla Admin -> Virtuemart -> Products
How can I fix this please? Thanks a lot!
edit, tried that and it still stripped
BUT: I believe this might be added to the core. I would wait for milbo to respond. Some users will want this.
Defined "function save2()". Now the editor opens but, even if I just bold something, it doesn't saves (the modification disappears after Save).
yes, I just tried it. I would wait for milbo to respond. He might wanna add this.
I add the right filter.
Great! Thanks a lot! :)
Just please don't forget to tell us the name of the updated file/s.
it is only the controller
I suppose that we're talking about
Quotehttps://dev.virtuemart.net/svn/virtuemart/trunk/virtuemart/administrator/components/com_virtuemart/controllers/product.php
NOTE: when replying this message the option didn't functioned, but I suppose we should wait till Milbo makes his magic :)
Yepp, this file, the save function should look like this
function save(){
$data = JRequest::get('post');
if(!class_exists('Permissions')) require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'permissions.php');
if(Permissions::getInstance()->check('admin')){
$data['product_desc'] = JRequest::getVar('product_desc','','post','STRING',2);
$data['product_s_desc'] = JRequest::getVar('product_s_desc','','post','STRING',2);
}
parent::save($data);
}
Hi Milbo,
Thanks for your time!
I've overwritten https://dev.virtuemart.net/svn/virtuemart/trunk/virtuemart/administrator/components/com_virtuemart/controllers/product.php but still...our VM installation doesn't saves any HTML. Should we disable the WYSIWYG and try to enter "raw" html?
Isn't there a way to keep the WYSIWYG + HTML?
Thanks!
LATER EDIT: IT WORKS!!! For posterity, you should replace the save() function from the default product.php with the function stated before by Milbo :)
Hi Milbo- i have tried everything to get the product description to accept html to no avail. No matter what i do it strips the html and leaves just text.
I have changed the filtering permissions in the article options, i have checked that my JCE editor is set to not clean up code and i have downloaded and saved the newest product.php file (and then still overwritted the save function with the one you have stated above).
I have even copied the same save function used for category description as this is allowing html, but it did not change a thing!
i would appreciate any help you or any other users could give me!
thanks
Aliciah85. short DESCRIPTION? or FULL DESCRIPTION?
are you set to super admin? look in vmart /shoppers
it was both. something i did fixed it, but i have no idea what :(
I found a simple solution. In /administrator/components/com_virtuemart/views/product/tmpl/product_edit_description.php:
Change
<textarea class="inputbox" name="product_s_desc" id="product_s_desc" cols="65" rows="3" ><?php echo $this->product->product_s_desc; ?></textarea>
for
<?php echo $this->editor->display('product_s_desc', $this->product->product_s_desc, '90%;', '450', '55', '10', array('pagebreak', 'readmore') ) ; ?>
In order to keep this setting after VM updates, you may copy the modified file to
/administrator/templates/<backend_admin_template_folder>/html/com_virtuemart/product/product_edit_description.php
VirtueMart 3.2.14
Joomla 3.8.11
php 7.1
Quote from: arcturus on August 25, 2018, 11:34:03 AM
I found a simple solution. In /administrator/components/com_virtuemart/views/product/tmpl/product_edit_description.php:
Change
<textarea class="inputbox" name="product_s_desc" id="product_s_desc" cols="65" rows="3" ><?php echo $this->product->product_s_desc; ?></textarea>
for
<?php echo $this->editor->display('product_s_desc', $this->product->product_s_desc, '90%;', '450', '55', '10', array('pagebreak', 'readmore') ) ; ?>
In order to keep this setting after VM updates, you may copy the modified file to
/administrator/templates/<backend_admin_template_folder>/html/com_virtuemart/product/product_edit_description.php
VirtueMart 3.2.14
Joomla 3.8.11
php 7.1
Cooool! it worked, thanks a lot!