How do I make WorldPay show up before login

  • Posts: 31
  • Thank you received: 3
12 years 1 month ago #66901

I have Hikashop working and correctly configured with WorldPay, tested etc... Everything fine.

Apart from my client wants the payment option 'WorldPay' to show up on the list of payment methods before the user has registered or signed in.

At present, until you sign in, WorldPay doesn't show up as a payment method.

Don't get me wrong, they will still have to register/sign in to complete their order. It would just be nice to see it listed before they sign in.

Is it possible to change this?

Thanks in advance if anyone can help.

Please Log in or Create an account to join the conversation.

  • Posts: 83
  • Thank you received: 10
12 years 1 month ago #66912

in Configuration/Checkout there's the area of the workflow. can you do a screen shot of your checkout workflow?

to see if you have one step or multi step checkout setup

The following user(s) said Thank You: Mohamed Thelji

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 1 month ago #66915

Hi,

I think that you should :
- Go to "Hikashop->System->Configuration->Checkout"
- Edit your "checkout workflow"
- Set your login option after or in the same step as your payment option

Hope this will help you.

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 3
12 years 1 month ago #66921

Thanks,

Here is the screen grab. Maybe I am not understanding how the checkout workflow works, but I believe i have login after the payment option. My other payment option (pay by cheque) appears before the user is logged in.

Steve

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 83
  • Thank you received: 10
12 years 1 month ago #66933

it seems you understand how the checkout workflow works ;)

you do have payment in a step before login.

since your other payment methods show up before the user logs in then either

a) the WorldPay payment plugin is assigned to zones. Delete those associated zones, or
b) WorldPay does not show until it knows which country the user is in, which can not happen until the user logs in.

I suspect it is b......

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 3
12 years 1 month ago #66934

Hi jrod,

Thanks - and yes WorldPay is not assigned to any zones, so I think it is b. / something in the WorldPay plugin.

Strangely, pay by cheque is assigned to a zone (UK only) and yet this does appear before the system knows the zone (ie before login).

Maybe Nicolas can shed some light on this?

Steve

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 1 month ago #66943

I checked the Worldpay code, and your worldpay payment methode won't show up before you logged in if you have set a payment zone, AND you should edit your worldpay payment method and change the line :

function onPaymentDisplay(&$order,&$methods,&$usable_methods){
			if (!$this->isShippingValid(@$order->shipping)) return false;
			if (empty($order->total)) return false;
			if (empty($methods)) return false;
			$user = hikashop::loadUser(true);
                        if (!$user) return false;
by this line
function onPaymentDisplay(&$order,&$methods,&$usable_methods){
			if (!$this->isShippingValid(@$order->shipping)) return false;
			if (empty($order->total)) return false;
			if (empty($methods)) return false;
			$user = hikashop::loadUser(true);
                      //if (!$user) return false;

Last edit: 12 years 1 month ago by Mohamed Thelji.

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 3
12 years 1 month ago #66946

Thank you Mohamed,

No payment zone is set for WorldPay, so I need to edit the code

Where do I find this code?

Thank you,

Steve

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 1 month ago #66948

You'll find this code through the file "'Your hikashop'\plugins\hikashoppayment\bf_rbsglobalgateway\bf_rbsglobalgateway.php"

The following user(s) said Thank You: SteveEvans

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 3
12 years 1 month ago #67067

Sorry Mohamed but this doesn't solve the problem.

Just to confirm, the WorldPay payment method has no zone assigned.

Steve

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 3
12 years 1 month ago #67124

OK - just to be clear, editing the code like Mohamed suggests does not allow WorldPay to show up as a payment option before the user has registered / logged in.
:(
Steve

Please Log in or Create an account to join the conversation.

  • Posts: 82796
  • Thank you received: 13356
  • MODERATOR
12 years 1 month ago #67216

Hi,

The modification that Mohamed proposed is fine. However, he told you to modify it in plugins\hikashoppayment\bf_rbsglobalgateway\bf_rbsglobalgateway.php
That file is for the WorldPay Global Gateway.
Are you sure that you're using the Global Gateway and not the Business Gateway ? If not, then you should edit that file and do the same modification:
plugins\hikashoppayment\bf_rbsbusinessgateway\bf_rbsbusinessgateway.php

Last edit: 12 years 1 month ago by nicolas.
The following user(s) said Thank You: SteveEvans

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 3
12 years 1 month ago #68236

Thank you Nicolas,

Yes I can confirm that this works although for anyone else trying to do this the path that Nicolas gives is still wrong.

It is in plugins/hikashoppayment/bf_rbsbusinessgateway/bf_rbsbusinessgateway.php

Thanks again.

The following user(s) said Thank You: nicolas

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 3
11 years 9 months ago #89969

I've recently upgraded Hikashop to the latest version (com_hikashop_business_2.1.0_2013-02-12.tar.gz) and once again this problem has re-occured.

Fine - I figure the code has been over-written. I just need to change it again...

But when I look at /home/mywebsite/public_html/plugins/hikashoppayment/bf_rbsbusinessgateway/bf_rbsbusinessgateway.php the code for the function onPaymentDisplay has changed from the fix given by Mohamed.

I now have:

function onPaymentDisplay(&$order,&$methods,&$usable_methods){
			if (!$this->isShippingValid(@$order->shipping)) return false;
			if (empty($order->total)) return false;
			if (empty($methods)) return false;
			$user = hikashop::loadUser(true);
			$found = false;
			foreach($methods as $method){
			if($method->payment_type!='bf_rbsbusinessgateway') continue;
				if ($method->payment_params->testMode) {
					if (isset($user->user_tester)) {
						if (@$user->user_tester != 'Y') continue;
					}
				}
				else if (@$user->user_tester == 'Y') continue;
				if(!@$method->payment_params->displayForGuests){
					if (!$user) continue;
				}
				if (!$method->enabled) continue;
				if(!empty($method->payment_zone_namekey)){
					$zoneClass=hikashop::get('class.zone');
					$zones = $zoneClass->getOrderZones($order);
					if(!in_array($method->payment_zone_namekey,$zones)) continue;
				}
				$currencyClass = hikashop::get('class.currency');
				$null=null;
				$currency_id = intval(@$order->total->prices[0]->price_currency_id);
				$currency = $currencyClass->getCurrencies($currency_id,$null);
				if(!empty($currency) && !in_array(@$currency[$currency_id]->currency_code,$this->accepted_currencies)){
					continue;
				}
				$usable_methods[$method->ordering]=$method;
				$found = true;
			}
			return $found;
		}

What do I need to change to get WorldPay to show up as an option before someone logs on like before?

Thanks,
Steve

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #90046

Hi,

You should have an option for the guest users, see in the plugin options if you can enable something which look like "display for guests"

The following user(s) said Thank You: SteveEvans

Please Log in or Create an account to join the conversation.

  • Posts: 31
  • Thank you received: 3
11 years 8 months ago #90083

Yes - I can confirm that works.

Many thanks
Steve

Please Log in or Create an account to join the conversation.

Time to create page: 0.119 seconds
Powered by Kunena Forum