- Posts: 59
- Thank you received: 0
Pay now button in order show (single order page)
11 years 3 months ago #204509
by simonev
Pay now button in order show (single order page) was created by simonev
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1
Hi,
I would like to insert the "pay now" button and cancel button of order listing in order show.
I just copy/paste this code from order listing in order show and it doesn't work:
I'm not so familiar, could you please tell me what I have to edit to let it work please?
-- Joomla version -- : 3.4.1
Hi,
I would like to insert the "pay now" button and cancel button of order listing in order show.
I just copy/paste this code from order listing in order show and it doesn't work:
Code:
<?php if(!empty($row->show_payment_button) && bccomp($row->order_full_price,0,5)>0){ ?>
<form action="<?php echo $orderUrl; ?>" method="post" name="adminForm_<?php echo $row->order_id; ?>">
<?php
if($this->payment_change){
$text = JText::_('PAY_NOW');
$this->payment->order = $row;
$this->payment->preload(false);
echo $this->payment->display('new_payment_method',$row->order_payment_method,$row->order_payment_id,false);
}else{
$text = JText::sprintf('PAY_WITH_X',$this->payment->getName($row->order_payment_method,$row->order_payment_id));
}
$url = hikashop_completeLink('order&task=pay&order_id='.$row->order_id.$url_itemid);
if($config->get('force_ssl',0) && strpos('https://',$url) === false) {
$url = str_replace('http://','https://',HIKASHOP_LIVE) . 'index.php?option=com_hikashop&ctrl=order&task=pay&order_id='.$row->order_id;
}
echo $this->cart->displayButton($text,'pay',$this->params,$url,'document.adminForm_'.$row->order_id.'.submit();return false;','class="hikashop_order_pay_button"');
?>
<input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>"/>
<input type="hidden" name="option" value="<?php echo HIKASHOP_COMPONENT; ?>" />
<input type="hidden" name="task" value="pay" />
<input type="hidden" name="order_id" value="<?php echo $row->order_id; ?>" />
<input type="hidden" name="ctrl" value="<?php echo JRequest::getCmd('ctrl'); ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php }
if( isset($row->show_cancel_button) && $row->show_cancel_button ) {?>
<form action="<?php echo hikashop_completeLink('order'.$url_itemid); ?>" method="post" name="adminForm_<?php echo $row->order_id; ?>_cancel">
<?php
$text = JText::_('CANCEL_ORDER');
echo $this->cart->displayButton($text,'cancel_order',$this->params,hikashop_completeLink('order&task=cancel_order&email=1&order_id='.$row->order_id.$url_itemid),'document.adminForm_'.$row->order_id.'_cancel.submit();return false;','class="hikashop_order_cancel_button"'); ?>
<input type="hidden" name="Itemid" value="<?php echo $Itemid; ?>"/>
<input type="hidden" name="option" value="<?php echo HIKASHOP_COMPONENT; ?>" />
<input type="hidden" name="task" value="cancel_order" />
<input type="hidden" name="email" value="1" />
<input type="hidden" name="order_id" value="<?php echo $row->order_id; ?>" />
<input type="hidden" name="ctrl" value="<?php echo JRequest::getCmd('ctrl'); ?>" />
<input type="hidden" name="redirect_url" value="<?php echo hikashop_currentURL(); ?>" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
<?php }
I'm not so familiar, could you please tell me what I have to edit to let it work please?
Please Log in or Create an account to join the conversation.
11 years 3 months ago #204533
by nicolas
Replied by nicolas on topic Pay now button in order show (single order page)
Hi,
It's not that easy.
This code assumes that $this->cart, $row, $url_itemid, $this->payment, $this->payment_change, $orderUrl have been defined, either previously in the view, or in the corresponding function of the view.html.php file of the view (in components/com_hikashop/view/order/view.html.php)
And most of these variables are only defined for the listing, not for the show, so it's normal that it doesn't work on the show.
It's not that easy.
This code assumes that $this->cart, $row, $url_itemid, $this->payment, $this->payment_change, $orderUrl have been defined, either previously in the view, or in the corresponding function of the view.html.php file of the view (in components/com_hikashop/view/order/view.html.php)
And most of these variables are only defined for the listing, not for the show, so it's normal that it doesn't work on the show.
Please Log in or Create an account to join the conversation.
Time to create page: 0.174 seconds