Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

New Arrivals - Stop from listing on Static Pages

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-20-2016, 03:22 PM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default New Arrivals - Stop from listing on Category Pages

How can I stop the new arrivals from listing on Category pages? I still want the module to work, but listing on Category pages is throwing off some SEO stuff.
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #2  
Old 07-25-2016, 03:28 AM
  razortw's Avatar 
razortw razortw is offline
 

X-Cart team
  
Join Date: Feb 2015
Posts: 807
 

Default Re: New Arrivals - Stop from listing on Static Pages

I don't see a New Arrivals block on any of your static pages.
Also I checked on my stock X-Cart 5.2.15 and it appears that New Arrivals do not appear on static pages by default.
__________________
Best regards,
Igor Pudovkin
X-Cart hosting team
Reply With Quote
  #3  
Old 07-25-2016, 03:56 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: New Arrivals - Stop from listing on Static Pages

Well apparently I screwed this up. The SEO guy was sending me the link for an empty category. I thought it was a Static page. Either way, how can I remove that bit of code from the Category pages?
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote
  #4  
Old 07-27-2016, 04:19 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default Re: New Arrivals - Stop from listing on Static Pages

There is no setting to configure it, but you can tweak the visibility of the block from a custom module.

You should "decorate" the getAllowedTargets() method of \XLite\Module\CDev\ProductAdvisor\View\NewArrivals class and make it always remove "category" from the parent's result.

I.e. it should be something like this:
PHP Code:
namespace XLite\Module\YOUR_DEV_ID\YOUR_MOD_ID\View;

class 
NewArrivals extends \XLite\Module\CDev\ProductAdvisor\View\NewArrivals implements \XLite\Base\IDecorator
{
    
/**
     * Return list of targets allowed for this widget
     *
     * @return array
     */
    
public static function getAllowedTargets()
    {
        
$result = array();
        foreach (
parent::getAllowedTargets() as $target) {
            if (
$target !== 'category') {
                
$result[] = $target;
            }
        }
        return 
$result;
    }


You can find the documentation on creating custom modules here:
http://kb.x-cart.com/display/XDD/Step+1+-+creating+simplest+module
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions
Reply With Quote
  #5  
Old 10-23-2016, 08:05 AM
 
minfinger minfinger is offline
 

X-Adept
  
Join Date: Apr 2009
Posts: 678
 

Default Re: New Arrivals - Stop from listing on Static Pages

This module worked great. Thank you!
__________________
X-Cart 4.3
Joomla
Among other things
Reply With Quote

The following user thanks minfinger for this useful post:
qualiteam (10-27-2016)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:44 PM.

   

 
X-Cart forums © 2001-2020