Next and Previous Buttons

  • Posts: 54
  • Thank you received: 0
9 years 3 months ago #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

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #209926

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

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

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 54
  • Thank you received: 0
9 years 3 months ago #209987

I really meant in the admin pages eg

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

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

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 3 months ago #209989

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 & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

Time to create page: 0.040 seconds
Powered by Kunena Forum