No shipping method selected

  • Posts: 69
  • Thank you received: 0
11 years 1 month ago #128780

How I can set up a message when no shipping method selected?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 1 month ago #128807

Hi,

You'll be able to do it by editing the code of your "shipping" file of your "checkout" view of your front-end template through "Hikashop->Display->Views", but some development skill will be required to do that.
A solution will probably be to change this line :

foreach($this->rates as $rate) {
By :
    $shipping_checked = 0;
    foreach($this->rates as $rate) {
These lines :
      if((in_array($rate->shipping_type.'@'.$shipping_group_key, $this->shipping_method) && in_array($rate->shipping_id.'@'.$shipping_group_key, $this->shipping_id)) || ($auto_select_default && empty($this->shipping_id) && !$done)) {
        $done = true;
        $checked = 'checked="checked"';
      }
By :
      if((in_array($rate->shipping_type.'@'.$shipping_group_key, $this->shipping_method) && in_array($rate->shipping_id.'@'.$shipping_group_key, $this->shipping_id)) || ($auto_select_default && empty($this->shipping_id) && !$done)) {
        $done = true;
        $checked = 'checked="checked"';
        $shipping_checked = 1;
      }
And this line :
$k = 1-$k;
}
By :
$k = 1-$k;
}
if($shipping_checked == 0){
      $app = JFactory::getApplication();
      $app->enqueueMessage('Please select a shipping method');
}

Note that you'll be able to change the text "Please select a shipping method" by your message.

Last edit: 11 years 1 month ago by Mohamed Thelji.
The following user(s) said Thank You: dreads

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

  • Posts: 69
  • Thank you received: 0
11 years 1 month ago #128835

Perfect.

Now feel the same way but with payment methods.
What file should I change lines?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 1 month ago #128854

You should edit the code of the "payment" file of the "checkout" view of your front-end template.

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

  • Posts: 69
  • Thank you received: 0
11 years 1 month ago #128977

What lines should I change?

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

  • Posts: 12953
  • Thank you received: 1778
11 years 1 month ago #129025

You'll have to change these lines (which is appearing 2 times) :

foreach($this->methods as $method){
By :
$payment_checked = 0;
foreach($this->methods as $method){
These lines (which are appearing 2 times) :
if(($this->payment_method==$method->payment_type && $this->payment_id==$method->payment_id)|| ($auto_select_default && empty($this->payment_id)&&!$done)){
					$checked = 'checked="checked"';
					$done = true;
				}
By :
if(($this->payment_method==$method->payment_type && $this->payment_id==$method->payment_id)|| ($auto_select_default && empty($this->payment_id)&&!$done)){
					$checked = 'checked="checked"';
					$payment_checked = 1;
					$done = true;
				}
The last 3 lines :
<?php
	}
}
}
By :
<?php
	}
		if($payment_checked == 0){
      $app = JFactory::getApplication();
      $app->enqueueMessage('Please select a payment method');
}
}

Last edit: 11 years 1 month ago by Mohamed Thelji.
The following user(s) said Thank You: dreads

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

Time to create page: 0.072 seconds
Powered by Kunena Forum