Shipping method with dropdown selection?

  • Posts: 1119
  • Thank you received: 114
7 years 9 months ago #261660

Hi,

What would be solution for new hikashop checkout?

This doesn't work anymore.

$app = JFactory::getApplication();
$shipping_id = reset($app->getUserState(HIKASHOP_COMPONENT.'.shipping_id'));
if($shipping_id == 'XXX@0') continue;

Thanks

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

  • Posts: 46
  • Thank you received: 3
7 years 9 months ago #261691

Hi,
I have similar question so I would like to join this topic.
We are currently testing new shipping plugin for terminals (our partner is www.depo.sk ). They provided the plugin, but this is the first installation ( www.montemama.eu ).
If customer selects this type of shipping, clicks on DEPO option but also need to choose from list of terminals. But if the terminal is not selected, checkout process continues without warning message. Developers of the plugins replied that they do not know how to require the selection from the dropdown list and asked us to contact Hikashop support.
On the other hand, when customer selects directly from the dropdown and doesn´t click on DEPO option, there is an error message and it is not very clear what to do. Is it possible to use some radio buttons or something more visually clear for selection shipping method? Now it only changes color of background under the name of shipping method.
Another question - is it possible to show the selected DEPO terminal in order confimation?
Could you, please, advice? Thank you!

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 9 months ago #261683

Hi,

Something like that:

<?php
$checkoutHelper = hikashop_get('helper.checkout');
$cart = $checkoutHelper->getCart();
$shipping_id = reset($cart->cart_shipping_ids);
if($shipping_id == 'XXX@0') continue;
?>
Note however that you need to do such modification in the show_block_shipping view file for the new checkout.

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

  • Posts: 1119
  • Thank you received: 114
7 years 9 months ago #261800

Hi,

Thank you for looking into this Nicolas.
I think you have misunderstood my question or asked it wrong.

I have manual shipping method with id 15. It is terminal shipping method.
When it is selected i need to show custom field with dropdown selection.
It was working fine with that code and with old checkout.

However with new checkout it doesnt work properly. When i come at first to checkout step where are shipping methods on choosing shipping method with id 15 fields view won't showp up and i need to refresh page then all working fine. It shows or hides based on shipping method selected.

I have this code in show block fields:

$cart = $this->checkoutHelper->getCart();
$shipping_id = reset($cart->cart_shipping_ids);
if($shipping_id == '8@0') continue;
if($shipping_id == '12@0') continue;

And to register wit ajax i have this:
window.Oby.registerAjax(['checkout.fields.updated','cart.updated','checkout.shipping.updated'], function(params){

More about it you can read this topic where Jerome was helpful until some point... www.hikashop.com/forum/hikashop-3-0-beta...stions.html?start=40

Thanks

Last edit: 7 years 9 months ago by kyratn.

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
7 years 9 months ago #261819

Hi,

Then in your "show_block_shipping view file, change the code:
window.checkout.shippingSelected(this);
to:
this.form.submit();
And that should work like before (several places).

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

  • Posts: 1119
  • Thank you received: 114
7 years 9 months ago #261929

Hi,

Thank you, it does work. However i lose ajax with this...

I will stick with this solution until i find how to get it to work properly with ajax.

Kind Regards

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

Time to create page: 0.076 seconds
Powered by Kunena Forum