Author Topic: Payment Methods - Sort order/Order list during checkout  (Read 9811 times)

gjrweb

  • Beginner
  • *
  • Posts: 16
Payment Methods - Sort order/Order list during checkout
« on: October 25, 2012, 12:22:36 pm »
 Joomla 2.5.7 / Virtuemart 2.0.12f

We added 3 payment options to Virtuemart, the list order is not properly displayed in the front-end of the shop during checkout when selecting your preferred payment option.
[GJ-R] Webdevelopment & E-Commerce Expert

gjrweb

  • Beginner
  • *
  • Posts: 16
Re: Payment Methods - Sort order/Order list during checkout
« Reply #1 on: October 26, 2012, 11:24:37 am »
No known issues or a fix yet?
[GJ-R] Webdevelopment & E-Commerce Expert

Jason Farmer

  • Beginner
  • *
  • Posts: 49
Re: Payment Methods - Sort order/Order list during checkout
« Reply #2 on: October 27, 2012, 23:18:22 pm »
same...

vm 2.0.12b
J 2.5.6

index.php?option=com_virtuemart&view=cart&task=editpayment

Payment method order does not get used .. they just seem to appear in a random order.


and on vm 2.0.12d

Screenshot of problem on demo.virtuemart.net
DevelopmentProduction
VirtueMart  
2.0.12b
1.1.3
Joomla!  
2.5.6
1.5.14
Mysql 
5.5.8
5.0.51
PhP  
5.3.5
5.2.4

gjrweb

  • Beginner
  • *
  • Posts: 16
Re: Payment Methods - Sort order/Order list during checkout
« Reply #3 on: November 02, 2012, 08:41:25 am »
Glad to see thre are more people having the same problem.

You already managed to get a fix?
[GJ-R] Webdevelopment & E-Commerce Expert

Jason Farmer

  • Beginner
  • *
  • Posts: 49
Re: Payment Methods - Sort order/Order list during checkout
« Reply #4 on: November 02, 2012, 10:52:50 am »
Nope, no fix.

I've had a look at the code and its using the Joomla JTable class to fetch and display these items ... there's no simple db query to add an order by clause to... I've had a look at the documentation for the class and  haven't found any way of implementing a sort order - I feel that there must be one, and I'm just not looking for the right term... 
DevelopmentProduction
VirtueMart  
2.0.12b
1.1.3
Joomla!  
2.5.6
1.5.14
Mysql 
5.5.8
5.0.51
PhP  
5.3.5
5.2.4

gjrweb

  • Beginner
  • *
  • Posts: 16
Re: Payment Methods - Sort order/Order list during checkout
« Reply #5 on: November 09, 2012, 15:54:57 pm »
This is the code to generate the list of payment options, in /components/com_virtuemart/views/cart/tmpl/select_payment.php

   echo "<fieldset>";
      foreach ($this->paymentplugins_payments as $paymentplugin_payments) {
          if (is_array($paymentplugin_payments)) {
         foreach ($paymentplugin_payments as $paymentplugin_payment) {
             echo $paymentplugin_payment.'<br />';
         }
          }
      }
    echo "</fieldset>";


Would be great to integrate the order list here, as it should work!

[GJ-R] Webdevelopment & E-Commerce Expert

Jason Farmer

  • Beginner
  • *
  • Posts: 49
Re: Payment Methods - Sort order/Order list during checkout
« Reply #6 on: November 13, 2012, 13:12:00 pm »
Unfortunately the order field is not present in the payment plugins array ... so it can't be done in the view - at least not without accessing the database...

Code: ($this->paymentplugins_payments) [Select]
Array
(
    [0] =&gt; Array
        (
            [0] =&gt; <input type="radio" name="virtuemart_paymentmethod_id" id="payment_id_5" value="5">
<label for="payment_id_5"><span class="vmpayment"><span class="vmpayment_name">Direct Bank Transfer</span><span class="vmpayment_description"><div class="payment-details"><p>Pay using your online banking's 'Pay a Bill' option, then call the office so that we can confirm your enrolment.</p>
<p>You will usually be able to start your course immediately</p></div></span></span></label>

            [1] =&gt; <input type="radio" name="virtuemart_paymentmethod_id" id="payment_id_4" value="4">
<label for="payment_id_4"><span class="vmpayment"><span class="vmpayment_name">Phone</span><span class="vmpayment_description"><div class="payment-details"><p>Pay over the phone using your credit or debit card. You will usually be able to start your course immediately.</p></div></span></span></label>

            [2] =&gt; <input type="radio" name="virtuemart_paymentmethod_id" id="payment_id_2" value="2">
<label for="payment_id_2"><span class="vmpayment"><span class="vmpayment_name">Cheque</span><span class="vmpayment_description"><div class="payment-details">
<p><strong>We will need to wait until your cheque clears before you can start your course.</strong></p></div></span></span></label>

        )

    [1] =&gt; Array
        (
            [0] =&gt; <input type="radio" name="virtuemart_paymentmethod_id" id="payment_id_1" value="1">
<label for="payment_id_1"><span class="vmpayment"><span class="vmpayment_name">Paypal</span><span class="vmpayment_description"><div class="payment-details"><p>Immediate Start : Paypal is a secure payment service for all credit and debit cards, and you don't need a paypal account to use it.</p></div></span></span></label>

        )

)

