Undefined property: plgHikashoppaymentExample::$ur

  • Posts: 4
  • Thank you received: 0
8 years 4 months ago #245142

I am developing a payment method using the Example.zip files as guide. Everything works well until I uncommented the following two line:

$return_url = HIKASHOP_LIVE.'index.php?option=com_hikashop&ctrl=checkout&task=after_end&order_id='.$order_id.$this->url_itemid;

$this->app->redirect($return_url);

Then i get this message:

Notice: Undefined property: plgHikashoppaymentExample::$url_itemid in C:\Bitnami\wampstack-5.6.22-0\apache2\htdocs\Joomla_3.5.1\plugins\hikashoppayment\example\example.php on line 275

Notice: Undefined property: plgHikashoppaymentExample::$app in C:\Bitnami\wampstack-5.6.22-0\apache2\htdocs\Joomla_3.5.1\plugins\hikashoppayment\example\example.php on line 282

Fatal error: Call to a member function redirect() on null in C:\Bitnami\wampstack-5.6.22-0\apache2\htdocs\Joomla_3.5.1\plugins\hikashoppayment\example\example.php on line 282

How can I clear the error so that I can proceed with the development. Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 4 months ago #245143

Hi,

If you're not calling the parent functions in order to initialize the variables ; you won't have access to elements likes "$this->payment_params" or "$this->app".
Unfortunately, without knowing the code you wrote ; we are not able to gave you more hint on it.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
8 years 4 months ago #245191

Hello,
Thank you for the quick response. Attached is the file containing the code.

Thank you.

File Attachment:

File Name: example_no...well.txt
File Size:12 KB

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 4 months ago #245213

Hi,

Please see how the sample plugin is loading the order and how the payment params are loaded from the order object.
github.com/HikaShop/sample-payment-plugi...ter/example.php#L166
You need the 6 lines to do the same and initialize correctly all the variables of the plugins (his params, the $this->app, etc).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 0
8 years 4 months ago #245233

Thanks a million! Including those lines solved the problem.
Have a nice day.

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds
Powered by Kunena Forum