Block Delivery Destination by Country

gearup

#7
Testing this morning showed a problem.

While removing the country lines in the EN/DE files achieved my goal for the order destination address it caused a problem with the General Settings, shop country & state.

When Switzerland is no longer available this is not good as it is the correct value to be entered here.

I need to put back this change with the EN/DE files and work out some conditional code for the Order process step 1 country selection.

Maybe I could let it be shown but greyed out indicating not selectable.

Update: Man I cant work it out. I just need to disable a selection from a list but it doesnt work for me. I going for a walk, maybe that will help...
Tomorrow is a day we can look forward to but will never see.

jacobi22

QuoteNow I found the right place for this on view_form.php at line 123

good to know - thx

gearup

#5
Hi jacobi22,

The line I found was (bakery 1.59) view_form.php,

line 296 // Show ship form title using template file
$tpl->set_var(array(
'TXT_NO_DELIVERY' => $MOD_BAKERY['TXT_NO_DELIVERY'],
'TXT_FILL_IN_SHIP_ADDRESS' => $MOD_BAKERY['TXT_FILL_IN_SHIP_ADDRESS']
));
$tpl->parse('form', 'ship_title_block', true);


but it still does not display...

Now I found the right place for this on view_form.php at line 123,

'TXT_FILL_IN_ADDRESS' => $MOD_BAKERY['TXT_FILL_IN_ADDRESS'],
'TXT_NO_DELIVERY'           =>  $MOD_BAKERY['TXT_NO_DELIVERY'],


Now it all works and displays fine.

Thx for the support.
Tomorrow is a day we can look forward to but will never see.

jacobi22

define the placeholders in the view_form.php
like

'TXT_NO_DELIVERY' => $MOD_BAKERY['TXT_NO_DELIVERY'],

i'm not sure about the line, try it in the Placeholders block nearly Line 246
behind this line
// Show cust textfields block using template file
                $tpl->set_var(array(


gearup

Thank you nibz,

That post showed me what to do.

I have removed the Switzerland lines from the EN & DE files and now that destination is no longer selectable as I wanted.

I am now trying to display a message which I inserted into the language dir EN & DE files and it is driving me crazy.

For example, I have the text added in the EN file,

$MOD_BAKERY['TXT_NO_DELIVERY'] = 'Delivery not Permitted: Switzerland';


and to display it just under the existing message in file form/title.htm

<p class ="mod_bakery_form_p_f">{TXT_FILL_IN_ADDRESS}:</p>
<p class ="mod_bakery_form_p_f">{TXT_NO_DELIVERY}--test</p>


however it does not display, I just see --test

what is going on :(

regards,
Tomorrow is a day we can look forward to but will never see.

nibz

https://forum.websitebaker.org/index.php/topic,24377.msg173099.html#msg173099

Check this post...

You can do the same, by removing Switzerland (and more countries if you like).

gearup

#1
Hi,

I have been looking at how to do this but cant see what to do without thinking I am going to break something ;)

The situation I have is a shop but I need to block delivery to a country (Switzerland).

Basically we only have an export license for our products so in country sales destinations need to be blocked.

I am thinking the way to do this is to disable the specific country selection when the address is entered during the order process.

There would also need to be a message somewhere like [Switzerland-No] representing a text in the language files,
"delivery to Switzerland is not allowed"
and for the Deutsch pages,
"Lieferung zu die Schweiz ist nicht Erlaubt"

Any hints please..

regards,
Tomorrow is a day we can look forward to but will never see.