Author Topic: Set order status via URL - possible?  (Read 5261 times)

Adwans

  • Beginner
  • *
  • Posts: 35
  • Beginner, I do think so
Re: Set order status via URL - possible?
« Reply #15 on: September 06, 2016, 17:43:36 pm »
Hello!
I tried:
Code: [Select]
protected function checkConditions ($cart, $method, $cart_prices) {
$amount = $this->getCartAmount($cart_prices);
if($amount < 999999999) { return false;}

}
function plgVmOnShowOrderBEPayment ($virtuemart_order_id, $virtuemart_payment_id) {
return false;
}
with no success. Maybe is there any function in charge of BE paymentmethod editing? However, it is called from another view and task.
Or plugin is "listening" and waiting for some parameters?
Quote
maybe by amount or detect if FE/admin or look for a url var etc .. depends how your using this
I use this that way:
Code: [Select]
index.php?option=com_virtuemart&view=vmplg&task=pluginresponsereceived&pm=6&on=HERE-ORDER-NUMBER&os=C as for Confirmed
add some parameter? or pm=6 is wrong?
NOTE: I can see that plugin obeys this:
Code: [Select]
if (strstr($view,'paymentmethod')) ... //editing payments
else if (strstr($view,'vmplg') ) // plugin working
{
What should I put after ($view,'paymentmethod')) ?

Adwans

  • Beginner
  • *
  • Posts: 35
  • Beginner, I do think so
Re: Set order status via URL - possible?
« Reply #16 on: September 06, 2016, 18:33:57 pm »
OK, I got it  ;D SOLVED
Thanks Rupostel! for creating this and @GJC for mention: Great plugin that saves you a lot of (free) time:
https://www.rupostel.com/utilities-for-joomla/extensions/fatal-catcher-plugin
This plugin has allowed to find the bug, one faulty $require.
Now set order status via URL plugin works fine, sends emails to me, and also doesnt interfere with any edit admin page  :)
If you ever have any WSOD, use this plugin.

GJC Web Design

  • 3rd party VirtueMart Developer
  • Hero Member
  • *
  • Posts: 7485
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 2.6.22 & 3.2.2
Re: Set order status via URL - possible?
« Reply #17 on: September 06, 2016, 21:14:26 pm »
https://www.rupostel.com/utilities-for-joomla/extensions/fatal-catcher-plugin

can only agree -- some servers are almost impossible to access logging and this is the 1st tool to use in this case - thanks Stan
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

gba

  • Jr. Member
  • **
  • Posts: 190
Re: Set order status via URL - possible?
« Reply #18 on: September 29, 2016, 15:25:02 pm »
Check for security?
Doesn't function getOrderIdByOrderPass() already check security??
Does it or does it not?  ???

Kind regards,
Gerald

cybersholt

  • Beginner
  • *
  • Posts: 3
Re: Set order status via URL - possible?
« Reply #19 on: June 06, 2017, 17:29:19 pm »
Just wanted to say thanks, the info here helped create something similar that changes the order status to shipped & includes some tracking info as a comment.

Adwans

  • Beginner
  • *
  • Posts: 35
  • Beginner, I do think so
Re: Set order status via URL - possible?
« Reply #20 on: June 22, 2017, 18:02:31 pm »
Check for security?
Doesn't function getOrderIdByOrderPass() already check security??
Does it or does it not?  ???
Kind regards,
Gerald
Hi Gerald, I wonder the same. Maybe Milbo say sth less .. enigmatic?.
My ideas since now:
1. checking of logged in user *not guest ?
look:
http://forum.virtuemart.net/index.php?topic=129339.msg445160#msg445160
2. checking if logged-in user is the person which had created specific order in question?
Any further ideas?
 :D

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9085
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Set order status via URL - possible?
« Reply #21 on: June 22, 2017, 21:20:20 pm »
for example
Code: [Select]
if(!vmAccess::manager('core') ){
$msg = 'Forget IT';
$this->setRedirect('index.php?option=com_virtuemart', $msg);
}

Redirects any non Superadmin. Or use only vmAcess::manager(), checks for managers ('core.admin', 'core.manage', 'vm.manage'), which is usually the standard. You can also check for a certain right. The rights to check orders would be 'orders' => vmAccess::manager('orders') and only for order status change it is 'orders.status'. You can even check for more than one right and chain it or use it as or.

I just notice the right order.status is atm only used in the controllers, so it is not checked in your case.

It automatically checks also for Background admin rights. ;-) Makes fun
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/