[Skip to main content](#vessel-content)

#   Paypal payment trigger after\_end.php

##

- **[fhmanas](/forum/user/59663-fhmanas "View fhmanas's Profile")**
- [![fhmanas's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/59663-fhmanas "View fhmanas's Profile") Topic Author
- [ Offline](/forum/user/59663-fhmanas)

Less More

- Posts: 24
- Thank you received: 0
-
-

6 years 2 months ago [\#323543](#323543) by [fhmanas](/forum/user/59663-fhmanas "View fhmanas's Profile")  *[Paypal payment trigger after\_end.php](/forum/25-install-update/900715-paypal-payment-trigger-after-end-php#323543 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.11.0  Hello I have special code in after&#95;end.php view of Checkout, why is it not being triggered by Paypal plugin. As a test, I have a Cash on Delivery payment setup, and whenever I use the COD, after&#95;end.php is triggered. I have not modified anything with the Paypal plugin except for the settings. I just want it to trigger my modified after&#95;end.php  Attaching my settings in Hikashop for paypal.")* was created by *[fhmanas](/forum/user/59663-fhmanas "View fhmanas's Profile")*

-- HikaShop version -- : 4.3.0
-- Joomla version -- : 3.11.0

Hello I have special code in after_end.php view of Checkout, why is it not being triggered by Paypal plugin. As a test, I have a Cash on Delivery payment setup, and whenever I use the COD, after_end.php is triggered. I have not modified anything with the Paypal plugin except for the settings. I just want it to trigger my modified after_end.php

Attaching my settings in Hikashop for paypal.

- [ ![paypal.png](/forum/attachment/50459) ](/forum/attachment/50459 "paypal.png") [ ](/forum/attachment/50459?download=1 "paypal.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwMDcxNS1wYXlwYWwtcGF5bWVudC10cmlnZ2VyLWFmdGVyLWVuZC1waHA/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

6 years 2 months ago [\#323549](#323549) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Paypal payment trigger after\_end.php](/forum/25-install-update/900715-paypal-payment-trigger-after-end-php#323549 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.11.0  Hello I have special code in after&#95;end.php view of Checkout, why is it not being triggered by Paypal plugin. As a test, I have a Cash on Delivery payment setup, and whenever I use the COD, after&#95;end.php is triggered. I have not modified anything with the Paypal plugin except for the settings. I just want it to trigger my modified after&#95;end.php  Attaching my settings in Hikashop for paypal.")*

Hi,

The after_end will only be "triggered" when the customer comes back to the website from the PayPal payment page.
If you close your browser/tab after the payment is done or don't do the payment on PayPal, then after_end is not called as after_end is the view file displaying the default thank you page.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwMDcxNS1wYXlwYWwtcGF5bWVudC10cmlnZ2VyLWFmdGVyLWVuZC1waHA/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Tiktaalik Dev](/forum/user/60471-tiktaalik-dev "View Tiktaalik Dev's Profile")**
- [![Tiktaalik Dev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/60471-tiktaalik-dev "View Tiktaalik Dev's Profile")
- [ Offline](/forum/user/60471-tiktaalik-dev)
- Software Developer

Less More

- Posts: 3
- Thank you received: 0
-
-
- [](https://tiktaalik.dev)
-

5 years 11 months ago [\#326683](#326683) by [Tiktaalik Dev](/forum/user/60471-tiktaalik-dev "View Tiktaalik Dev's Profile")  Replied by *[Tiktaalik Dev](/forum/user/60471-tiktaalik-dev "View Tiktaalik Dev's Profile")* on topic *[Paypal payment trigger after\_end.php](/forum/25-install-update/900715-paypal-payment-trigger-after-end-php#326683 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.11.0  Hello I have special code in after&#95;end.php view of Checkout, why is it not being triggered by Paypal plugin. As a test, I have a Cash on Delivery payment setup, and whenever I use the COD, after&#95;end.php is triggered. I have not modified anything with the Paypal plugin except for the settings. I just want it to trigger my modified after&#95;end.php  Attaching my settings in Hikashop for paypal.")*

Hi Nicolas,
I'm having the same problem as @fhmanas though with a different payment plugin that I developed.
It was working fine up to Joomla 3.18 but after upgrading it, now it simply doesn't trigger the "after_end" view.

What I have been able to trace:

1. First I noticed that the event onHikashopBeforeDisplayView() wasn't triggered, which I need because I use that event to write out the details of the credit card receipt.
2. Then I placed a debug\_backtrace() call at the begining of my plugin script and I can see that the script is read but another debug\_trace() call placed in the event method is never read.
3. Now I also placed a debug\_backtrace() call in the actual after\_end.php view in the component folder (the original, not an override) and that trace is never read.

I'm at my wits' end. Please help me out!

In case it may shed some light to the problem, here's a copy of the backtrace output: Code:

/home/rigo/Projects/WebPayPlus/Plugins/hikashop/source/tiktaalikwebpay.php:15: array (size=13) 0 =&gt; array (size=3) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Plugin/PluginHelper.php' (length=70) 'line' =&gt; int 253 'function' =&gt; string 'require_once' (length=12) 1 =&gt; array (size=6) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Plugin/PluginHelper.php' (length=70) 'line' =&gt; int 182 'function' =&gt; string 'import' (length=6) 'class' =&gt; string 'Joomla\CMS\Plugin\PluginHelper' (length=30) 'type' =&gt; string '::' (length=2) 'args' =&gt; array (size=3) 0 =&gt; object(stdClass)[183] ... 1 =&gt; boolean true 2 =&gt; object(JEventDispatcher)[37] ... 2 =&gt; array (size=6) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/administrator/components/com_hikashop/classes/cart.php' (length=87) 'line' =&gt; int 150 'function' =&gt; string 'importPlugin' (length=12) 'class' =&gt; string 'Joomla\CMS\Plugin\PluginHelper' (length=30) 'type' =&gt; string '::' (length=2) 'args' =&gt; array (size=1) 0 =&gt; string 'hikashoppayment' (length=15) 3 =&gt; array (size=7) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/administrator/components/com_hikashop/helpers/checkout.php' (length=91) 'line' =&gt; int 47 'function' =&gt; string 'get' (length=3) 'class' =&gt; string 'hikashopCartClass' (length=17) 'object' =&gt; object(hikashopCartClass)[1028] public 'tables' =&gt; array (size=2) ... public 'pkeys' =&gt; array (size=2) ... protected 'db' =&gt; object(JDatabaseDriverPdomysql)[24] ... protected 'app' =&gt; object(Joomla\CMS\Application\SiteApplication)[19] ... protected 'config' =&gt; object(hikashopConfigClass)[524] ... protected 'user' =&gt; object(stdClass)[961] ... public 'namekeys' =&gt; array (size=0) ... protected '_errors' =&gt; array (size=0) ... public 'database' =&gt; object(JDatabaseDriverPdomysql)[24] ... 'type' =&gt; string '-&gt;' (length=2) 'args' =&gt; array (size=1) 0 =&gt; int 45 4 =&gt; array (size=7) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/administrator/components/com_hikashop/helpers/checkout.php' (length=91) 'line' =&gt; int 35 'function' =&gt; string '__construct' (length=11) 'class' =&gt; string 'hikashopCheckoutHelper' (length=22) 'object' =&gt; object(hikashopCheckoutHelper)[1029] public 'cart' =&gt; boolean false public 'checkout_workflow' =&gt; null public 'redirectBeforeDisplay' =&gt; null protected 'cart_id' =&gt; int 0 protected 'shop_closed' =&gt; boolean false protected 'config' =&gt; null protected 'cartClass' =&gt; object(hikashopCartClass)[1028] ... protected 'shippingClass' =&gt; null protected 'paymentClass' =&gt; null protected 'addressClass' =&gt; null protected 'currencyClass' =&gt; null protected 'redirect_url' =&gt; null protected 'events' =&gt; array (size=0) ... protected 'messages' =&gt; array (size=0) ... protected 'images' =&gt; array (size=0) ... 'type' =&gt; string '-&gt;' (length=2) 'args' =&gt; array (size=1) 0 =&gt; int 0 5 =&gt; array (size=6) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop/controllers/checkout.php' (length=81) 'line' =&gt; int 56 'function' =&gt; string 'get' (length=3) 'class' =&gt; string 'hikashopCheckoutHelper' (length=22) 'type' =&gt; string '::' (length=2) 'args' =&gt; array (size=1) 0 =&gt; int 0 6 =&gt; array (size=7) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop/hikashop.php' (length=69) 'line' =&gt; int 88 'function' =&gt; string '__construct' (length=11) 'class' =&gt; string 'checkoutController' (length=18) 'object' =&gt; object(checkoutController)[974] public 'display' =&gt; array (size=16) ... public 'modify_views' =&gt; array (size=0) ... public 'add' =&gt; array (size=0) ... public 'modify' =&gt; array (size=0) ... public 'delete' =&gt; array (size=0) ... protected 'config' =&gt; object(hikashopConfigClass)[524] ... protected 'app' =&gt; object(Joomla\CMS\Application\SiteApplication)[19] ... protected 'dispatcher' =&gt; null public 'pkey' =&gt; array (size=0) ... public 'table' =&gt; array (size=0) ... public 'groupMap' =&gt; string '' (length=0) public 'groupVal' =&gt; null public 'orderingMap' =&gt; string '' (length=0) public 'local_display' =&gt; array (size=0) ... public 'publish_return_view' =&gt; string 'listing' (length=7) public 'pluginCtrl' =&gt; null protected 'basePath' =&gt; string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop' (length=56) protected 'default_view' =&gt; string 'checkout' (length=8) protected 'doTask' =&gt; null protected 'message' =&gt; null protected 'messageType' =&gt; string 'message' (length=7) protected 'methods' =&gt; array (size=35) ... protected 'name' =&gt; string 'checkout' (length=8) protected 'model_prefix' =&gt; string 'CheckoutModel' (length=13) protected 'paths' =&gt; array (size=1) ... protected 'redirect' =&gt; null protected 'task' =&gt; null protected 'taskMap' =&gt; array (size=36) ... protected 'input' =&gt; object(Joomla\CMS\Input\Input)[20] ... protected '_errors' =&gt; array (size=0) ... 'type' =&gt; string '-&gt;' (length=2) 'args' =&gt; array (size=0) empty 7 =&gt; array (size=4) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Component/ComponentHelper.php' (length=76) 'line' =&gt; int 402 'args' =&gt; array (size=1) 0 =&gt; string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop/hikashop.php' (length=69) 'function' =&gt; string 'require_once' (length=12) 8 =&gt; array (size=6) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Component/ComponentHelper.php' (length=76) 'line' =&gt; int 377 'function' =&gt; string 'executeComponent' (length=16) 'class' =&gt; string 'Joomla\CMS\Component\ComponentHelper' (length=36) 'type' =&gt; string '::' (length=2) 'args' =&gt; array (size=1) 0 =&gt; string '/home/rigo/Projects/tiktaalik/v2/components/com_hikashop/hikashop.php' (length=69) 9 =&gt; array (size=6) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Application/SiteApplication.php' (length=78) 'line' =&gt; int 194 'function' =&gt; string 'renderComponent' (length=15) 'class' =&gt; string 'Joomla\CMS\Component\ComponentHelper' (length=36) 'type' =&gt; string '::' (length=2) 'args' =&gt; array (size=1) 0 =&gt; string 'com_hikashop' (length=12) 10 =&gt; array (size=7) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Application/SiteApplication.php' (length=78) 'line' =&gt; int 233 'function' =&gt; string 'dispatch' (length=8) 'class' =&gt; string 'Joomla\CMS\Application\SiteApplication' (length=38) 'object' =&gt; object(Joomla\CMS\Application\SiteApplication)[19] protected '_language_filter' =&gt; boolean true protected '_detect_browser' =&gt; boolean false protected 'docOptions' =&gt; array (size=0) ... public 'scope' =&gt; string 'com_hikashop' (length=12) protected '_clientId' =&gt; int 0 protected '_messageQueue' =&gt; array (size=3) ... protected '_name' =&gt; string 'site' (length=4) protected 'profiler' =&gt; object(Joomla\CMS\Profiler\Profiler)[15] ... protected 'template' =&gt; object(stdClass)[871] ... public 'charSet' =&gt; string 'utf-8' (length=5) public 'mimeType' =&gt; string 'text/html' (length=9) public 'modifiedDate' =&gt; null public 'client' =&gt; object(Joomla\Application\Web\WebClient)[30] ... protected 'document' =&gt; object(Joomla\CMS\Document\HtmlDocument)[520] ... protected 'language' =&gt; object(Joomla\CMS\Language\Language)[28] ... protected 'session' =&gt; object(Joomla\CMS\Session\Session)[41] ... protected 'response' =&gt; object(stdClass)[32] ... private 'responseMap' (Joomla\CMS\Application\WebApplication) =&gt; array (size=61) ... private 'singleValueResponseHeaders' (Joomla\CMS\Application\WebApplication) =&gt; array (size=27) ... protected 'dispatcher' =&gt; object(JEventDispatcher)[37] ... protected 'identity' =&gt; null protected 'config' =&gt; object(Joomla\Registry\Registry)[22] ... public 'input' =&gt; object(Joomla\CMS\Input\Input)[20] ... private 'logger' (Joomla\Application\AbstractApplication) =&gt; object(Joomla\CMS\Log\DelegatingPsrLogger)[42] ... public 'item_associations' =&gt; int 1 'type' =&gt; string '-&gt;' (length=2) 'args' =&gt; array (size=0) empty 11 =&gt; array (size=7) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/libraries/src/Application/CMSApplication.php' (length=77) 'line' =&gt; int 196 'function' =&gt; string 'doExecute' (length=9) 'class' =&gt; string 'Joomla\CMS\Application\SiteApplication' (length=38) 'object' =&gt; object(Joomla\CMS\Application\SiteApplication)[19] protected '_language_filter' =&gt; boolean true protected '_detect_browser' =&gt; boolean false protected 'docOptions' =&gt; array (size=0) ... public 'scope' =&gt; string 'com_hikashop' (length=12) protected '_clientId' =&gt; int 0 protected '_messageQueue' =&gt; array (size=3) ... protected '_name' =&gt; string 'site' (length=4) protected 'profiler' =&gt; object(Joomla\CMS\Profiler\Profiler)[15] ... protected 'template' =&gt; object(stdClass)[871] ... public 'charSet' =&gt; string 'utf-8' (length=5) public 'mimeType' =&gt; string 'text/html' (length=9) public 'modifiedDate' =&gt; null public 'client' =&gt; object(Joomla\Application\Web\WebClient)[30] ... protected 'document' =&gt; object(Joomla\CMS\Document\HtmlDocument)[520] ... protected 'language' =&gt; object(Joomla\CMS\Language\Language)[28] ... protected 'session' =&gt; object(Joomla\CMS\Session\Session)[41] ... protected 'response' =&gt; object(stdClass)[32] ... private 'responseMap' (Joomla\CMS\Application\WebApplication) =&gt; array (size=61) ... private 'singleValueResponseHeaders' (Joomla\CMS\Application\WebApplication) =&gt; array (size=27) ... protected 'dispatcher' =&gt; object(JEventDispatcher)[37] ... protected 'identity' =&gt; null protected 'config' =&gt; object(Joomla\Registry\Registry)[22] ... public 'input' =&gt; object(Joomla\CMS\Input\Input)[20] ... private 'logger' (Joomla\Application\AbstractApplication) =&gt; object(Joomla\CMS\Log\DelegatingPsrLogger)[42] ... public 'item_associations' =&gt; int 1 'type' =&gt; string '-&gt;' (length=2) 'args' =&gt; array (size=0) empty 12 =&gt; array (size=7) 'file' =&gt; string '/home/rigo/Projects/tiktaalik/v2/index.php' (length=42) 'line' =&gt; int 49 'function' =&gt; string 'execute' (length=7) 'class' =&gt; string 'Joomla\CMS\Application\CMSApplication' (length=37) 'object' =&gt; object(Joomla\CMS\Application\SiteApplication)[19] protected '_language_filter' =&gt; boolean true protected '_detect_browser' =&gt; boolean false protected 'docOptions' =&gt; array (size=0) ... public 'scope' =&gt; string 'com_hikashop' (length=12) protected '_clientId' =&gt; int 0 protected '_messageQueue' =&gt; array (size=3) ... protected '_name' =&gt; string 'site' (length=4) protected 'profiler' =&gt; object(Joomla\CMS\Profiler\Profiler)[15] ... protected 'template' =&gt; object(stdClass)[871] ... public 'charSet' =&gt; string 'utf-8' (length=5) public 'mimeType' =&gt; string 'text/html' (length=9) public 'modifiedDate' =&gt; null public 'client' =&gt; object(Joomla\Application\Web\WebClient)[30] ... protected 'document' =&gt; object(Joomla\CMS\Document\HtmlDocument)[520] ... protected 'language' =&gt; object(Joomla\CMS\Language\Language)[28] ... protected 'session' =&gt; object(Joomla\CMS\Session\Session)[41] ... protected 'response' =&gt; object(stdClass)[32] ... private 'responseMap' (Joomla\CMS\Application\WebApplication) =&gt; array (size=61) ... private 'singleValueResponseHeaders' (Joomla\CMS\Application\WebApplication) =&gt; array (size=27) ... protected 'dispatcher' =&gt; object(JEventDispatcher)[37] ... protected 'identity' =&gt; null protected 'config' =&gt; object(Joomla\Registry\Registry)[22] ... public 'input' =&gt; object(Joomla\CMS\Input\Input)[20] ... private 'logger' (Joomla\Application\AbstractApplication) =&gt; object(Joomla\CMS\Log\DelegatingPsrLogger)[42] ... public 'item_associations' =&gt; int 1 'type' =&gt; string '-&gt;' (length=2) 'args' =&gt; array (size=0) empty

Thanks in advance for any feedback you may provide

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwMDcxNS1wYXlwYWwtcGF5bWVudC10cmlnZ2VyLWFmdGVyLWVuZC1waHA/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

5 years 6 months ago [\#331723](#331723) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Paypal payment trigger after\_end.php](/forum/25-install-update/900715-paypal-payment-trigger-after-end-php#331723 "-- HikaShop version -- : 4.3.0 -- Joomla version -- : 3.11.0  Hello I have special code in after&#95;end.php view of Checkout, why is it not being triggered by Paypal plugin. As a test, I have a Cash on Delivery payment setup, and whenever I use the COD, after&#95;end.php is triggered. I have not modified anything with the Paypal plugin except for the settings. I just want it to trigger my modified after&#95;end.php  Attaching my settings in Hikashop for paypal.")*

Hi,

Sorry for the delay. I only saw your message now.
I would recommend to add some debug in the after_end function in components/com_hikashop/controllers/checkout.php

There, you can see a call to cleanCartFromSession which will:
- clear the cart session data if necessary
- redirect to the "return_url" of the payment method of the order
So It's possible that the after_end is skipped if you have a return url configured in the payment method settings because of that.

Then, you aslo have a check on the user with the code: Code:

if(empty($order) &#124;&#124; (hikashop_loadUser(false) != $order-&gt;order_user_id &amp;&amp; $order-&gt;order_token != $order_token)) return false;

So if the order cannot be found in the database, or the current logged in user is different from the user of the order, or if the order_token of the order in the database is different from the order_token passed in the parameters of the URL (for guest checkouts), the system will refuse the display of the after_end view.

These are the two reasons which would make is so that the after_end URL would be called but that the after_end view itself would not be displayed.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI1LWluc3RhbGwtdXBkYXRlLzkwMDcxNS1wYXlwYWwtcGF5bWVudC10cmlnZ2VyLWFmdGVyLWVuZC1waHA/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.118 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
