Post by Steelace » Thu Nov 24, 2011 2:57 am

Hi

I'm using latest version 1.5.1.3 of OC and I'm gonna build a webshop selling only within my native country Sweden. We don't use Zones/States here in trade and I like to remove everything concerning that and also preferable the Country selection options for registration and checkout. I've tried all possible ways I can think of with my limited knowledge of PHP but can't come up with a working solution! I know this question has been asked before in several diffrent threads but none of the methods in those are working, at least not for v. 1.5.1.3. If anybody knows how to accomplish this please give me some input!!! There are probably many other users, especially from the Scandinavian countries who has the same needs! This would be a great subject for an extension. HELP!!!! :=)
Last edited by Johnathan on Thu Nov 24, 2011 11:30 pm, edited 1 time in total.
Reason: Merged with same topic posted in Concepts

Newbie

Posts

Joined
Mon Nov 14, 2011 9:09 pm

Post by straightlight » Thu Nov 24, 2011 8:37 am

Hi,

the reason why the Country and State field is mandatory for registration process and checkout process is due to forced rules from payment / shipping gateways which requires those information in order to complete an order. By removing those options, your customers will likely fail to complete their orders unless you plan to make offline transactions with your customers.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ifyouseek » Thu Nov 24, 2011 11:28 am

they way i would try is to edit the template files for checkout registration and resgistration pages, turn the zone <input> into a type="hidden" field and set the value="ZONeIDhere" to whatever you want as default, maybe you could create a new zone with no name and set value to this zone.

Shouldn't be too hard to do this but maybe someone will come and correct me becuase even i with my limited knowledge knows this isn't the best way to do it.

Active Member

Posts

Joined
Thu May 06, 2010 4:40 pm

Post by Steelace » Thu Nov 24, 2011 1:38 pm

Yes, I now understand that it could be a bit complicated to disable the Zones/States and Countries functionallity because they are needed for the payment process in the standard config of OC. In Sweden and in the Scandinavian countries we don't use States/Zones in trade. Yes, we have diffrent zones but they are not needed or used at all in addresses. Also if I'm only will be selling within Sweden it will look funny/strange to have a select menu with 1 countryitem and by having a Zone/State select field my customers will probably turn elsewhere in belief there is something wrong with the site. I have managed so far to remove all Zones from mysql but one which I named simply Sweden. Then changed everything so it works in registration and checkout. The problem is that the Zones/states and Country field are required and I've tried diffrent methods desribed in other threads by hiding those fields with code in template files and change the code in the controller files. The Zone/State works removing this way but as soon as checking out (as logged in user and guest) everything stops working.
This is really a major problem for all selling only in their native country and in which also Zones/States are not used in trade. This is not only true in the Scandinavian countires but many others also. If this is not either implemented as a turn on/turn off feature in original OC or as a working extension performing the same way I)'m afraid that many people will soon give up OC for other solutions. This would be a shame since it's a very good and user friendly solution otherwise. Especially for peolpe with limited budget and knowledge. Hope to hear from anybody who maybe already solved this problem. Please no more guess methods only, me and many others really need a 100% working method to self implement or by help of a commercial extension!! Hey, this could generate some money for somebody!! Think about it? There are thousands and thousands of users in the Scandinavian countires and only a handfull can handle "advanced" code themselves!? ;=)

PS. Come to think about it, a module/extension which are capable of turning off/turning on the Wishlist/Reward functionallity would also be really helpful!

Newbie

Posts

Joined
Mon Nov 14, 2011 9:09 pm

Post by ifyouseek » Sun Dec 04, 2011 3:06 pm

So what you want is to remove the option to select country and region when registering and on the delivery address page? but you still want the country to be displayed on things like invoice and order history. I could do that as described above quite easily, there would be no need to delete any zone data from database. It's not a guess method, its just a far simpler way that rewriting a lot of core files.

For example, on the registration template page there is this code to select country:

Code: Select all

     <tr>
          <td><span class="required">*</span> Country:</td>
          <td><select name="country_id" onchange="$('select[name=\'zone_id\']').load('index.php?route=account/register/zone&country_id=' + this.value + '&zone_id=');">
              <option value=""> --- Please Select --- </option>
                                          <option value="1">Afghanistan</option>
                                                        <option value="2">Albania</option>
                                                        <option value="3">Algeria</option>
                                                        <option value="4">American Samoa</option>
                                                        <option value="5">Andorra</option>
                                                        <option value="6">Angola</option>
                                                        <option value="7">Anguilla</option>
                                                        <option value="8">Antarctica</option>
                                                        <option value="9">Antigua and Barbuda</option>
                                                        <option value="10">Argentina</option>
                                        </select>
            </td>
        </tr>
simply replace with something like this- (code 222 is for the UK)

Code: Select all

<input type="hidden" name="country_id" value="222" >
and you do the same with the region field- (value 3513 is for region Aberdeen in UK)

Code: Select all

 
<input type="hidden" name="zone_id" value="3513" >
There is several places you would need to make the changes-

1. registration page
2. Guest checkout form
3. checkout registration page / payment address / shipping address etc
4. account modify address book page

im sure there is a few other places but this is just off the top of my head

Active Member

Posts

Joined
Thu May 06, 2010 4:40 pm
Who is online

Users browsing this forum: No registered users and 53 guests