Post by k.gabi » Sat Aug 11, 2018 11:41 pm

Hello,

I'm sorry, but I speak a little English.

OC version: 3.0.2.0

I know add (when install) and delete (when uninstall) events with my extension, but my menus function is not working. Why?

~/admin/controller/extension/payment/hardpay.php

Code: Select all

<?php

    class ControllerExtensionPaymentHardPay extends Controller {

        private $error = array ();
        
        public function install () {

            $this -> load -> model ( 'setting/event' );
            $this -> model_setting_event -> addEvent ( 'hardpay', 'admin/view/common/column_left/before', 'extension/payment/HardPay/menus' );

        }

        public function uninstall () {

            $this -> load -> model ( 'setting/event' );
            $this -> model_setting_event -> deleteEventByCode ( 'hardpay' );

        }

        public function menus ( $eventRoute, &$data ) {

            $data [ 'menus' ] [] = array (

                'id' => 'menu-hardpay',
                'icon' => 'fa fa-shopping-cart fa-fw',
                'name' => 'HardPay',
                'href' => $this -> url -> link ( 'extension/payment/HardPay', 'token=' . $this -> session -> data [ 'token' ], TRUE ),
                'children' => array ()

            );

        }

    }
Please help me. I would like only a one new button in left (~/admin/controller/common/column_left.php): Dashboard, etc. Why not work? Thanks.

Newbie

Posts

Joined
Wed Aug 08, 2018 9:04 am

Post by JNeuhoff » Thu Jan 31, 2019 12:51 am

Try and replace the

Code: Select all

'href' => $this -> url -> link ( 'extension/payment/HardPay', 'token=' . $this -> session -> data [ 'token' ], TRUE ),
with this:

Code: Select all

'href' => $this -> url -> link ( 'extension/payment/hardpay', 'token=' . $this -> session -> data [ 'token' ], TRUE ),

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by xxvirusxx » Fri Feb 01, 2019 12:50 am

3.x use user_token instead of token

Upgrade Service | OC 2.3.0.2 PHP 8 | My Custom OC 3.0.3.8 | Buy me a beer


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by JNeuhoff » Sat Feb 02, 2019 11:38 pm

xxvirusxx wrote:
Fri Feb 01, 2019 12:50 am
3.x use user_token instead of token
Well spotted, so it should be:

Code: Select all

'href' => $this -> url -> link ( 'extension/payment/hardpay', 'user_token=' . $this -> session -> data [ user_'token' ], TRUE ),

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member
Online

Posts

Joined
Wed Dec 05, 2007 3:38 am

Who is online

Users browsing this forum: No registered users and 24 guests