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

Have problem with product varient module
 
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 07-26-2017, 02:07 AM
 
ajeetsingh ajeetsingh is offline
 

Member
  
Join Date: Dec 2016
Posts: 28
 

Default Have problem with product varient module

Hello,

We have a module name pre-order for x-cart 5.3.3.1,
When i installed that module and after enabled i go to the product page at backend, then click on any product ad go to details page, There i find that A new tab "Preorder" is available. When i click on that tab then it's page are working but i have a problem that when i Click on "Product variant" Tab the it throw an error as below :

HTML Code:
ERROR: "Includes\ErrorHandler::FATAL_ERROR" (code 2) Call to a member function toArray() on null

and when i uninstalled preorder module that that "Product Variant" tab is working fine.


The code for the "Pre-order" module at path to call the preorder page is as below

classes/XLite/Module/Wevbkulsoftware/PreorderSales/Controller/Admin/Product.php

PHP Code:
/**
     * Page key
     */
    
const PAGE_VARI 'preorders';


public function 
getPages()
    {
        
$list parent::getPages();

        if (!
$this->isNew()) {
            
$list array_merge(
                
array_slice($list05),
                array(static::
PAGE_VARI => static::t('PreorderSales')),
                
array_slice($list5)
            );
        }

        return 
$list;
    }



protected function 
getPageTemplates()
    {
        
$list parent::getPageTemplates();

        if (!
$this->isNew()) {
            
$list array_merge(
                
array_slice($list0,5),
                array(static::
PAGE_VARI => 'modules/Webkulsoftware/PreorderSales/preorders/body.twig'),
                
array_slice($list5)
            );
        }

        return 
$list;
    } 


And code for the module "Product variant" at path below
classes/XLite/Module/XC/ProductVariants/Controller/Admin/Product.php

is

PHP Code:
/**
     * Page key
     */
    
const PAGE_VARIANTS 'variants';
/**
     * Get pages
     *
     * @return array
     */
    
public function getPages()
    {
        
$list parent::getPages();

        if (!
$this->isNew()) {
            
$list array_merge(
                
array_slice($list02),
                array(static::
PAGE_VARIANTS => static::t('Variants')),
                
array_slice($list2)
            );
        }

        return 
$list;
    }

    
/**
     * Get pages templates
     *
     * @return array
     */
    
protected function getPageTemplates()
    {
        
$list parent::getPageTemplates();

        if (!
$this->isNew()) {
            
$list array_merge(
                
array_slice($list02),
                array(static::
PAGE_VARIANTS => 'modules/XC/ProductVariants/variants/body.twig'),
                
array_slice($list2)
            );
        }

        return 
$list;
    } 

So, Please let me know the possible reason.
__________________
Ajeet Singh
Sr.Software Developer
Webkul Software Pvt. Ltd.
Reply With Quote
  #2  
Old 07-26-2017, 05:24 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,429
 

Default Re: Have problem with product varient module

Hi @ajeetsingh,

Can you show backtrace for this fatal error? It should specify the file and exact line where toArray() method is called on null instead of object.

Thank you.

Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #3  
Old 07-26-2017, 05:53 AM
 
ajeetsingh ajeetsingh is offline
 

Member
  
Join Date: Dec 2016
Posts: 28
 

Default Re: Have problem with product varient module

Hello @tony_sologubov

I will send you some screen shot where that problems occurs. Please check it.
Click image for larger version

Name:	variant_tab.png
Views:	34
Size:	130.2 KB
ID:	4969

Click image for larger version

Name:	preorder_tabs .png
Views:	31
Size:	135.2 KB
ID:	4970

Click image for larger version

Name:	Error.png
Views:	32
Size:	107.9 KB
ID:	4971
__________________
Ajeet Singh
Sr.Software Developer
Webkul Software Pvt. Ltd.
Reply With Quote
  #4  
Old 07-30-2017, 10:30 PM
 
ajeetsingh ajeetsingh is offline
 

Member
  
Join Date: Dec 2016
Posts: 28
 

Default Re: Have problem with product varient module

Hi @tony_sologubov ,

Can you please suggest me about my query. I am waiting for your response.

Thank You.
__________________
Ajeet Singh
Sr.Software Developer
Webkul Software Pvt. Ltd.
Reply With Quote
  #5  
Old 07-31-2017, 12:46 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Have problem with product varient module