DevelopmentProduction
VirtueMart  
2.0.12b
1.1.3
Joomla!  
2.5.6
1.5.14
Mysql 
5.5.8
5.0.51
PhP  
5.3.5
5.2.4

alistair|ctyou

  • Beginner
  • *
  • Posts: 2
Re: Payment Methods - Sort order/Order list during checkout
« Reply #7 on: November 15, 2012, 01:57:50 am »
Unfortunately, the order of the payment methods is determined by the order in which the plgVmDisplayListFEPayment event fires.

Long story short:

Try ordering the payment plugins in Joomla:

Extensions | Plugins
change - Select Type - to vmpayments
click on Ordering column to sort by order
arrange order of plugins

gjrweb

  • Beginner
  • *
  • Posts: 16
Re: Payment Methods - Sort order/Order list during checkout
« Reply #8 on: November 23, 2012, 10:20:40 am »
Hi alistair|ctyou,

Thanks! That work around just did it!

This is a bug for sure, is it already solved in virtuemart 2.0.14?
[GJ-R] Webdevelopment & E-Commerce Expert

nickelas

  • Beginner
  • *
  • Posts: 21
Re: Payment Methods - Sort order/Order list during checkout
« Reply #9 on: April 28, 2013, 10:36:10 am »
Quote from: alistair
Long story short:

Try ordering the payment plugins in Joomla:

Extensions | Plugins
change - Select Type - to vmpayments
click on Ordering column to sort by order
arrange order of plugins

Great workaround for getting the payment methods in the right order

eag

  • Beginner
  • *
  • Posts: 29
Re: Payment Methods - Sort order/Order list during checkout
« Reply #10 on: January 16, 2014, 03:22:54 am »
Long story short:

Try ordering the payment plugins in Joomla:

Extensions | Plugins
change - Select Type - to vmpayments
click on Ordering column to sort by order
arrange order of plugins

Thank you alistair

lliseil

  • Beginner
  • *
  • Posts: 34
  • Man is Web's future.
    • LLiseil Web services e-Commerce Virtuemart
  • VirtueMart Version: 2.0.26
Re: Payment Methods - Sort order/Order list during checkout
« Reply #11 on: August 13, 2014, 20:11:13 pm »
Just to confirm alistair's workaround works on VM 2.6.6
Thank you for sharing alistair|ctyou!
- A thread solved is a thread [SOLVED]! (a memo for myself)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9905
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Payment Methods - Sort order/Order list during checkout
« Reply #12 on: August 14, 2014, 09:11:41 am »
This is a bug for sure, is it already solved in virtuemart 2.0.14?

It is not a bug, it is a consequence of the joomla plugin system, it is a general problem http://www.nonumber.nl/news/blog/242-plugin-order-is-important. Atm we plan a parallel system, which works without the joomla trigger system. More kind of firing events.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

lliseil

  • Beginner
  • *
  • Posts: 34
  • Man is Web's future.
    • LLiseil Web services e-Commerce Virtuemart
  • VirtueMart Version: 2.0.26
Re: Payment Methods - Sort order/Order list during checkout
« Reply #13 on: August 26, 2014, 20:03:17 pm »
Good to read Milbo's details. atm VM updates reversed previous payements' plugins orders, 'Paypal' returning on first amongst activated.
- A thread solved is a thread [SOLVED]! (a memo for myself)

gba

  • Jr. Member
  • **
  • Posts: 282
Re: Payment Methods - Sort order/Order list during checkout
« Reply #14 on: January 25, 2018, 10:58:12 am »
Hi!

I am using VirtueMart 3.2.12 and Joomla!3.8.3.
Unfortunately still it is not possible to sort the payment methods in cart frontend according to the sort order set in VM payment methods backend list.
The workaround above is good as long you have just one payment method for each type (i. e. standard, paypal, sofort).
I have two payment methods of type 'standard'. These two methods are not sortable, even with this workaround.
Anyone any useful hint for solving that?
Thank you very much in advance!

Kind regards,
Gerald