Post by alex067 » Wed Nov 29, 2017 11:29 am

I have an extension that removed the billing address step in checkout, but my step # now is:
step 1: checkout
step 3: payment

can I change the step # via language file?

New member

Posts

Joined
Wed Jul 12, 2017 9:50 am

Post by straightlight » Wed Nov 29, 2017 11:50 am

OC version not posted. However,

Code: Select all

$data['text_checkout_option'] = sprintf($this->language->get('text_checkout_option'), 1);
		$data['text_checkout_account'] = sprintf($this->language->get('text_checkout_account'), 2);
		$data['text_checkout_payment_address'] = sprintf($this->language->get('text_checkout_payment_address'), 2);
		$data['text_checkout_shipping_address'] = sprintf($this->language->get('text_checkout_shipping_address'), 3);
		$data['text_checkout_shipping_method'] = sprintf($this->language->get('text_checkout_shipping_method'), 4);
		
		if ($this->cart->hasShipping()) {
			$data['text_checkout_payment_method'] = sprintf($this->language->get('text_checkout_payment_method'), 5);
			$data['text_checkout_confirm'] = sprintf($this->language->get('text_checkout_confirm'), 6);
		} else {
			$data['text_checkout_payment_method'] = sprintf($this->language->get('text_checkout_payment_method'), 3);
			$data['text_checkout_confirm'] = sprintf($this->language->get('text_checkout_confirm'), 4);	
		}
catalog/controller/checkout/checkout.php file. Each number you see at the end of each lines represents the step number.

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

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member
Online

Posts

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

Post by Johnathan » Wed Nov 29, 2017 11:31 pm

You should change this in the language file, not the controller file. The relevant one is this one:

/catalog/language/YOURLANGUAGE/checkout/checkout.php

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by straightlight » Wed Nov 29, 2017 11:35 pm

The last indicated question on the first post was about:
can I change the step # via language file?
which the answer is no. The step number is located in the controller itself rather than the language file. The language file only contains the %s with the defined text but does not contain the step number.

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

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member
Online

Posts

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

Post by Johnathan » Wed Nov 29, 2017 11:48 pm

I still recommend changing it in the language file itself, and hard-coding it in there (in place of the %s strings). Editing a language file is preferable to editing a controller file, since controller file edits can conflict with other modifications, and are harder to redo if you upgrade OpenCart in the future. In my experience, language file edits tend to be safer than controller file edits.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 89 guests