Skip to main content

No shipping method selected

More
12 years 11 months ago #128780 by dreads
How I can set up a message when no shipping method selected?

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

More
12 years 11 months ago - 12 years 11 months ago #128807 by Mohamed Thelji
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 :
Code:
foreach($this->rates as $rate) {
By :
Code:
$shipping_checked = 0; foreach($this->rates as $rate) {
These lines :
Code:
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 :
Code:
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 :
Code:
$k = 1-$k; }
By :
Code:
$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: 12 years 11 months ago by Mohamed Thelji.
The following user(s) said Thank You: dreads

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

More
12 years 11 months ago #128835 by dreads
Replied by dreads on topic No payment methods selected
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.

More
12 years 11 months ago #128854 by Mohamed Thelji
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.

More
12 years 11 months ago #128977 by dreads
Replied by dreads on topic No shipping method selected
What lines should I change?

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

More
12 years 11 months ago - 12 years 11 months ago #129025 by Mohamed Thelji
You'll have to change these lines (which is appearing 2 times) :
Code:
foreach($this->methods as $method){
By :
Code:
$payment_checked = 0; foreach($this->methods as $method){
These lines (which are appearing 2 times) :
Code:
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 :
Code:
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 :
Code:
<?php } } }
By :
Code:
<?php } if($payment_checked == 0){ $app = JFactory::getApplication(); $app->enqueueMessage('Please select a payment method'); } }
Last edit: 12 years 11 months 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.181 seconds
Powered by Kunena Forum