Redirect using PayPal & PayPal Pro

  • Posts: 11
  • Thank you received: 0
12 years 4 months ago #55955

Hi everyone. I offer both PayPal and PayPal Pro as payment options. I want every end process to show order details, similar to what a customer would receive in their confirmation email. As per another thread where Nicholas mentions adding the code below to either end.php or after_end.php depending on whether payment is internal or external, I have done that, which works perfectly when I add it to either end or after_not, but not to both. Since I offer both payment options, how can I ensure that both payment options redirect correctly? When I add it to end.php and try to pay with PayPal, it redirects me prematurely and I cannot pay.

The code I'm trying to add:
$app=& JFactory::getApplication();
$app->redirect(hikashop::completeLink('order&task=show&order_id='.$app->getUserState('com_hikashop.order_id'),false,true));

This is what I currently have configured:

- On HikaShop I have left the end URL/return URL blank for both PayPal and PayPal Pro, just in case.

- Checkout workflow: confirm_cart_coupon_login_address_shipping_payment_fields_status,end

- On the PayPal end, I am required to put a return URL, and I have index.php?option=com_hikashop&ctrl=checkout&task=after_end

What should I change to achieve this?

Thank you in advance! The support on here is incredible, and I'll be recommending HikaShop as often as I can.

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

  • Posts: 82820
  • Thank you received: 13368
  • MODERATOR
12 years 4 months ago #55979

Hi,

You will have to use that code in the end.php file then:

$app =& JFactory::getApplication();
$order_id=$app->getUserState( HIKASHOP_COMPONENT.'.order_id' );
$class = hikashop_get('class.order');
$order= $class->get($order_id);
if($order->order_payment_method!='paypal'){
$app->redirect(hikashop::completeLink('order&task=show&order_id='.$order_id,false,true));
}

The following user(s) said Thank You: kleeph

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

  • Posts: 11
  • Thank you received: 0
12 years 4 months ago #55997

Hi Nicolas! Thank you so much for the fast response, I added it. Should I now change the PayPal return URL to end instead of after_end, or leave it to after_end?

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

  • Posts: 82820
  • Thank you received: 13368
  • MODERATOR
12 years 4 months ago #56007

Hi,
You should leave the return url field empty I think.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum