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

#   Step 1 in checkout is repeated

##

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

Less More

- Posts: 45
- Thank you received: 0
-
-

11 years 4 months ago [\#204562](#204562) by [paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")  *[Step 1 in checkout is repeated](/forum/31-development/877477-step-1-in-checkout-is-repeated#204562 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4 -- PHP version -- : 5.5 -- Browser(s) name and version -- : Chrome  Hi,  I've made my own payment plugin that selects a payment method and issuer in the payment selection pane. When I accept my choices and press the 'finish' button, the same page reappears. Pressing 'finish' once more takes me to the redirect to payment service provider page. While debugging this issue I found in checkout.php the following snippet that plays an important role here (lines 1187 and further)  My workaround is to preload the $app-&gt;getUserState(HIKASHOP&#95;COMPONENT.'.payment&#95;method'); and $app-&gt;getUserState(HIKASHOP&#95;COMPONENT.'.payment&#95;id'); in the plugin's onPaymentSave() method in the following manner:  This workaround seems to be OK, but I'm wondering what the purpose of the check in checkout is and whether such a workaround is needed.  Your thoughts are appreciated, as always.  Best regards, Paul")* was created by *[paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")*

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.4
-- PHP version -- : 5.5
-- Browser(s) name and version -- : Chrome

Hi,

I've made my own payment plugin that selects a payment method and issuer in the payment selection pane. When I accept my choices and press the 'finish' button, the same page reappears. Pressing 'finish' once more takes me to the redirect to payment service provider page.
While debugging this issue I found in checkout.php the following snippet that plays an important role here (lines 1187 and further) Code:

$app = JFactory::getApplication(); $old_payment_method = $app-&gt;getUserState(HIKASHOP_COMPONENT.'.payment_method'); $old_payment_data = $app-&gt;getUserState(HIKASHOP_COMPONENT.'.payment_data'); $old_payment_id = $app-&gt;getUserState(HIKASHOP_COMPONENT.'.payment_id'); $app-&gt;setUserState( HIKASHOP_COMPONENT.'.payment_method',$payment); $app-&gt;setUserState( HIKASHOP_COMPONENT.'.payment_id',$payment_id); $price_all = @$cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax; if(isset($cart-&gt;full_total-&gt;prices[0]-&gt;price_value_without_payment_with_tax)){ $price_all = @$cart-&gt;full_total-&gt;prices[0]-&gt;price_value_without_payment_with_tax; } $currencyClass = hikashop_get('class.currency'); $currencyClass-&gt;convertPayments($rates); $paymentData-&gt;payment_price = ($price_all * (float)@$paymentData-&gt;payment_params-&gt;payment_percentage / 100) + $paymentData-&gt;payment_price; $app-&gt;setUserState( HIKASHOP_COMPONENT.'.payment_data',$paymentData); if(!empty($paymentData-&gt;ask_cc)){ $paymentClass = hikashop_get('class.payment'); if(!$paymentClass-&gt;readCC()){ return false; } } if(($old_payment_id!=$payment_id &#124;&#124; $old_payment_method!=$payment) &#124;&#124; @$old_payment_data-&gt;payment_price!=$paymentData-&gt;payment_price &amp;&amp; ($this-&gt;_getStep('cart',(int)$this-&gt;previous)===(int)$this-&gt;previous &#124;&#124; $this-&gt;_getStep('confirm',(int)$this-&gt;previous)===(int)$this-&gt;previous)){ return false; }

My workaround is to preload the $app-&gt;getUserState(HIKASHOP_COMPONENT.'.payment_method'); and $app-&gt;getUserState(HIKASHOP_COMPONENT.'.payment_id'); in the plugin's onPaymentSave() method in the following manner: Code:

$app = JFactory::getApplication(); $app-&gt;setUserState( HIKASHOP_COMPONENT.'.payment_id',$payment_id); $app-&gt;setUserState( HIKASHOP_COMPONENT.'.payment_method','mypayment');

This workaround seems to be OK, but I'm wondering what the purpose of the check in checkout is and whether such a workaround is needed.

Your thoughts are appreciated, as always.

Best regards, Paul

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

11 years 4 months ago [\#204578](#204578) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Step 1 in checkout is repeated](/forum/31-development/877477-step-1-in-checkout-is-repeated#204578 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4 -- PHP version -- : 5.5 -- Browser(s) name and version -- : Chrome  Hi,  I've made my own payment plugin that selects a payment method and issuer in the payment selection pane. When I accept my choices and press the 'finish' button, the same page reappears. Pressing 'finish' once more takes me to the redirect to payment service provider page. While debugging this issue I found in checkout.php the following snippet that plays an important role here (lines 1187 and further)  My workaround is to preload the $app-&gt;getUserState(HIKASHOP&#95;COMPONENT.'.payment&#95;method'); and $app-&gt;getUserState(HIKASHOP&#95;COMPONENT.'.payment&#95;id'); in the plugin's onPaymentSave() method in the following manner:  This workaround seems to be OK, but I'm wondering what the purpose of the check in checkout is and whether such a workaround is needed.  Your thoughts are appreciated, as always.  Best regards, Paul")*

Hello Paul,
Firstly can you show me how did you configured the page "Hikahsop-&gt;System-&gt;Configuration-&gt;Checkout" through some screenshots ?
Thanks.

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

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

Less More

- Posts: 45
- Thank you received: 0
-
-

11 years 4 months ago [\#204581](#204581) by [paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")  Replied by *[paulvanharen](/forum/user/20480-paulvanharen "View paulvanharen's Profile")* on topic *[Step 1 in checkout is repeated](/forum/31-development/877477-step-1-in-checkout-is-repeated#204581 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4 -- PHP version -- : 5.5 -- Browser(s) name and version -- : Chrome  Hi,  I've made my own payment plugin that selects a payment method and issuer in the payment selection pane. When I accept my choices and press the 'finish' button, the same page reappears. Pressing 'finish' once more takes me to the redirect to payment service provider page. While debugging this issue I found in checkout.php the following snippet that plays an important role here (lines 1187 and further)  My workaround is to preload the $app-&gt;getUserState(HIKASHOP&#95;COMPONENT.'.payment&#95;method'); and $app-&gt;getUserState(HIKASHOP&#95;COMPONENT.'.payment&#95;id'); in the plugin's onPaymentSave() method in the following manner:  This workaround seems to be OK, but I'm wondering what the purpose of the check in checkout is and whether such a workaround is needed.  Your thoughts are appreciated, as always.  Best regards, Paul")*

Hi Mohamed,

Please find attached.

Thanks, Paul.

- [ ![Omnikassa&#95;&#95;&#95;Administration&#95;&#95;&#95;Configuration.png](/forum/attachment/24870) ](/forum/attachment/24870 "...figuration.png") [ ](/forum/attachment/24870?download=1 "...figuration.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NzQ3Ny1zdGVwLTEtaW4tY2hlY2tvdXQtaXMtcmVwZWF0ZWQ/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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14269
-
-

11 years 4 months ago [\#204585](#204585) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Step 1 in checkout is repeated](/forum/31-development/877477-step-1-in-checkout-is-repeated#204585 "-- HikaShop version -- : 2.3.5 -- Joomla version -- : 3.4 -- PHP version -- : 5.5 -- Browser(s) name and version -- : Chrome  Hi,  I've made my own payment plugin that selects a payment method and issuer in the payment selection pane. When I accept my choices and press the 'finish' button, the same page reappears. Pressing 'finish' once more takes me to the redirect to payment service provider page. While debugging this issue I found in checkout.php the following snippet that plays an important role here (lines 1187 and further)  My workaround is to preload the $app-&gt;getUserState(HIKASHOP&#95;COMPONENT.'.payment&#95;method'); and $app-&gt;getUserState(HIKASHOP&#95;COMPONENT.'.payment&#95;id'); in the plugin's onPaymentSave() method in the following manner:  This workaround seems to be OK, but I'm wondering what the purpose of the check in checkout is and whether such a workaround is needed.  Your thoughts are appreciated, as always.  Best regards, Paul")*

Hi,

You turned off the "auto select shipping and payment methods" and the "auto submit payment and shipping methods selection" settings there.
That's probably why you get that behavior and your code just does what these option do.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3NzQ3Ny1zdGVwLTEtaW4tY2hlY2tvdXQtaXMtcmVwZWF0ZWQ/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.247 seconds

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

[](#top)
