Hi there,
as topic says..
Is there any way to display product short description in confirmation mail?
This don't work in invoice items.php:
<?php echo $item->product_s_desc; ?>
Thanx for any advises
Hi,
there is no product_s_desc in the virtuemart_order_items table in the database which is used for the confirmation e-mail. If you want to get the short description you can use current virtuemart_product_id and then access the virtuemart_product_de_de table with this id and catch the value of virtuemart_product_s_desc.
I hope this helps.
OK, a quick and dirty solution for your imvoice_item.php. I do not recommend this way to you as you shouldn´t access database in the output .php but nevertheless I am to lazy to search for you where the items vars are created.
add
at line 21:
$db = JFactory::getDBO ();
at line 49: $q = 'SELECT `product_s_desc` FROM `#__virtuemart_products_de_de` WHERE `virtuemart_product_id`="' . $item->virtuemart_product_id . '" ';
$db->setQuery ($q);
$product_s_desc = $db->loadResult ();
and where you want to show short description
echo $product_s_desc;
Hi lanthan,
your solution works well as long as your shop is only german.
Any idea how to display in multi language?
Thanks.
Hello,
Haven't test it but you could load the product model and print out the product short description:
<?php
$ProductModel= VmModel::getModel('product');
$product = $ProductModel->getProduct($item->virtuemart_product_id);
echo $product->product_s_desc;
?>
Haven't test it but give a try and let us know if that is working for you.
Regards
Hi Bytelord,
your solution works fine! Thank you for your support.
Best Regards
Great,
never tested but if works ok :)
Always prefer to use model/controllers instead of sql queries because could be expose your site under sql injections on the view side (based on mvc model).
Regards
Great!
Works fine.
Thanks a lot.
@bytelord
You are absolutely right. I have to concern oneself with the vm model/controllers etc. But the API doc link is unfortunately broken...Hope this will be fixed soon or may you have a reference where I can read all the necessary stuff.
Hello lanthan,
Yes, there are miss documentation, hopefully this this will be done until the end of the year, but always you can study the code, the view.html.php files to see how the models are been loaded and then use the pagefields as you wish.
Also you take a look on the controllers and also the shopfuntions and how you can use the public one easily :)
But, you have right about the documentation, i study the core source also when i am trying to figure out a solution.
Best regards