VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: redlo on October 11, 2015, 12:54:46 PM

Title: I need to show the sale of credit cards first, with the paypal option - VM3
Post by: redlo on October 11, 2015, 12:54:46 PM
Hello, my question is for virtuemart 3.0.10. I am a customer and select paypal option to buy. But I have no need paypal account and pay by credit card.

The problem is that if I'm not used to, I have to select the window of the credit cards, made one click more, to buy.

In virtuemart 2, is posible made. Look here http://www.versionet.com/desarollo-web/joomla/146-virtuemart-configurar-pantalla-tarjeta-de-credito-por-defecto-en-paypal-para-virtuemart-2-x.html

In /plugins/vmpayment/paypal/paypal.php in line 200

"address_override" => isset($method->address_override) ? $method->address_override : 0, // 0 ??   Paypal does not allow your country of residence to ship to the country you wish to
      "first_name"       => $address->first_name,
      "last_name"        => $address->last_name,
      "address1"         => $address->address_1,
      "address2"         => isset($address->address_2) ? $address->address_2 : '',
      "zip"              => $address->zip,
      "city"             => $address->city,
      "state"            => isset($address->virtuemart_state_id) ? ShopFunctions::getStateByID ($address->virtuemart_state_id) : '',
      "country"          => ShopFunctions::getCountryByID ($address->virtuemart_country_id, 'country_2_code'),
      "email"            => $order['details']['BT']->email,
      "night_phone_b"    => $address->phone_1,
      "return"           => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt ('Itemid')),



Add this line

"landing_page"     => "billing",


"address_override" => isset($method->address_override) ? $method->address_override : 0, // 0 ??   Paypal does not allow your country of residence to ship to the country you wish to
      "first_name"       => $address->first_name,
      "last_name"        => $address->last_name,
      "address1"         => $address->address_1,
      "address2"         => isset($address->address_2) ? $address->address_2 : '',
      "zip"              => $address->zip,
      "city"             => $address->city,
      "state"            => isset($address->virtuemart_state_id) ? ShopFunctions::getStateByID ($address->virtuemart_state_id) : '',
      "country"          => ShopFunctions::getCountryByID ($address->virtuemart_country_id, 'country_2_code'),
      "email"            => $order['details']['BT']->email,
      "night_phone_b"    => $address->phone_1,
      "landing_page"     => "billing",
      "return"           => JROUTE::_ (JURI::root () . 'index.php?option=com_virtuemart&view=pluginresponse&task=pluginresponsereceived&on=' . $order['details']['BT']->order_number . '&pm=' . $order['details']['BT']->virtuemart_paymentmethod_id . '&Itemid=' . JRequest::getInt ('Itemid')),

But in virtuemart 3 I dont view this code.

¿Can you help me?
Title: Re: I need to show the sale of credit cards first, with the paypal option - VM3
Post by: GJC Web Design on October 11, 2015, 16:36:38 PM
function initPostVariables()  around lines 215

plugins\vmpayment\paypal\paypal\helpers\paypalstd.php

the $post_variables are there
Title: Re: I need to show the sale of credit cards first, with the paypal option - VM3
Post by: redlo on October 11, 2015, 23:34:47 PM
Yes is here

$post_variables['landing_page'] = $billing;

Yes, is already included in the code of virtuemart 3 in /plugins/vmpayment/paypal/paypal/helpers/paypalstd.php , but how do I do to bring up the option to purchase with credit cards first?

Thanks
Title: Re: I need to show the sale of credit cards first, with the paypal option - VM3
Post by: GJC Web Design on October 12, 2015, 09:31:12 AM
Not on mine....

and when you add

$post_variables['landing_page'] = 'billing'; 

?
Title: Re: I need to show the sale of credit cards first, with the paypal option - VM3
Post by: redlo on October 12, 2015, 13:24:22 PM
Excuse me, I made a mistake. I have relocated but still does not work for me.

Look process attachments



Title: Re: I need to show the sale of credit cards first, with the paypal option - VM3
Post by: GJC Web Design on October 12, 2015, 19:49:08 PM
why are you using a var $billing?????  it doesn't exist afaik

use 'billing'  -- that was your hack...
Title: Re: I need to show the sale of credit cards first, with the paypal option - VM3
Post by: redlo on October 12, 2015, 20:46:04 PM
Ups !!  :o . I am here since six this morning and are more eight o'clock. She was with another subject and breaking rather than repair :).

Thank you very much for your time and help.