[Skip to main content](#vessel-content)

#   Pay now button in order show (single order page)

##

- **[simonev](/forum/user/30589-simonev "View simonev's Profile")**
- [![simonev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30589-simonev "View simonev's Profile") Topic Author
- [ Offline](/forum/user/30589-simonev)

Less More

- Posts: 59
- Thank you received: 0
-
-

11 years 5 months ago [\#204509](#204509) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  *[Pay now button in order show (single order page)](/forum/35-orders-management/877468-pay-now-button-in-order-show-single-order-page#204509 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi, I would like to insert the &quot;pay now&quot; 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?")* was created by *[simonev](/forum/user/30589-simonev "View simonev's Profile")*

-- 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:
Code:

&lt;?php if(!empty($row-&gt;show_payment_button) &amp;&amp; bccomp($row-&gt;order_full_price,0,5)&gt;0){ ?&gt; &lt;form action="&lt;?php echo $orderUrl; ?&gt;" method="post" name="adminForm_&lt;?php echo $row-&gt;order_id; ?&gt;"&gt; &lt;?php if($this-&gt;payment_change){ $text = JText::_('PAY_NOW'); $this-&gt;payment-&gt;order = $row; $this-&gt;payment-&gt;preload(false); echo $this-&gt;payment-&gt;display('new_payment_method',$row-&gt;order_payment_method,$row-&gt;order_payment_id,false); }else{ $text = JText::sprintf('PAY_WITH_X',$this-&gt;payment-&gt;getName($row-&gt;order_payment_method,$row-&gt;order_payment_id)); } $url = hikashop_completeLink('order&amp;task=pay&amp;order_id='.$row-&gt;order_id.$url_itemid); if($config-&gt;get('force_ssl',0) &amp;&amp; strpos('https://',$url) === false) { $url = str_replace('http://','https://',HIKASHOP_LIVE) . 'index.php?option=com_hikashop&amp;ctrl=order&amp;task=pay&amp;order_id='.$row-&gt;order_id; } echo $this-&gt;cart-&gt;displayButton($text,'pay',$this-&gt;params,$url,'document.adminForm_'.$row-&gt;order_id.'.submit();return false;','class="hikashop_order_pay_button"'); ?&gt; &lt;input type="hidden" name="Itemid" value="&lt;?php echo $Itemid; ?&gt;"/&gt; &lt;input type="hidden" name="option" value="&lt;?php echo HIKASHOP_COMPONENT; ?&gt;" /&gt; &lt;input type="hidden" name="task" value="pay" /&gt; &lt;input type="hidden" name="order_id" value="&lt;?php echo $row-&gt;order_id; ?&gt;" /&gt; &lt;input type="hidden" name="ctrl" value="&lt;?php echo JRequest::getCmd('ctrl'); ?&gt;" /&gt; &lt;?php echo JHTML::_( 'form.token' ); ?&gt; &lt;/form&gt; &lt;?php } if( isset($row-&gt;show_cancel_button) &amp;&amp; $row-&gt;show_cancel_button ) {?&gt; &lt;form action="&lt;?php echo hikashop_completeLink('order'.$url_itemid); ?&gt;" method="post" name="adminForm_&lt;?php echo $row-&gt;order_id; ?&gt;_cancel"&gt; &lt;?php $text = JText::_('CANCEL_ORDER'); echo $this-&gt;cart-&gt;displayButton($text,'cancel_order',$this-&gt;params,hikashop_completeLink('order&amp;task=cancel_order&amp;email=1&amp;order_id='.$row-&gt;order_id.$url_itemid),'document.adminForm_'.$row-&gt;order_id.'_cancel.submit();return false;','class="hikashop_order_cancel_button"'); ?&gt; &lt;input type="hidden" name="Itemid" value="&lt;?php echo $Itemid; ?&gt;"/&gt; &lt;input type="hidden" name="option" value="&lt;?php echo HIKASHOP_COMPONENT; ?&gt;" /&gt; &lt;input type="hidden" name="task" value="cancel_order" /&gt; &lt;input type="hidden" name="email" value="1" /&gt; &lt;input type="hidden" name="order_id" value="&lt;?php echo $row-&gt;order_id; ?&gt;" /&gt; &lt;input type="hidden" name="ctrl" value="&lt;?php echo JRequest::getCmd('ctrl'); ?&gt;" /&gt; &lt;input type="hidden" name="redirect_url" value="&lt;?php echo hikashop_currentURL(); ?&gt;" /&gt; &lt;?php echo JHTML::_( 'form.token' ); ?&gt; &lt;/form&gt; &lt;?php }

I'm not so familiar, could you please tell me what I have to edit to let it work please?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg3NzQ2OC1wYXktbm93LWJ1dHRvbi1pbi1vcmRlci1zaG93LXNpbmdsZS1vcmRlci1wYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

11 years 5 months ago [\#204533](#204533) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Pay now button in order show (single order page)](/forum/35-orders-management/877468-pay-now-button-in-order-show-single-order-page#204533 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.1  Hi, I would like to insert the &quot;pay now&quot; 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?")*

Hi,

It's not that easy.
This code assumes that $this-&gt;cart, $row, $url_itemid, $this-&gt;payment, $this-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg3NzQ2OC1wYXktbm93LWJ1dHRvbi1pbi1vcmRlci1zaG93LXNpbmdsZS1vcmRlci1wYWdlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.047 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
