Payment selection when additional information req.

  • Posts: 45
  • Thank you received: 0
10 years 3 months ago #187685

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6

Hi,

When the customer can choose from multiple payment methods, just clicking the icon of the method, or the bullet in front, will select the method. This can be seen in the status indicator. Pressing the completion button once, will take you to the next checkout steo.

However, some payment plugins require additional information, such as credit card details or order numbers (needCC()). In this case the behavior is different. On clicking the icon, the payment methods seems to be selected, but the status is not updated. It requires pressing the 'complete' for the selection to propagate to the status indicator. Pressing once more, takes you to the next check out stage.

I'm now developing a new payment plug-in. The data entered for the plug-in is reset on the first click, which is kind of annoying.

I did some experimentation with the contents of components/com_hikashop/views/checkout/tmpl/payment.php.
Replacing

if($this->config->get('auto_submit_methods',1) && empty($method->ask_cc) && empty($method->custom_html) && empty($checked)){
by
if($this->config->get('auto_submit_methods',1) && empty($checked)){
removes the problem, but I've no idea what I might be damaging elsewhere.

Last edit: 10 years 3 months ago by paulvanharen.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 3 months ago #187692

Hello,
The solution was probably to just set the "Auto submit shipping and payment methods selection" option to NO via "Hikashop->System->Configuration->Checkout".

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

  • Posts: 45
  • Thank you received: 0
10 years 3 months ago #187784

Dear Mohamed,

I'm sorry, but the results are the same.

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

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
10 years 3 months ago #187851

Hi,

The data entered for the plug-in is reset on the first click, which is kind of annoying

Which data entered for the plugin are you talking about ?

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: 45
  • Thank you received: 0
10 years 3 months ago #187929

Dear Jerome,

I configured a small demo site to show the issue. Please have a look at kaleidoscoop-web.nl/demo/ . Order a product, proceed to check out and try paying with a purchase order.

Best regards, Paul

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

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
10 years 3 months ago #188075

Hi,

I made a test account but I did not receive any email for his activation.
Please, explain which data entered for the plugin are you talking about...

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.
Last edit: 10 years 3 months ago by Jerome.

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

  • Posts: 45
  • Thank you received: 0
10 years 3 months ago #188157

Dear Jerome,

Your account has been enabled now. Sorry for the inconvenience.
A screenshot showing the plugin data is attached.

Thanks and regards, Paul

Attachments:

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

  • Posts: 83766
  • Thank you received: 13557
  • MODERATOR
10 years 3 months ago #188745

Hi,

The code change you made will indeed activate the auto submit of the payment method selection, but it's it requires the credit card data, it will create an error.
We purposely deactivated the auto submit for payment methods requiring additional data to the user since the user has to input the data anyway and that way he won't try to start entering the credit card data and then get his data cleared in the middle by the refresh of the data.
But I understand that you might still prefer the behavior the way you have it.
I don't see why it would be a problem for something else so feel free to use that modification if you prefer it that way.

Note that I would recommend to do that modification via the menu Display>Views by editing the file "payment" of the view "checkout".
That way, you won't loose your modification when you update HikaShop.

Last edit: 10 years 3 months ago by nicolas.

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

  • Posts: 45
  • Thank you received: 0
10 years 3 months ago #188792

Dear Nicolas,

Thanks you for your reply.

I think I understand your concern that lead to the decision of disabling the auto submit. However, the current behavior is not particularly user friendly.
I play the following story:

  1. I select my product, which brings me to the checkout page.
  2. I log in or register myself
  3. I select Purchase order as payment method. Now, the radio button in front of Purchase order is selected, and the field for the Purchase Order Number appears. Note, that the status at the bottom still shows PayPalPro as payment method.
  4. I enter a Purchase Order Number and press the Finish button. I end up at the same screen (step-1), and the purchase order number is erased. However, the status at the bottom reports now that the payment method is now set to Purchase order.
  5. re-entering the Purchase Order Number allows me to finish the checkout
Is this the expected behavior? What can I do to optimize this story?

Thanks and regards, Paul

Last edit: 10 years 3 months ago by paulvanharen.

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

  • Posts: 83766
  • Thank you received: 13557
  • MODERATOR
10 years 3 months ago #188805

Hi,

It's not the expected behavior.
The purchase order field should not be erased. That's a problem of the purchase order plugin which I didn't saw when putting it together as the checkout workflow I used (in several steps) wasn't displaying again the payment methods form a second time.
It can easily be fixed by changing the line:

$method->custom_html='<span style="margin-left:10%">'.JText::_('PURCHASE_ORDER_NUMBER').'<input type="text" class="hikashop_purchase_order_number inputbox required" name="hikashop_purchase_order_number"/> *</span>';
to:
$method->custom_html='<span style="margin-left:10%">'.JText::_('PURCHASE_ORDER_NUMBER').'<input type="text" class="hikashop_purchase_order_number inputbox required" name="hikashop_purchase_order_number" value="'.@$_SESSION['hikashop_purchase_order_number'].'"/> *</span>';
in the file plugins/hikashoppayment/purchaseorder/purchaseorder.php (modification that will be in next version of HikaShop)
But as you can see, it's not a problem for the credit card payment method for which you don't have to enter the credit card twice.

The following user(s) said Thank You: jberry210490, paulvanharen

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

  • Posts: 45
  • Thank you received: 0
10 years 3 months ago #188887

Thanks. This does the trick, also for my payment plugings under development.

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

  • Posts: 76
  • Thank you received: 2
  • Hikashop Business
9 years 6 months ago #220276

Hi there,

Thanks for this thread, it's really helpful. I've made the proposed code change to the payment plug-in, and it does help. Just one further very related question...

Is there a relatively simple way to do away with having to press the "next" (or in my case "Finish" button) twice?

Presumably on the first click it accepts your choice of payment and then on the second click collects the PO Number you've entered?

I can't use auto-submit to replicate the first click of the button because the PO Number is a required field, so it throws an error saying no PO number has been entered. Obviously if if we could make the PO number not a required field when auto-submitting the payment option, and then make it a required field when clicking finish, that would be a perfectly acceptable solution.

I'm a relatively proficient with code, but any pointers to which part of the code to look at and how I might go about doing this would just be massively helpful.

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

  • Posts: 83766
  • Thank you received: 13557
  • MODERATOR
9 years 6 months ago #220277

Hi,

You want to remove that code:

if($usable_method && $usable_method->payment_type=='purchaseorder' && empty($_SESSION['hikashop_purchase_order_number'])){
			$app = JFactory::getApplication();
			$app->enqueueMessage(JText::_('PLEASE_ENTER_A_PURCHASE_ORDER_NUMBER'));
			return false;
		}
and instead check that the variable
$_SESSION['hikashop_purchase_order_number']
is not empty in the onBeforeOrderCreate and if it is, set $do to false and display the error message in that same plugins/hikashoppayment/purchaseorder/purchaseorder.php file

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

Time to create page: 0.095 seconds
Powered by Kunena Forum