- Posts: 36
- Thank you received: 0
Bug in pagination php?
12 years 4 months ago #156368
by svanschu
Bug in pagination php? was created by svanschu
-- url of the page with the problem -- :
mywebsite.com/mypage
-- HikaShop version -- : 2.3
-- Joomla version -- : 3.2.3
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message
I just wanted to override the pagination.php which is supported since 2.1. I wondered why the pagination_list_footer didn't get called. I found this code in pagination.php which should prevent the override if you are in admin interface, if I understand it right.
Now I'm on frontend and because of the ! the pagination_list_footer would never be called. At my current understanding the code should look like this.
Am I wrong?
-- HikaShop version -- : 2.3
-- Joomla version -- : 3.2.3
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message
I just wanted to override the pagination.php which is supported since 2.1. I wondered why the pagination_list_footer didn't get called. I found this code in pagination.php which should prevent the override if you are in admin interface, if I understand it right.
Code:
function getListFooter($minimum=20){
....
if(!$app->isAdmin())
return $this->_list_footer($list);
...
Now I'm on frontend and because of the ! the pagination_list_footer would never be called. At my current understanding the code should look like this.
Code:
function getListFooter($minimum=20){
....
if($app->isAdmin())
return $this->_list_footer($list);
...
Am I wrong?
Please Log in or Create an account to join the conversation.
12 years 4 months ago #156403
by nicolas
Replied by nicolas on topic Bug in pagination php?
No, it's not a bug. We purposely not allow the override to avoid issues with the pagination of the template which can sometimes create problems with HikaShop.
So you could remove these two lines to allow the override on the frontend, but it might not work properly with some templates.
So you could remove these two lines to allow the override on the frontend, but it might not work properly with some templates.
Please Log in or Create an account to join the conversation.
12 years 4 months ago #156475
by svanschu
Replied by svanschu on topic Bug in pagination php?
I'm writing my own template based on blank template. What kind of issues you mean?
Then also this lines (32 pagination.php) need to be removed
but then I end at a problem I wrote in another topic. www.hikashop.com/support/forum/developme...gination-overri.html
Then also this lines (32 pagination.php) need to be removed
Code:
if(HIKASHOP_J30 && $app->isAdmin())
but then I end at a problem I wrote in another topic. www.hikashop.com/support/forum/developme...gination-overri.html
Please Log in or Create an account to join the conversation.
12 years 4 months ago #156541
by Jerome
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.
Replied by Jerome on topic Bug in pagination php?
Hi,
If you want to override the items in the backend too, yes.
Do not remove the line but use instead
Regards,
If you want to override the items in the backend too, yes.
Do not remove the line but use instead
Code:
if(HIKASHOP_J30)
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.
12 years 4 months ago #156588
by svanschu
Replied by svanschu on topic Bug in pagination php?
In this special case the frontend would not be overriden with app->isAdmin()
Please Log in or Create an account to join the conversation.
12 years 4 months ago #156658
by nicolas
Replied by nicolas on topic Bug in pagination php?
What we're saying basically is that templates made for Joomla and which override the joomla pagination for example don't expect to have to handle the $this->hikaSuffix and $this->form variables. So we can't allow the override on the frontend by default because it would break with most templates.
What I would recommend to do is to create a file templates/YOUR_TEMPLATE/html/com_hikashop/administrator/helpers/pagination.override.php
which would first include_once our helper.pagination file and then implement a class hikashopPaginationHelperOverride extending our hikashopPaginationHelper class so that you can redefine what you want easily in the pagination of HikaShop in your template.
That way, you have the total control on what to do and what to change in the code of the HikaShop pagination.
What I would recommend to do is to create a file templates/YOUR_TEMPLATE/html/com_hikashop/administrator/helpers/pagination.override.php
which would first include_once our helper.pagination file and then implement a class hikashopPaginationHelperOverride extending our hikashopPaginationHelper class so that you can redefine what you want easily in the pagination of HikaShop in your template.
That way, you have the total control on what to do and what to change in the code of the HikaShop pagination.
Please Log in or Create an account to join the conversation.
12 years 3 months ago #159739
by svanschu
Replied by svanschu on topic Bug in pagination php?
Thx for the hint. I've done the most stuff now by str_replace.
only the this->admin I mentioned in the first post I changed now in the hika pagination
only the this->admin I mentioned in the first post I changed now in the hika pagination
Please Log in or Create an account to join the conversation.
Time to create page: 0.193 seconds