1: To show invoice after the order is submitted. I used this code below in Display -> View -> checkout -> after_end:
<?php
$app=& JFactory::getApplication();
echo '<iframe src="'.hikashop::completeLink('order&task=show&order_id='.$app->getUserState('com_hikashop.order_id').'&tmpl=component').'" class="hika-terms-iframe" scrolling="no" style="width:100%; height:1200px; margin-top:30px; border:none;" seamless="seamless"></iframe>';
?>
Note: I'm sure there's a better way to do this using Joomla code elements, but I can't seems to find it anywhere. This brings the salesorder into an iframe.
If you want you can just redirect it to the salesorder which is located in you Order History with this:
$app=& JFactory::getApplication();
$app->redirect(hikashop::completeLink('order&task=show&order_id='.$app->getUserState('com_hikashop.order_id'),false,true));
2: To fix the PostAuth sent when using Authorize.net plugin with Plug 'n Pay. (Note: It seems to be an issue even with Authorize.net with AIM method)
Look for: [JOOMLA_ROOT]plugins/hikashoppayment/authorize/authorize.php and replace line 269:
if(!isset($this->element->payment_params->capture))$this->element->payment_params->capture=1;
if($this->element->payment_params->capture){
$vars["x_type"] = 'AUTH_CAPTURE';
}else{
$vars["x_type"] = 'AUTH_ONLY';
}
with
/*
if(!isset($this->element->payment_params->capture))$this->element->payment_params->capture=1;
if($this->element->payment_params->capture){
$vars["x_type"] = 'AUTH_CAPTURE';
}else{
$vars["x_type"] = 'AUTH_ONLY';
}
*/
$vars["x_type"] = 'AUTH_ONLY'; // Removed config option and just use the one needed
Note: This effectively bypass the "Instant Capture" option in the Authorize.net payment plugin configuration which doesn't seems to work anyway.
3: To show the Term & Conditions text (instead of just the link to it). In HikaShop, go to Display -> Views -> checkout -> terms and replace this code:
<div id="hikashop_checkout_terms" class="hikashop_checkout_terms">
<input class="hikashop_checkout_terms_checkbox" id="hikashop_checkout_terms_checkbox" type="checkbox" name="hikashop_checkout_terms" value="1" <?php echo $this->terms_checked; ?> />
<?php
$text = JText::_('PLEASE_ACCEPT_TERMS_BEFORE_FINISHING_ORDER');
$terms_article = $this->config->get('checkout_terms');
if(!empty($terms_article)){
JHTML::_('behavior.modal');
$text = '<a href="'.JRoute::_('index.php?option=com_content&view=article&id='.$terms_article.'&tmpl=component').'" class="modal" rel="{handler: \'iframe\', size: {x: 450, y: 480}}" target="_blank">'.$text.'</a>';
}
?>
<label for="hikashop_checkout_terms_checkbox"><?php echo $text; ?></label>
</div>
With this code:
<div id="hikashop_checkout_terms" class="hikashop_checkout_terms">
<?php
$text = JText::_('PLEASE_ACCEPT_TERMS_BEFORE_FINISHING_ORDER');
$terms_article = $this->config->get('checkout_terms');
if(!empty($terms_article)){
echo '<iframe src="'.JRoute::_('index.php?option=com_content&view=article&id='.$terms_article.'&tmpl=component').'" scrolling="auto" style="width:100%; height:545px; margin-top:30px; border:none;" seamless="seamless"></iframe>';
}
?>
<br /><br />
<input class="hikashop_checkout_terms_checkbox" id="hikashop_checkout_terms_checkbox" type="checkbox" name="hikashop_checkout_terms" value="1" <?php echo $this->terms_checked; ?> />
<label for="hikashop_checkout_terms_checkbox"><?php echo $text; ?></label>
</div>
Note: I used an iframe to display the Terms & Conditions. It is best to alter your Checkout Workflow, placing the "terms" on a step on it's own. The customer still has to check the box to continue with the checkout process.
I hope this can help someone else.