Jump to content

Resolved - Change to address items


Robin Somes

Recommended Posts

Using CC 6.05 and All-In-One Shipping. When a customer goes through to Checkout and enters their address details, they are summarised on the following page. But the country is displayed as the 2-letter ISO code, rather than the name of the country (image below). Which file do I need to edit to display the country rather than the ISO code, on that page and on others?

TIA,

Robin

Image1.jpg

Link to comment
Share on other sites

In the template file content.checkout.confirm.php, find the instances of {$BILLING.country_iso} and {$DELIVERY.country_iso} and change the country_iso to just country. That should do it.

You may need to clear the CubeCart cache in admin, Maintenance, Rebuild tab because we made an edit to a skin file.

Link to comment
Share on other sites

In the template file content.checkout.confirm.php, find the instances of {$BILLING.country_iso} and {$DELIVERY.country_iso} and change the country_iso to just country. That should do it.

You may need to clear the CubeCart cache in admin, Maintenance, Rebuild tab because we made an edit to a skin file.

​Very nearly. It now shows the ISO 3-digit number, rather than the country or the ISO 2-letter code. I've run out of time this afternoon, so I'll resume tomorrow. But for now, many thanks for pointing me in the right direction.

R

Link to comment
Share on other sites

Well. You would think there would be some sense to this.

In the file /classes/cubecart.class.php, near line 877, find:

$this->_basket['billing_address'] = array(

In this array, 'country' and 'country_id' are both being assigned the country's iso numcode, presumably. (Such as USA=840, UK=826, Ireland=372)

Instead of changing one of the redundant elements, for fear of breaking something else, let's add an array element 'country_name'.

'country_name'  => getCountryFormat($_POST['billing']['country'], 'numcode', 'name'),

Be careful to note which statements have a final comma and which do not. Only the last element in the array declaration can go without a trailing comma.

Do the same for the next 'delivery' array.

Link to comment
Share on other sites

  • 1 month later...

We could extract the country name from the $COUNTRIES associative array but the smarty code is heavy going

I suspect the 'country' attribute was intended for this purpose but as Brian (?) says, safer to create the new attribute

Also (not checked yet) the same change probably needs applying to the delivery address

Github issue #693 raised

I am relatively new to Cubecart so apologies if that was inappropriate 

Link to comment
Share on other sites

Hi Nathan

Definitely no apologies needed - these forums are great for asking about an issue, hopefully getting an answer if it is functioanlity related or getting others to verify that it is actually a bug when it can / should then be added as a git issue so it can be fixed so core file changes are not needed.  Getting confirmation from at least one other person is important so that the git issues list doesnt get clogged up with non bugs so thanks for adding it

Ian

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...