- Posts: 4
- Thank you received: 0
Undefined property: plgHikashoppaymentExample::$ur
10 years 2 months ago #245142
by oby
Undefined property: plgHikashoppaymentExample::$ur was created by oby
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
$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.
10 years 2 months ago #245143
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Undefined property: plgHikashoppaymentExample::$ur
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,
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.
Please Log in or Create an account to join the conversation.
10 years 2 months ago #245191
by oby
Replied by oby on topic Undefined property: plgHikashoppaymentExample::$ur
Hello,
Thank you for the quick response. Attached is the file containing the code.
Thank you.
Thank you for the quick response. Attached is the file containing the code.
Thank you.
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
10 years 2 months ago #245213
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Undefined property: plgHikashoppaymentExample::$ur
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,
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.
Please Log in or Create an account to join the conversation.
10 years 2 months ago #245233
by oby
Replied by oby on topic Undefined property: plgHikashoppaymentExample::$ur
Thanks a million! Including those lines solved the problem.
Have a nice day.
Have a nice day.
Please Log in or Create an account to join the conversation.
Time to create page: 0.173 seconds