nicolas wrote: Hi,
In most payment methods of HikaShop, you'll find a "return URL" parameter where you can enter the URL where you want the user to be redirected after the payment. So no code required. That's the case for PayPal, Bitcoin and Stripe.
For the user points plugin, there is no such option as it's a bit special. It depends on how you configure your user points plugin.
If you only allow partial payments with coupons of points, there it no need to do anything. If you allow for the full payment of the orders with points, you would have to modify the file "end" of the view "checkout" via the menu Display>Views with such code:
<?php
$app = JFactory::getApplication();
$order_id = $app->getUserState('com_hikashop.order_id');
$orderClass = hikashop_get('class.order');
$order = $orderClass->get($order_id);
if($order->order_payment_method=='userpoints') $app->redirect('URL'); ?>
If we use bank transfer and userpoints will this code work. I want to show order details for every checkout method we have.
So for I have adjusted the after_end view like this for our credit card method:
<?php
/**
* @package HikaShop for Joomla!
* @version 2.6.2
* @author hikashop.com
* @copyright (C) 2010-2016 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
*/
defined('_JEXEC') or die('Restricted access');
?><?php
$app =& JFactory::getApplication();
$app->enqueueMessage( JText::_('THANK_YOU_FOR_PURCHASE') );
$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));
}
?>
What do I need to do to my end view in order to do as I want?