Support » Plugin: PrestaShop Integration » Issue with Widget "Prestashop integration module"

  • Resolved Prestance Design

    (@prestance-design)


    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/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author aytechnet

    (@aytechnet)

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

    Thank you for your responsiveness François.

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

    Plugin Author aytechnet

    (@aytechnet)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Issue with Widget "Prestashop integration module"’ is closed to new replies.