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

#   Next and Previous Buttons

##

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

Less More

- Posts: 54
- Thank you received: 0
-
-

11 years 3 months ago [\#209925](#209925) by [eileensemporium](/forum/user/37550-eileensemporium "View eileensemporium's Profile")  *[Next and Previous Buttons](/forum/35-orders-management/878450-next-and-previous-buttons#209925 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3  I would like to be able to add Next and Previous Order links when viewing an order so I don’t have to hit back then click on the next order number to view the full details of the orders  Is this possible")* was created by *[eileensemporium](/forum/user/37550-eileensemporium "View eileensemporium's Profile")*

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3

I would like to be able to add Next and Previous Order links when viewing an order so I don’t have to hit back then click on the next order number to view the full details of the orders

Is this possible

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 3 months ago [\#209926](#209926) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Next and Previous Buttons](/forum/35-orders-management/878450-next-and-previous-buttons#209926 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3  I would like to be able to add Next and Previous Order links when viewing an order so I don’t have to hit back then click on the next order number to view the full details of the orders  Is this possible")*

Hi,

Using a view override and some PHP code ; yes it's possible.
The idea is to get the previous and the next order ID of the user ; so it requires to perform two SQL queries in order to catch them (or to perform just one query and them filter the return data in PHP).

Then, thanks to the two "order_id" (or less, if you're seeing the last or the first order.. Or if the customer just have one single order) ; you can create the buttons with the links.

Performing the SQL query will be like Code:

$db = JFactory::getDBO(); $query = 'SELECT order_id FROM ' . hikashop_table('order') . ' WHERE order_id &lt; ' . (int)$this-&gt;element-&gt;order_id . ' AND order_user_id = ' . (int)$this-&gt;element-&gt;order_user_id . ' AND order_type = ' . $db-&gt;Quote('sale'); $db-&gt;setQuery($query, 0, 1); $previous_order_id = (int)$db-&gt;loadResult();

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 54
- Thank you received: 0
-
-

11 years 3 months ago [\#209987](#209987) by [eileensemporium](/forum/user/37550-eileensemporium "View eileensemporium's Profile")  Replied by *[eileensemporium](/forum/user/37550-eileensemporium "View eileensemporium's Profile")* on topic *[Next and Previous Buttons](/forum/35-orders-management/878450-next-and-previous-buttons#209987 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3  I would like to be able to add Next and Previous Order links when viewing an order so I don’t have to hit back then click on the next order number to view the full details of the orders  Is this possible")*

I really meant in the admin pages eg

administrator/index.php?option=com_hikashop&amp;ctrl=order&amp;task=edit&amp;cid[]=15329

Which file/view would be best to put the override in

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 3 months ago [\#209989](#209989) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Next and Previous Buttons](/forum/35-orders-management/878450-next-and-previous-buttons#209989 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3  I would like to be able to add Next and Previous Order links when viewing an order so I don’t have to hit back then click on the next order number to view the full details of the orders  Is this possible")*

Hi,

Thanks fort he clarification ; next time please provide directly all required information about your needs.

So, you have to override the "order / show" view of your backend template.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzM1LW9yZGVycy1tYW5hZ2VtZW50Lzg3ODQ1MC1uZXh0LWFuZC1wcmV2aW91cy1idXR0b25zP3RtcGw9bWFya2Rvd24=) 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.059 seconds

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