News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Setting default payment and shipping method in VM2?

Started by Artanis, April 22, 2012, 03:49:48 AM

Previous topic - Next topic

BCD


toad78

It seems this is an ongoing problem with VM. I'm now using 2.0.14 and I still cannot get 'Select Shipping' and 'Select Payment' method to disappear on checkout. I only have one shipping method and one payment method.


PRO

Quote from: toad78 on November 16, 2012, 00:45:47 AM
It seems this is an ongoing problem with VM. I'm now using 2.0.14 and I still cannot get 'Select Shipping' and 'Select Payment' method to disappear on checkout. I only have one shipping method and one payment method.




is auto select shipping enabled?

ALSO:
what payment method do you have?
If it's authorize.net. You do not want auto select

PRO

to remove  "select shipment"

change
cart/default_pricelist.php

<?php /*   <td colspan="2" align="right"><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SHIPPING'); ?> </td> */ ?>
            <td colspan="4" align="left">
            <?php echo $this->cart->cartData['shipmentName']; ?>
   <br/>
   <?php
   if (!empty($this->layoutName) && $this->layoutName == 'default' && !$this->cart->automaticSelectedShipment) {
      echo JHTML::_ ('link', JRoute::_ ('index.php?view=cart&task=edit_shipment', $this->useXHTML, $this->useSSL), $this->select_shipment_text, 'class=""');
   } else {
      JText::_ ('COM_VIRTUEMART_CART_SHIPPING');
   }
} else {
   ?>
   <td colspan="4" align="left">
      <?php echo $this->cart->cartData['shipmentName']; ?>
   </td>
   <?php } ?>



to this

<?php /*   <td colspan="2" align="right"><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_SHIPPING'); ?> </td> */ ?>
            <td colspan="4" align="left">
            <?php echo $this->cart->cartData['shipmentName']; ?></td>


toad78

Quote from: PRO on November 19, 2012, 19:10:16 PM


is auto select shipping enabled?

ALSO:
what payment method do you have?
If it's authorize.net. You do not want auto select

Yes, to the first question.
Secondly, why wouldn't you want auto select if it's Authorize.net?

toad78

Thank you for the recommendation, but I kept receiving an error.

What I did was just hide the label by commenting the following line:

<td colspan="4" align="left">

            <?php echo $this->cart->cartData['shipmentName']; ?>

This removed the label that I wanted to remove. After testing, the shipping price does pop up as it should without the label to 'Select Shipment'. If, in the future, if I need to use more than one shipping option, then I know I can uncomment that line to bring it back.

Thank you for your time, PRO!

PRO

Quote from: toad78 on November 22, 2012, 02:55:00 AM
Quote from: PRO on November 19, 2012, 19:10:16 PM


is auto select shipping enabled?

ALSO:
what payment method do you have?
If it's authorize.net. You do not want auto select

Yes, to the first question.
Secondly, why wouldn't you want auto select if it's Authorize.net?

because it tries to go forward with order, and the user receives an error their credit card info is wrong

raunhar

Is the default_pricelist.php under views/cart/temp

If yes, i tried making the changes but no effect. I have only one Payment option i.e. paypal, but am unable to select it as default.

DrZero

I have Joomla 2.5.8 with VM 2.0.14 and I use authorize.net and I have also unselected the auto select payment, but if I choose "select payment" before I input the billing/shipping information, I still get no options.  It only shows up when I modify the billing / ship to info.  This is quite the bug.  If the end user "HAS" to enter the billing/shipping information first no matter what, then it should not show up on the first screen....only the one part first.....then on the next screen have it auto select shipping, and auto select payment method if applicable since it has the information needed for that.  This could have been designed a bit better in that regard.  Hopefully you can make this change in the next version?

DrZero

Also neither of those methods for payment hack work on VM 2.0.14. .... No love!!

Renata

Just use language override of Joomla and leave tekst empty

(was searching for a solution for this myself and came myself with this solution. It works fine for me.

Kind regards
Renata
Please visit my website https://responsivewebsitemaken.nl for all your graphic webdesign and Joomla websites.

Ragdata

#26
Hi Guys,

Just thought I'd share a very quick solution for this problem which works for me using version 2.0.24.  Unfortunately it's a hack rather than an override - but it's a minor one so I can forgive myself.

/components/com_virtuemart/views/cart/view.html.php

Around line 56 or so (just after $cart is instantiated in the display() function), insert the following code:


if( $cart->virtuemart_shipmentmethod_id == 0 ){ $cart->setShipment( 3 ); } //<< Use the ID of whichever method suits you best
if( $cart->virtuemart_paymentmethod_id == 0 ){ $cart->setPaymentMethod( 1 ); } //<< Use the ID of whichever method suits you best


No problem selecting a different method, and everything seems to be getting applied from the point-of-view of shipping fees and the like.
Yes, I'm available for custom development work - No, I'm not cheap :: http://www.aequitas-internet.com.au/

mbrando

Hello,

I came up with a NON-hack way to do this.

Create an HTML override file in your template folder:
/templates/rt_quantive/html/com_virtuemart/cart/select_payment.php

Look for this around line 44 ish.


<?php
     
if ($this->found_payment_method) {


    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>";

    } else {
 echo "<h1>".$this->payment_not_found_text."</h1>";
    }


    
?>




After the closing PHP tag for the echo field set add this:


        <script type="text/javascript">
<!--
radiobtn = document.getElementById("payment_id_3");
radiobtn.checked = true;
-->
</script>


So it looks like this:


<?php
     
if ($this->found_payment_method) {


    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>";

    } else {
 echo "<h1>".$this->payment_not_found_text."</h1>";
    }


    
?>

        <script type="text/javascript">
<!--
radiobtn = document.getElementById("payment_id_3");
radiobtn.checked = true;
-->
</script>


Where 'payment_id_3' in the document.getElementById("payment_id_3") is the ID the radio button you want checked. Note the 3 in 'payment_id_3' is the payment ID you'd see in the payment method list on the far right in the VM admin panel.

- Mike
Reliable Web Hosting www.JIKOmetrix.net

favdes

Quote from: woood77 on May 07, 2012, 18:14:34 PM
I've noticed that when I have 1 shipping method than that shipping method is automatically selected, which works correctly.  However when I have 1 payment method that payment method is NOT automatically selected.  This has turned out to be somewhat confusing to my users.

I've verified in the Configuration that "Enable Automatic Selected Payment?" is checked.

I'm using version 2.0.6 of VM.

Hi,

Not sure if you fixed this or not but I've just had a similar problem. I only have one shipping method but it was not automatically being selected at checkout. To fix it, I changed the 'List Order' in the shipping method configuration from '0' to '1' and that did it.

vitaly-zdanevich

#29
mbrando, you say: "Create an HTML override file in your template folder" - you mean - just create HTML-file? I do file select_payment.php in /templates/shaper_istore/html/com_virtuemart/cart2 and clear cache but I not have default value for radiobutton.