WordPress.org

Ready to get started?Download WordPress

Forums

PrestaShop Integration
[resolved] Issue with Widget "Prestashop integration module" (4 posts)

  1. Prestance Design
    Member
    Posted 1 year ago #

    Hi Francois,

    I noticed an issue with the widget "Prestashop integration module".

    The php error :
    Notice: Undefined property: PrestaShopIntegration::$hooks_names in prestashop-integration.php on line 427.

    I think it's because $hook_name is static parameter, so I've change the function psHooksNames from:

    function psHooksNames( $hook = null ) {
    			if ( !$this->hooks_names )
    				$this->hooks_names = ( version_compare(_PS_VERSION_, '1.5', '>=') ? array(
    					'HOOK_TOP' => 'displayTop',
    					'HOOK_LEFT_COLUMN' => 'displayLeftColumn',
    					'HOOK_RIGHT_COLUMN' => 'displayRightColumn',
    					'HOOK_FOOTER' => 'displayFooter'
    				) : array(
    					'HOOK_TOP' => 'top',
    					'HOOK_LEFT_COLUMN' => 'leftColumn',
    					'HOOK_RIGHT_COLUMN' => 'rightColumn',
    					'HOOK_FOOTER' => 'footer'
    				) );
    			if ( $hook )
    				return $this->hooks_names[$hook];
    			else
    				return $this->hooks_names;
    		}

    like that

    function psHooksNames( $hook = null ) {
    			if ( !self::$hooks_names )
    				self::$hooks_names = ( version_compare(_PS_VERSION_, '1.5', '>=') ? array(
    					'HOOK_TOP' => 'displayTop',
    					'HOOK_LEFT_COLUMN' => 'displayLeftColumn',
    					'HOOK_RIGHT_COLUMN' => 'displayRightColumn',
    					'HOOK_FOOTER' => 'displayFooter'
    				) : array(
    					'HOOK_TOP' => 'top',
    					'HOOK_LEFT_COLUMN' => 'leftColumn',
    					'HOOK_RIGHT_COLUMN' => 'rightColumn',
    					'HOOK_FOOTER' => 'footer'
    				) );
    			if ( $hook )
    				return self::$hooks_names[$hook];
    			else
    				return self::$hooks_names;
    		}

    after that I have a warning because Module::hooExec() is deprecated in Prestashop 1.5.
    So I've changed in prestashop-integration-module.php on line 45
    Module::hookExec()
    by
    Hook::exec()

    And voilà, it work.

    http://wordpress.org/extend/plugins/prestashop-integration/

  2. aytechnet
    Member
    Plugin Author

    Posted 1 year ago #

    Hello Prestance Design,
    I used your code to provide a fix, thanks. It is uploaded in 0.8.1.
    François.

  3. Prestance Design
    Member
    Posted 1 year ago #

    Thank you for your responsiveness François.

    I guess, that we can ignore the deprecated warning of the function Module::hookExec(), isn't it ?

  4. aytechnet
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Prestance Design,
    I made an error in the 0.8.1 as It has been fixed on my test environment but I suspect not having taken the change back to the git environment, the next release will get the changes to fix the warning. I made another error in the changelog : the fix for the redirection is not in the plugin but in PrestaShop itself... (I mentionned the fix in the changelog but in fact the fix is explained in FAQ).
    François.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.