Quote:
when i uninstalled preorder module that that "Product Variant" tab is working fine
Quote:
.../Wevbkulsoftware/PreorderSales/...

I'm not sure, but it may be a bug in PreoredSales module.
Did you contact the module author?
https://webkul.com/contacts/
__________________
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
  #6  
Old 07-31-2017, 10:30 PM
 
ajeetsingh ajeetsingh is offline
 

Member
  
Join Date: Dec 2016
Posts: 28
 

Default Re: Have problem with product varient module

Hi,

If the issue is from pre-order then can you please suggest me the reason of that issue. so that i will able to fix it.
__________________
Ajeet Singh
Sr.Software Developer
Webkul Software Pvt. Ltd.
Reply With Quote
  #7  
Old 08-01-2017, 02:38 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

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

Default Re: Have problem with product varient module

Ah. I apologize. I missed the fact that you are from Webkul.

Code:
ERROR: "Includes\ErrorHandler::FATAL_ERROR" (code 2) Call to a member function toArray() on null

This is not enough to guess why this may happen. Please check the log files in the var/log/ directory for the full text of the error message including the complete backtrace to the file and the line where it happens.
__________________
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
  #8  
Old 08-01-2017, 03:00 AM
 
ajeetsingh ajeetsingh is offline
 

Member
  
Join Date: Dec 2016
Posts: 28
 

Default Re: Have problem with product varient module

Hi @qualiteam,

Now i am sending you the files on path var/log/2017

Please check it.

decorator.log.2017-08-01.php

php_errors.log.2017-08-01.php

upgrade.log.2017-08-01.php

xlite.log.2017-08-01.php

Thank You.
__________________
Ajeet Singh
Sr.Software Developer
Webkul Software Pvt. Ltd.
Reply With Quote
  #9  
Old 08-03-2017, 05:46 AM
  tony_sologubov's Avatar 
tony_sologubov tony_sologubov is offline
 

X-Cart team
  
Join Date: Jan 2009
Posts: 2,429
 

Default Re: Have problem with product varient module

@ajeetsingh,

Judging by error messages in the log, there is a problem on 107 line in the classes/XLite/Module/Wevbkulsoftware/PreorderSales/Controller/Admin/Product.php file and I assume that the code you quoted earlier is correct:
Code:
/** * Page key */ const PAGE_VARI = 'preorders'; public function getPages() { $list = parent::getPages(); if (!$this->isNew()) { $list = array_merge( array_slice($list, 0, 5), array(static::PAGE_VARI => static::t('PreorderSales')), array_slice($list, 5) ); } return $list; } protected function getPageTemplates() { $list = parent::getPageTemplates(); if (!$this->isNew()) { $list = array_merge( array_slice($list, 0,5), array(static::PAGE_VARI => 'modules/Webkulsoftware/PreorderSales/preorders/body.twig'), array_slice($list, 5) ); } return $list; }

Could you please show the full code of that file?

Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker!
Know how to make X-Cart better? Suggest an idea!
Reply With Quote
  #10  
Old 08-03-2017, 06:06 AM
 
ajeetsingh ajeetsingh is offline
 

Member
  
Join Date: Dec 2016
Posts: 28
 

Default Re: Have problem with product varient module

Quote:
Originally Posted by tony_sologubov
@ajeetsingh,

Judging by error messages in the log, there is a problem on 107 line in the classes/XLite/Module/Wevbkulsoftware/PreorderSales/Controller/Admin/Product.php file and I assume that the code you quoted earlier is correct:
Code:
/** * Page key */ const PAGE_VARI = 'preorders'; public function getPages() { $list = parent::getPages(); if (!$this->isNew()) { $list = array_merge( array_slice($list, 0, 5), array(static::PAGE_VARI => static::t('PreorderSales')), array_slice($list, 5) ); } return $list; } protected function getPageTemplates() { $list = parent::getPageTemplates(); if (!$this->isNew()) { $list = array_merge( array_slice($list, 0,5), array(static::PAGE_VARI => 'modules/Webkulsoftware/PreorderSales/preorders/body.twig'), array_slice($list, 5) ); } return $list; }

Could you please show the full code of that file?

Tony


Hi @tony_sologubov,

I have send you the file please check the full code of that file.

product.php

Thank You for your reply.
__________________
Ajeet Singh
Sr.Software Developer
Webkul Software Pvt. Ltd.
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Modifying the design and features (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:10 AM.

   

 
X-Cart forums © 2001-2018