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

Skin not showing up in layouts page after 5.3 upgrade

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 02-25-2017, 11:36 AM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Skin not showing up in layouts page after 5.3 upgrade

I just installed 5.3 and am trying to migrate my old 5.2 skin to it. I copied my module (including Main.php) into classes/XLite/Module/<devid>/<moduleid>. I also copied my skin into skins/<skinid>. This is how it was set up in 5.2. Then I re-deployed the store and activated my custom module.

But my theme is not showing up in the Admin page under Layout. All of the default themes are there, but I have no way of finding or selecting mine. What am I doing wrong?

The top of my Main.php looks like this (my theme is FeedSkin):

PHP Code:
<?php
// vim: set ts=4 sw=4 sts=4 et:

/**
 * Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
 * See https://www.x-cart.com/license-agreement.html for license details.
 */

namespace XLite\Module\BenLind\FeedSkin;

use \
XLite\Core\Layout;

/**
 * Development module that simplifies the process of implementing design changes
 *
 */
abstract class Main extends \XLite\Module\AModuleSkin
{ ... }

And my getSkins() method looks like this:

PHP Code:
public static function getSkins()
{
    return [
        \
XLite::CUSTOMER_INTERFACE => ['FeedSkin/customer'],
    ];

__________________
X-Cart version 5.2
Reply With Quote
  #2  
Old 02-26-2017, 10:57 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Skin not showing up in layouts page after 5.3 upgrade

Did you update the methods in Main.php that declare which X-Cart version your module is compatible with?
I guess your getMajorVersion() returns "5.2".
__________________
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
  #3  
Old 02-27-2017, 05:36 PM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Re: Skin not showing up in layouts page after 5.3 upgrade

I did. Here is my full file, with some method bodies removed:

PHP Code:
<?php
namespace XLite\Module\BenLind\FeedSkin;

use \
XLite\Core\Layout;

abstract class 
Main extends \XLite\Module\AModuleSkin
{

    public static function 
getAuthorName()
    {
        return 
'Ben Lind';
    }

    public static function 
getModuleName()
    {
        return 
'Feed skin';
    }

    public static function 
getMajorVersion()
    {
        return 
'5.3';
    }

    public static function 
getMinorVersion()
    {
        return 
'2';
    }

    public static function 
getBuildVersion()
    {
        return 
'2';
    }

    public static function 
getMinorRequiredCoreVersion()
    {
        return 
'2';
    }

    public static function 
getDescription()
    {
        ...
    }

    public static function 
showSettingsForm()
    {
        return 
false;
    }

    public static function 
getLayoutTypes()
    {
        return [
            
Layout::LAYOUT_GROUP_DEFAULT => Layout::getInstance()->getLayoutTypes(),
            
Layout::LAYOUT_GROUP_HOME => Layout::getInstance()->getLayoutTypes()
        ];
    }

    public static function 
getSkins()
    {
        return [
            \
XLite::CUSTOMER_INTERFACE => ['FeedSkin/customer'],
        ];
    }

    protected static function 
moveTemplatesInLists()
    {
        ...
    }

    protected static function 
moveClassesInLists()
    {
        ...
    }

    public static function 
getImageSizes()
    {
        return [
            \
XLite\Logic\ImageResize\Generator::MODEL_PRODUCT => [
                
'SBSmallThumbnail' => [100120],
                
'XSThumbnail' => [5870],
                
'MSThumbnail' => [7590],
            ],
        ];
    }

    public static function 
isModuleEnabled($name)
    {
        return \
XLite\Core\Database::getRepo('XLite\Model\Module')->isModuleEnabled($name);
    }

    public static function 
callInstallEvent()
    {
        
parent::callInstallEvent();

        \
XLite\Core\Database::getRepo('XLite\Model\Config')->createOption([
            
'category' => 'Layout',
            
'name' => 'layout_type_' . \XLite\Core\Layout::LAYOUT_GROUP_HOME,
            
'value' => \XLite\Core\Layout::LAYOUT_ONE_COLUMN,
        ]);
    }
}

Note, I copied a lot of this from the Crisp White skin in an attempt to make it show up. Crisp White shows up, but this does not.
__________________
X-Cart version 5.2
Reply With Quote
  #4  
Old 02-28-2017, 06:28 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Skin not showing up in layouts page after 5.3 upgrade

I believe you don't need most of the class methods.
Please refer to this article:
http://devs.x-cart.com/en/basics/skin_module.html

Also, please check if you see your class files copied to the var/run/classes/ directory.
Sometimes when you have a wrong file or classname, or when the namespace doesn't match the file path, class files are ignored during the re-deploy process. This might happen in your case.
__________________
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 02-28-2017, 07:50 PM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Re: Skin not showing up in layouts page after 5.3 upgrade

I probably don't need all of those methods. However, I would like to build my theme off of the crisp_white theme, not the "default" theme. How can I do that without just making a copy of the crisp white module and skin (which is what is not working)?
__________________
X-Cart version 5.2
Reply With Quote
  #6  
Old 02-28-2017, 09:49 PM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Skin not showing up in layouts page after 5.3 upgrade

To customise an existing theme you don't create a new theme. Instead, you enable the original theme and then "decorate" its classes and files by creating a custom module (not a theme module).

Please check this forum message (and the thread where it was posted):
https://forum.x-cart.com/showpost.php?p=400954
__________________
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

The following user thanks qualiteam for this useful post:
cherie (03-03-2017)
  #7  
Old 03-01-2017, 04:14 PM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Re: Skin not showing up in layouts page after 5.3 upgrade

Great, thanks. How do I do that with the default "Standard" theme then?
__________________
X-Cart version 5.2
Reply With Quote
  #8  
Old 03-01-2017, 04:36 PM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Re: Skin not showing up in layouts page after 5.3 upgrade

I figured it out. Something must have been wrong with my Main.php file, though I'm not sure exactly what. Maybe it was removing the `use \XLite\Core\Layout` line, or maybe it was just something weird happening with my redeployments (I have been getting "mysql server has gone away" errors). Either way, I removed everything from Main.php and only added back in the things that the docs instructed me to, and my theme's showing up in the layout page now.

Thank you for your help!
__________________
X-Cart version 5.2
Reply With Quote
  #9  
Old 03-01-2017, 05:31 PM
 
benlind benlind is offline
 

Member
  
Join Date: Feb 2016
Posts: 24
 

Default Re: Skin not showing up in layouts page after 5.3 upgrade

Actually, now my skin module (which I want to be based on the default skin) is not even being copied to var/run/classes/XLite/Module. I have my module in classes/XLite/Module/BenLind/FeedSkin/ (which contains Main.php). I have my skin files in skins/FeedSkin/customer. But my module is not copied to var, even if I delete var and redeploy the site.

Also, I had created a dummy "Foo" module to test bare-bones module creation. I subsequently deleted classes/XLite/Module/BenLind/Foo, but Foo is still showing up on the Modules admin page. I have clear all the caches I know of and redeployed the store multiple times, but it still shows up.

Is there something wrong with my database?
__________________
X-Cart version 5.2
Reply With Quote
  #10  
Old 03-03-2017, 04:25 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Skin not showing up in layouts page after 5.3 upgrade

First, try to enable the developer mode. Does this help?

Also, the list of installed modules refreshes after you redeploy your site. If you delete a module directory, or add a new one - it won't update the list until your redeploy it.

As for files not being copied to var/run/classes: usually it happens because of the namespace in your files not matching paths to these files.
__________________
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
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 01:02 AM.

   

 
X-Cart forums © 2001-2020