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

Following the "Create a module" Tutorial (for devs)

 
Reply
   X-Cart forums > X-Cart 5 > General questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 01-10-2019, 01:20 PM
 
greevesh greevesh is offline
 

Newbie
  
Join Date: Jan 2019
Posts: 2
 

Default Following the "Create a module" Tutorial (for devs)

I'm stuck on step 5 of this guide. My module won't show up when I attempt to "redeploy" the store. In fact, nothing actually happens. Has this happened to anybody else and does anyone know how to resolve this issue?

Thanks in advance
__________________
HGreeves
Reply With Quote
  #2  
Old 01-11-2019, 04:22 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Following the "Create a module" Tutorial (for devs)

Hello. I have created a number of modules based on that article, so it's safe to say the example is correct there.

We will need to see the actual code to say why it isn't working.
Thank you.
__________________
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 01-11-2019, 01:50 PM
 
greevesh greevesh is offline
 

Newbie
  
Join Date: Jan 2019
Posts: 2
 

Default Re: Following the "Create a module" Tutorial (for devs)

Not sure why I didn't hand out the code in the first place

PHP Code:
<?php

namespace XLite\Module\GreevesH\FirstModule;

abstract class 
Main extends \XLite\Module\AModule
{
    
/**
     * Harrison Greeves
     *
     * @return string
     */

    // static methods can be used before instantiating the object it resides in
    
public static function getAuthorName()
    {
        return 
'Harrison Greeves';
    }

    
/**
     * FirstModule
     *
     * @return string
     */
    
public static function getModuleName()
    {
        return 
'FirstModule';
    }

    
/**
     * Get module major version
     *
     * @return string
     */
    
public static function getMajorVersion()
    {
        return 
'5.3';
    }

    
/**
     * Module version
     *
     * @return string
     */
    
public static function getMinorVersion()
    {
        return 
0;
    }

    
/**
     * Module description
     *
     * @return string
     */
    
public static function getDescription()
    {
        return 
'This is my first ever module written with X-Cart.';
    }
}
__________________
HGreeves
Reply With Quote
  #4  
Old 01-13-2019, 01:35 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Following the "Create a module" Tutorial (for devs)

Thank you for the code.
I don't know why it isn't working for you, but when I added it to my X-Cart installation, it worked just fine. The module shows up in the list of addons
Screenshot attached.
Maybe you are inserting it into a wrong folder?
The path must exactly match the namespace, so you should be putting this into <X-Cart>/classes/XLite/Module/GreevesH/FirstModule/.
Attached Thumbnails
Click image for larger version

Name:	greeves.png
Views:	203
Size:	45.1 KB
ID:	5281  
__________________
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 > General questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:39 AM.

   

 
X-Cart forums © 2001-2020