Jump to content

SOLVED: XCDaily Deals


helldog2004
 Share

Recommended Posts

Hi all,

 

currently I am trying to use the module XCDaily Deals, which I am unable to install correctly.

And this is "I think" language related.

 

After uploading the module and trying to install it in the back-end the following error pops-up, and as the error is way to big to copy and just paste I will show a screenshot to better preview what is going on in here.

 

1.png

 

As you can see I am showing the basic error and the error created by the file xcdailydeals.php.

 

Now, whenever I am refreshing the page a new admin button has been created (which holds all possible button solutions available in PrestaShop as it does not know which buttons should be placed below this one), but also the modules section tells me the module still hasn't been installed.

As previewed below.

 

2.png

 

The code throwing me an error from this module is:

public function install() {
        Db::getInstance()->Execute('CREATE TABLE `'._DB_PREFIX_.'xc_daily_deal` (
                                     `id_xc_daily_deal` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
                                     `id_shop` INT(10) UNSIGNED NOT NULL,
                                     `id_product` INT(10) UNSIGNED NOT NULL,
                                     `launch_date` DATE NOT NULL,
                                     `disable_product_after` TINYINT(4) NOT NULL,
                                     `disabled` TINYINT(4) NOT NULL DEFAULT \'0\',
                                     `quantity` INT(10) UNSIGNED NOT NULL,
                                     `duration` INT(10) UNSIGNED NOT NULL DEFAULT \'1\',
                                     `active` TINYINT(4) NOT NULL,
                                     PRIMARY KEY (`id_xc_daily_deal`),
                                     INDEX `shop` (`id_shop`),
                                     INDEX `product` (`id_product`),
                                     INDEX `product_shop_active` (`active`, `id_product`, `id_shop`),
                                     INDEX `active` (`active`),
                                     INDEX `disable_disabled` (`disabled`, `disable_product_after`)
                                    )
                                    DEFAULT CHARSET=utf8;
                                    ENGINE=InnoDB
                                    AUTO_INCREMENT=100;'         
                                  ); 
		    
        $this -> installModuleTab('AdminXC', "X-Coding IT Studio", 0);
        $idTab = Tab::getIdFromClassName("AdminXC");
        
        if (parent::install() == false 
            OR !$this -> registerHook('leftColumn')
            OR !$this -> registerHook('displayHome')
            OR !$this -> registerHook('displayFooterProduct')
			OR !$this -> registerHook('displayHeader')
            OR !$this -> installModuleTab("AdminXCDailyDeals", "Daily deals", $idTab))
            return false;
            
            //copy class file to proper catalog
        if(!copy(_PS_MODULE_DIR_ . $this -> name.DIRECTORY_SEPARATOR."override".DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."XCDailyDeal.php", _PS_MODULE_DIR_.DIRECTORY_SEPARATOR."..".DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."XCDailyDeal.php"))
        {
            return false;
        }    
        
        return true;
    }

The errors are being produced by lines 52, 53 and 60.

Whenever I am removing them by using the //, the install is going succesful, but then again, I won't have any admin buttons to control and create daily deals on the front-end of the website.

 

Thanks everyone for helping me outta here :)

Edited by helldog2004 (see edit history)

Share this post


Link to post
Share on other sites

Also, for your information, I am using PrestaShop version 1.5.6.2.

 

And after removing the lines 52, 53 and 60 installing the module goes well, but as I said above, without tab in back-end.

Also the tables are created in MySQL without any problems, but ofcourse, without any data because of not being able to edit configuration.

Is there a way I can figure out the link to the configuration of this module? So I can create a tab manually?

 

Thanks for the help.

Share this post


Link to post
Share on other sites

UPDATE:

 

I altered the following code:

$this -> installModuleTab('AdminXC', "X-Coding IT Studio", 0);
        $idTab = Tab::getIdFromClassName("AdminXC");
        
        if (parent::install() == false 
            OR !$this -> registerHook('leftColumn')
            OR !$this -> registerHook('displayHome')
            OR !$this -> registerHook('displayFooterProduct')
			OR !$this -> registerHook('displayHeader')
            OR !$this -> installModuleTab("AdminXCDailyDeals", "Daily deals", $idTab))
            return false;

to something like:

$this -> installModuleTab('AdminXCDailyDeals', array(8=>'Daily deals'), 0);
        $idTab = Tab::getIdFromClassName("AdminXCDailyDeals");
        
        if (parent::install() == false 
            OR !$this -> registerHook('leftColumn')
            OR !$this -> registerHook('displayHome')
            OR !$this -> registerHook('displayFooterProduct')
			OR !$this -> registerHook('displayHeader')
            OR !$this -> installModuleTab('AdminXCDailyDeals', array(8=>'Daily deals'), $idTab))
            return false;

of which the "8" is the language number Dutch in PrestaShop website.

This does do install the module with the admin tab, but now it seems that the page where I can configure the module is not working at all (white page).

Haven't done error reporting yet, will do this as soon as I have the time to do so and report it here in the forum.

Share this post


Link to post
Share on other sites

Awesome, I see everyone is reading the post and no-one is trying to help.

Anyway, the module is working now by adding the above mentioned codes. This seems to solve the problem so far.

 

I am going to try this and see if anyone knows the answer to this problem, but I guess no-one is going to answer it anyway.

Whenever I installed the module and configured it in the back-end (also edited a load of css coding to make things fit in the website) the attributes section

on the product page is not working anymore. What might be the problem causing this?

 

You can take a look at a page like this: https://hippetafels.nl/nl/overzicht/33-betonlook-mdf-6

The colours on the right side should also edit the image to the proper color. Also the sizes drop-down menu should edit the price of the table.

This does work if I disable the daily deal module.

 

Would be awesome if someone had the same issue or someone who knows how to solve this issue.

Cheers.

Edited by helldog2004 (see edit history)

Share this post


Link to post
Share on other sites

Well last update:

 

I figured one of the javascript files from the module is interfering with my website. Well, only on the product view page.

I don't need the javascript file on my product pages. Is there a way I can block this javascript from my product view pages?

 

Or is there a way I can insert this Javascript only in the homepage/index of the website?

If so, then I guess, the module is working at last.

Thanks for helping.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More