| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
How eliminate the display options and sorting tabs in product pages | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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
__________________
X-Cart Business 5.0.12 |
|||||||
#2
|
|||||||||
|
|||||||||
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
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
#3
|
|||||||
|
|||||||
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?
__________________
X-Cart Business 5.0.12 |
|||||||
#4
|
|||||||||
|
|||||||||
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.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
#5
|
|||||||
|
|||||||
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
__________________
X-Cart Business 5.0.12 |
|||||||
#6
|
|||||||||
|
|||||||||
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.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#7
|
|||||||
|
|||||||
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
__________________
X-Cart Business 5.0.12 |
|||||||
#8
|
|||||||
|
|||||||
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.
__________________
X-Cart Business 5.0.12 |
|||||||
#9
|
|||||||||
|
|||||||||
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.
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
#10
|
|||||||
|
|||||||
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.
__________________
X-Cart Business 5.0.12 |
|||||||
|
|||
X-Cart forums © 2001-2020
|