Welcome, Guest. Please login or register.
Login with username, password and session length


VirtueMart 1.1.8 - [SECURITY RELEASE] is available! Read more....

  Advanced search

247038 Posts in 67506 Topics- by 258314 Members - Latest Member: aniketana
Pages: [1]   Go Down
Print
Author Topic: List Payment method Order problem (you can see in demo in virtuemart.net site)  (Read 10445 times)
hyperpoint
Guest
« on: August 16, 2006, 08:58:52 AM »

Hello
I have a problem that you can see also in the DEMO of Virtuemart in this site (my configuration Joomla 1.0.10 and Virtuemart 1.0.6).

If you go in the backend --> STORE -> LIST PAYMENT METHOD and you select

    [li]PAY PAL (default with order list -1)[/li]
    [li]CASH ON DELIVERY (not default with order list 10 and discount -2,00 Euro)[/li]

    [/list]

    In the front End


    You will have in Cash,
      [li]FIRST and SELECTED - Cash on Delivery[/li]
      [li]PAY PAL as second option[/li]

      [/list][/color]

      It seems that Virtuemart doesn't respect the list order. This thing is driving me mad. I don't understand where I make a mistake.
      Logged
      rtphokie
      Newbie
      *
      Posts: 2


      « Reply #1 on: August 27, 2006, 11:27:08 AM »

      The list order parameter doesn't affect the overall order of the payment list presented to the user, it affects the order of the payment methods within classes within the list.  I dont know why it's implemented this way but it is.

      Digging into the code, there are 3 classes of payment methods, bank, nocheck and paypalrelated.  They are presented in that order and this is hard coded in admin/components/html/checkout_paymentradio.php:

                        $ps_payment_method->list_nocheck($payment_method_id,  false);
                        $ps_payment_method->list_bank($payment_method_id,  false)     
                        $ps_payment_method->list_paypalrelated($payment_method_id,  false);

      I see no other way to make PayPal payments appear first (thus be the default) than to change the order of these method calls.  I moved the call to list_paypalrelated above list_nocheck and my problem was solved.

      While I see the value in grouping similar payment methods together, the ability to make a particular payment method the default by listing it first far outweighs any grouping benefits.
      These methods mentioned above should be eliminated and the selection done in a single sql query instead of 3 of them, that way the list order specified in the backend can be respected.

      Hope that helps.

      « Last Edit: August 27, 2006, 13:43:40 PM by rtphokie » Logged
      Michael
      Newbie
      *
      Posts: 2


      « Reply #2 on: January 22, 2007, 23:07:58 PM »

      Thanks
      Logged
      Wes Lindberg
      Newbie
      *
      Posts: 1


      « Reply #3 on: June 12, 2007, 15:33:44 PM »

      Can anyone help me find this file "admin/components/html/checkout_paymentradio.php" OR another solution to the problem. I need to change the order of the Payment Type radio buttons. I have "VirtueMart 1.0.9 stable" installed in Joomla 1.0.12.


      The list order parameter doesn't affect the overall order of the payment list presented to the user, it affects the order of the payment methods within classes within the list.  I dont know why it's implemented this way but it is.

      Digging into the code, there are 3 classes of payment methods, bank, nocheck and paypalrelated.  They are presented in that order and this is hard coded in admin/components/html/checkout_paymentradio.php:

                        $ps_payment_method->list_nocheck($payment_method_id,  false);
                        $ps_payment_method->list_bank($payment_method_id,  false)     
                        $ps_payment_method->list_paypalrelated($payment_method_id,  false);

      I see no other way to make PayPal payments appear first (thus be the default) than to change the order of these method calls.  I moved the call to list_paypalrelated above list_nocheck and my problem was solved.

      While I see the value in grouping similar payment methods together, the ability to make a particular payment method the default by listing it first far outweighs any grouping benefits.
      These methods mentioned above should be eliminated and the selection done in a single sql query instead of 3 of them, that way the list order specified in the backend can be respected.

      Hope that helps.


      Logged
      yourmanstan
      Newbie
      *
      Posts: 25


      « Reply #4 on: September 12, 2007, 10:43:06 AM »

      great work!  i'm disappointed i missed this on my first review of the file

      exact same problem.  couldn't for the life of me figure out why the 'order by' appeared to organize by the list order, but still was sorting incorrectly.  this makes much more sense.

      Quote
                       $ps_payment_method->list_nocheck($payment_method_id,  false);
                        $ps_payment_method->list_bank($payment_method_id,  false)     
                        $ps_payment_method->list_paypalrelated($payment_method_id,  false);

      this is on line 166-168 for those who want to find it quickly

      switched the order of these lines and presto it is working.  thanks!
      « Last Edit: September 12, 2007, 10:44:41 AM by yourmanstan » Logged
      DWDesigns
      Newbie
      *
      Posts: 7


      « Reply #5 on: January 19, 2009, 12:53:01 PM »

      I am having trouble with this as well.  I understand how to adjust the order of payments through the hard-coding, but what if I want Paypal listed at the bottom (regular order) and it is coming up as the default anyway?  I want payment by check to be the default, and be listed at the top.
      Logged
      joomlancing
      Newbie
      *
      Posts: 4


      « Reply #6 on: May 05, 2009, 19:26:14 PM »

      For those seeking this on Virtuemart 1.1.3 its in list_payment_methods.tpl.php
      Logged
      trusting
      Newbie
      *
      Posts: 18


      « Reply #7 on: August 07, 2009, 18:45:21 PM »

      Here's the complete address for the file in Virtuemart 1.1.3:

      components/com_virtuemart/themes/default/templates/checkout/list_payment_methods.tpl.php

      Thanks to Barbara in another thread.

      Teresa Smiley
      Logged
      Pages: [1]   Go Up
      Print
      Jump to: