How eliminate the display options and sorting tabs in product pages
Hi
I am trying to get rid of the sorting menu options, and the display menu options (grid, table, list) in product pages. Also I would want to eliminate the pagination. I am using this code but I can't get it to work. PHP Code:
Anyone knows what may be wrong? Thanks |
Re: How eliminate the display options and sorting tabs in product pages
Hi juancho!
1) You should decorate the \XLite\View\ItemsList\Product\Customer\Category\AC ategory class instead of \XLite\View\ItemsList\Product\Customer\ACustomer, because \XLite\View\ItemsList\Product\Customer\ACustomer class is for more widgets than just displaying products in central area. 2) PHP Code:
This code is correct in order to disable pagination. 3) PHP Code:
This code is almost correct. Instead of PHP Code:
PHP Code:
And it will work out. The corrected mod is here https://dl.dropboxusercontent.com/u/23858825/MyID-MyModule-v5_1_0.tar |
Re: How eliminate the display options and sorting tabs in product pages
Hi Tony and many thanks.
It works awesome in category pages. However, in "Coming soon", "New arrivals" and "Sale" pages the display menu is still visible. Do you know how can I fix it? |
Re: How eliminate the display options and sorting tabs in product pages
Since the 'view modes' selector is already disabled there and you need only to define another page class (infinity), you can decorate the \XLite\Module\CDev\ProductAdvisor\View\AComingSoon class.
Please, let me know if it works for you. |
Re: How eliminate the display options and sorting tabs in product pages
Hi Tony,
It did work as you suggested. Thanks! I have a general question. What is the best way to "decorate" a class? What I am doing is using the methods removeClassFromList to remove the class that I want to decorate, and addClassToList to add my version of the class. Is this the correct approach? Seems a little bit awkward. Thanks again |
Re: How eliminate the display options and sorting tabs in product pages
Quote:
Well, you should just decorate the class as described here: http://kb.x-cart.com/display/XDD/Step+3+-+applying+logic+changes If we are talking about changing viewer classes, then you just need to decorate the class in your module and the changes will be applied after store re-deployment without having to call removeClassFromList() and addClassToList() methods. |
Re: How eliminate the display options and sorting tabs in product pages
Hi Tony,
thanks, here I am again, trying to make this run. ok this is my whole code. It crashes with this message: "Error (code: 1): Call to a member function setValue() on a non-object" PHP Code:
What I am trying to do is get rid of the display menu but maintaining the sort menu. what it's wrong? Thanks |
Re: How eliminate the display options and sorting tabs in product pages
An addition to my previous email:
when I run just this code: PHP Code:
both, the display and sort menu are visible but when you try to use them by changing to a different option then no product at all is displayed. |
Re: How eliminate the display options and sorting tabs in product pages
Not sure why it does not work for you, because it work perfectly for me:
http://awesomescreenshot.com/0854235ua8 What I have done is I enabled Custom Skin module and then put View/ProductsOnHomePage.php file inside it with this code: PHP Code:
In order to debug the problem, you need to check that you have not decorated the \XLite\View\ItemsList\Product\Customer\Category\AC ategory class anywhere else. If you did, you might have unsetted $this->widgetParams[self::PARAM_SHOW_DISPLAY_MODE_SELECTOR] param there and it causes the fatal error. |
Re: How eliminate the display options and sorting tabs in product pages
Hi Tony,
thanks for your previous message. Have you tried to used the sorting tabs? for instance, have you tried to click on "newest first" or "price" because, in my case the sorting options are also displayed correctly, but when I try to use a different sorting option, such as "price", is when it crashes and does not display any product. |
All times are GMT -8. The time now is 01:17 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.