OC 2.3.0.2.
Sorry not feeling well and I had a quick change that I thought was simple but it isn't working (brain fog?).
I would like to make a change to the checkout.tpl file.
I was trying to add a small amount of code only if the square payment extension was enabled. So I put this code in the checkout.tpl file.
<?php if ($this->config->get('squareup_status')) {
Echo 'Square is in testing mode only - please don't use.';
} ?>
It gives me "Call to a member function get() on null"
What am I missing?
Mike
Sorry not feeling well and I had a quick change that I thought was simple but it isn't working (brain fog?).
I would like to make a change to the checkout.tpl file.
I was trying to add a small amount of code only if the square payment extension was enabled. So I put this code in the checkout.tpl file.
<?php if ($this->config->get('squareup_status')) {
Echo 'Square is in testing mode only - please don't use.';
} ?>
It gives me "Call to a member function get() on null"
What am I missing?
Mike
Last edited by Cue4cheap on Mon Jan 08, 2024 10:24 pm, edited 2 times in total.
cue4cheap not cheap quality
You could change the extension title directly from the language file instead of adding a code to display a text in the checkout.tpl file.Cue4cheap wrote: ↑Sun Jan 07, 2024 12:11 amOC 2.3.0.2.
Sorry not feeling well and I had a quick change that I thought was simple but it isn't working (brain fog?).
I would like to make a change to the checkout.tpl file.
I was trying to add a small amount of code only if the square payment extension was enabled. So I put this code in the checkout.tpl file.
<?php if ($this->config->get('squareup_status')) {
Echo 'Square is in testing mode only - please don't use.';
} ?>
It gives me "Call to a member function get() on null"
What am I missing?
Mike
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Understood but wish to use that example for other things later so would like a working example.straightlight wrote: ↑Sun Jan 07, 2024 1:13 amYou could change the extension title directly from the language file instead of adding a code to display a text in the checkout.tpl file.Cue4cheap wrote: ↑Sun Jan 07, 2024 12:11 amOC 2.3.0.2.
Sorry not feeling well and I had a quick change that I thought was simple but it isn't working (brain fog?).
I would like to make a change to the checkout.tpl file.
I was trying to add a small amount of code only if the square payment extension was enabled. So I put this code in the checkout.tpl file.
<?php if ($this->config->get('squareup_status')) {
Echo 'Square is in testing mode only - please don't use.';
} ?>
It gives me "Call to a member function get() on null"
What am I missing?
Mike
Thank you,
Mike
cue4cheap not cheap quality
By creating an event from the checkout page, that can also be accomplished by validating the shipping_address of the session_data or by editing the extension model title with IF conditions as per the above and one you can add. This can be achieved in multiple ways.Cue4cheap wrote: ↑Sun Jan 07, 2024 1:21 amUnderstood but wish to use that example for other things later so would like a working example.straightlight wrote: ↑Sun Jan 07, 2024 1:13 amYou could change the extension title directly from the language file instead of adding a code to display a text in the checkout.tpl file.Cue4cheap wrote: ↑Sun Jan 07, 2024 12:11 amOC 2.3.0.2.
Sorry not feeling well and I had a quick change that I thought was simple but it isn't working (brain fog?).
I would like to make a change to the checkout.tpl file.
I was trying to add a small amount of code only if the square payment extension was enabled. So I put this code in the checkout.tpl file.
<?php if ($this->config->get('squareup_status')) {
Echo 'Square is in testing mode only - please don't use.';
} ?>
It gives me "Call to a member function get() on null"
What am I missing?
Mike
Thank you,
Mike
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Code: Select all
<?php if ($this->config->get('payment_squareup_status')) {
echo '...';
?>
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
I'm a bit better but that code didn't work for me in the .tpl file so I did it the more proper way, in the controller file.straightlight wrote: ↑Sun Jan 07, 2024 3:36 amCode: Select all
<?php if ($this->config->get('payment_squareup_status')) { echo '...'; ?>
Thank you for your input.
Mike
cue4cheap not cheap quality
So you knew the proper way to do it but decided to try and hack it? Tut tut.
TPL files don't have access to anything other than the data passed to them from the controller, that's why it didn't work.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Yeah.... sometimes you do something that should be the fast way and when it doesn't work it, drives you crazy no matter if you know the other way to do it.paulfeakins wrote: ↑Mon Jan 08, 2024 6:29 pmSo you knew the proper way to do it but decided to try and hack it? Tut tut.
TPL files don't have access to anything other than the data passed to them from the controller, that's why it didn't work.
Plus it was supposed to just be for one store, that has low traffic, and since that store is the only one using that template I figured 'easy way to isolate'.
Mike
cue4cheap not cheap quality
Who is online
Users browsing this forum: No registered users and 59 guests