If you make a gateway for vmpayment example bank transfer and use
if ($order_id) {
// send the email only if payment has been accepted
if (!class_exists('VirtueMartModelOrders'))
require( JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'orders.php' );
$modelOrder = new VirtueMartModelOrders();
$order['order_status'] = $method->status_success;
$order['virtuemart_order_id'] = $order_id;
$order['customer_notified'] = 1;
$order['comments'] = JTExt::sprintf('VMPAYMENT_BANK_PAYMENT_CONFIRMED', $order_id);
$modelOrder->updateStatusForOneOrder($order_id, $order, true);
// remove vmcart
}
you get error like this :
Fatal error: Call to undefined method VirtuemartViewOrders::renderMailLayout() in /home/xxxxxxx/public_html/joomla17/components/com_virtuemart/helpers/shopfunctionsf.php on line 339.
is $order defined with this:
$cart = VirtueMartCart::getCart();
$order= new VirtueMartModelOrders();
$order=$order->getOrder($order_id);
or I just make a new array or what?
$order=new array(); -
Anyone help?
I can confirm this, I also run into this problem.
Hope someone know a fix for this one.
Just for the info, I use VM 2 with Joomla 1.7.3
---
I am here: http://maps.google.com/maps?ll=52.498060,5.054185
Same here.
if you get it working , please let me know it:)
if i, then i send to you pm and post somewhere
Will do that. If we dont get an answer from someone that can help us before sunday then I will take a look at the latest svn or start looking at the vm core functions that are used to send mail. Maybe I could write up a patch.
---
I am here: http://maps.google.com/maps?ll=52.498100,5.053895
i have watched those mail's cores already
I think it's a problem with data
it's not with right format or something.da
Anyone can print $order out and send it to me? anyone, who has a paypal(i dont have it). then we can compare a data
before
this row
$order['order_status'] = $new_status;
Thanks folks.
sorry my bad english
I just noticed that in the current svn version they set the $order['customer_notified'] to 0. Probably to temporarily fix this issue to not send the payment confirmation emails...
ok.
open
~/components/com_virtuemart/helpers/shopfunctionsf.php
FInd renderMail
Modify function start like this:
public function renderMail ($viewName, $recipient, $vars=array(),$controllerName = null,$noVendorMail = false) {
if(!class_exists('VirtueMartControllerVirtuemart')) require(JPATH_VM_SITE.DS.'controllers'.DS.'virtuemart.php');
$format = (VmConfig::get('order_html_email',1)) ? 'html' : 'raw';
$controller = new VirtueMartControllerVirtuemart();
$controller->addModelPath(JPATH_VM_SITE.DS.'models');
$controller->addModelPath(JPATH_VM_ADMINISTRATOR.DS.'models');
$controller->addViewPath(JPATH_VM_ADMINISTRATOR.DS.'views');
$view = $controller->getView($viewName, $format);
$view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.'/views/orders/tmpl');
all this need to be befor if()....
long version:
find rendermail function
find
$controller = new VirtueMartControllerVirtuemart();
$controller->addModelPath(JPATH_VM_ADMINISTRATOR.DS.'models');
$controller->addModelPath(JPATH_VM_SITE.DS.'models');
add after that
$controller->addViewPath(JPATH_VM_ADMINISTRATOR.DS.'views');
find
$view = $controller->getView($viewName, $format);
add after that
$view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.'/views/orders/tmpl');
Hello Revo1,
I will test this tomorrow. I hope this can be added to the core to fix that problem so we don't need to get worried whenever we will update our Virtuemart 2 Installation.
Thanks for the update and fix.
Ruud
Hello Revo1,
I can confirme that it also works overhere.
You can also notice now that this one has never worked before with VM 2 as all the language strings used in the confirmation email are'nt available yet.
I hope a Virtuemart developer read this one and checks it out.
Problem explane:
We have two VirtuemartViewOrders. One for Admin and one for site.
On admin VirtuemartviewORDERs class have renderMaillayout function but site VirtuemartviewOrders doesn't.
To resolve this problem we need to add controller view and template to view.
1) find ~/components/com_virtuemart/helpers/shopfunctionsf.php and open it
2)find renderMail function and add after
$controller = new VirtueMartControllerVirtuemart();
$controller->addModelPath(JPATH_VM_ADMINISTRATOR.DS.'models');
$controller->addModelPath(JPATH_VM_SITE.DS.'models');
this:
$controller->addViewPath(JPATH_VM_ADMINISTRATOR.DS.'views');
3) Now find $view = $controller->getView($viewName, $format);
and add after this
$view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.'/views/orders/tmpl');
this modification load VM administrator template and view.
Please notify me, when this bug is fixed.
Thanks
Would this be to start sending admin confirmation emails? I have added the code but am still not receiving admin confirmation emails as described here:
http://forum.virtuemart.net/index.php?topic=95733.0
I am also getting a lot of missing language on payment confirmations which are also mentioned in the other thread.
This one added after
$format = (VmConfig::get('order_html_email',1)) ? 'html' : 'raw';
will translate new order status template:
$lang = &JFactory::getLanguage();
$lang->load('com_virtuemart',JPATH_ADMINISTRATOR);