Page 1 of 1

Setting zone_id to a fixed value

Posted: Sat May 21, 2011 7:23 pm
by pmchardy
I am wondering if anyone can help point me to where I am going wrong?

I do not want the Region / State (zone) prompt to appear in the guest checkout page.
I am happy to have all the zones set as scotland
I have a zone set as scotland

so I edited the guest_step_1.pl file


I removed the portion of code to select the zone


<td><span class="required">*</span> <?php echo $entry_zone; ?></td>
<td><select name="zone_id">
</select>
<?php if ($error_zone) { ?>
<span class="error"><?php echo $error_zone; ?></span>
<?php } ?></td>





then I added the following php code to set the zone variable to scotland.

<?php $zone_id = "Scotland"; ?>

when I do that I get the following error when I move on from








Notice: Undefined index: zone_id in /homepages/4/d114169772/htdocs/opencart/catalog/controller/checkout/guest_step_1.php on line 502
Notice: Undefined index: zone_id in /homepages/4/d114169772/htdocs/opencart/catalog/controller/checkout/guest_step_1.php on line 34
Notice: Undefined index: zone_id in /homepages/4/d114169772/htdocs/opencart/catalog/controller/checkout/guest_step_1.php on line 37
Notice: Undefined index: zone_id in /homepages/4/d114169772/htdocs/opencart/catalog/controller/checkout/guest_step_1.php on line 58
Warning: Cannot modify header information - headers already sent by (output started at /homepages/4/d114169772/htdocs/opencart/index.php:92) in /homepages/4/d114169772/htdocs/opencart/system/engine/controller.php on line 27



what am I doing wrong and how do I fix this?

Thanks

Peter

Re: Setting zone_id to a fixed value

Posted: Sat May 21, 2011 7:52 pm
by qahar
instead of modificate the template or controller, why not removing all State except Scotland from database?

Re: Setting zone_id to a fixed value

Posted: Sat May 21, 2011 8:15 pm
by pmchardy
when I remove all zones from the country Scotland, the region box still appears with the requirement to choose something which is --none--

Re: Setting zone_id to a fixed value

Posted: Tue Dec 02, 2014 3:09 am
by electro_dr
You write Scotland zone_id number not text. $zone_id is int from your database. Please find your country_id number and write correct number.