Is there any way to change the parameters of the coupon codes? I am switching over to OpenCart from Prestashop, and have a lot of coupons floating around out there that are more than 10 characters long, but as I'm inputting them into OpenCart I'm getting the error message that coupon codes need to be between 3 and 10 characters long. This is a pretty big problem, as these coupons won't expire for awhile and I need to be able to still honor them. Any place I can go in and tweak the maximum character allowance?
Thanks!!
Thanks!!
The field Coupon.Code is defined in the database as Varchar(10), so you will need to increase the size.
In admin/language/sale/coupon.php, you need to change:
...to suit your new size.
In admin/controller/sale/coupon.php, you need to change:
...to validate your new size.
That's it!
In admin/language/sale/coupon.php, you need to change:
Code: Select all
$_['error_code'] = 'Code must be between 3 and 10 characters!';
In admin/controller/sale/coupon.php, you need to change:
Code: Select all
if ((strlen(utf8_decode($this->request->post['code'])) < 3) || (strlen(utf8_decode($this->request->post['code'])) > 10)) {
That's it!
Free v1.4.9 Extensions: Default Specials | Improved Search | Customer Activity Report | Customer Groups | Royal Mail With Handling | Improved Product Page | Random Products | Stock Report | All Products
totally works - NOT.
i did these changes, and it lets me finally save without making a ruckus.
however, upon checking WHAT opencart saved, is actually the first 10 digits only of the code.
so the code changes in these php files actually dont make opencart save actual more digits but rather just cuts off things after 10 characters. what is the real solution for this? what else needs to be edited for opencart to swallow more than 10 digits?
i did these changes, and it lets me finally save without making a ruckus.
however, upon checking WHAT opencart saved, is actually the first 10 digits only of the code.
so the code changes in these php files actually dont make opencart save actual more digits but rather just cuts off things after 10 characters. what is the real solution for this? what else needs to be edited for opencart to swallow more than 10 digits?
its works fine
if your going to whine, then make sure you have more than a ounce of braincells and some gratitude for those who are helping you
Follow the above, and of course, edit the table PREFIX_coupon - making the varchar amount of the field 'code' more suitable (e.g. more than 10)
Regards
Matt
if your going to whine, then make sure you have more than a ounce of braincells and some gratitude for those who are helping you
Follow the above, and of course, edit the table PREFIX_coupon - making the varchar amount of the field 'code' more suitable (e.g. more than 10)
Regards
Matt
http://www.senses.co.uk
Senses Web Soltuions
Latest Releases:
http://www.personalisedcanvas.com/
http://www.stampedelytham.co.uk/
The above solution works fine.
You need to go into the PHPAdmin of the MySQL database your Opencart installation is using, click the Coupon table and edit the field "Code" (which will should show varchar(10) as the type) and change it to your desired length.
Don't forget to change your error message inside Admin/Language/English/Sale/Coupon.php !
You need to go into the PHPAdmin of the MySQL database your Opencart installation is using, click the Coupon table and edit the field "Code" (which will should show varchar(10) as the type) and change it to your desired length.
Don't forget to change your error message inside Admin/Language/English/Sale/Coupon.php !
Hi all,
Thank you for your provided solution. It works but I still have a problem.
I'm on OpenCart 1.5.1.3
I changed the Varchar on the database.
I also changed the php lines on both mentioned pages.
And it works... It creates the coupon with the new number of characters and it works also on the front end. But every time I try to create a coupon (insert coupon) in the backend it generates the error below when I click save.
Warning: Cannot modify header information - headers already sent by (output started at /home/thecashb/public_html/naderonics/OnlineStore/admin/language/english/sale/coupon.php:87) in /home/thecashb/public_html/naderonics/OnlineStore/system/engine/controller.php on line 28Warning: Cannot modify header information - headers already sent by (output started at /home/thecashb/public_html/naderonics/OnlineStore/admin/language/english/sale/coupon.php:87) in /home/thecashb/public_html/naderonics/OnlineStore/system/engine/controller.php on line 29
And although it generates this error, it still works creating the coupon. But obviously it doesn't take me back to the coupon page and say successfully created or anything!
Please please help!!
Thank you for your provided solution. It works but I still have a problem.
I'm on OpenCart 1.5.1.3
I changed the Varchar on the database.
I also changed the php lines on both mentioned pages.
And it works... It creates the coupon with the new number of characters and it works also on the front end. But every time I try to create a coupon (insert coupon) in the backend it generates the error below when I click save.
Warning: Cannot modify header information - headers already sent by (output started at /home/thecashb/public_html/naderonics/OnlineStore/admin/language/english/sale/coupon.php:87) in /home/thecashb/public_html/naderonics/OnlineStore/system/engine/controller.php on line 28Warning: Cannot modify header information - headers already sent by (output started at /home/thecashb/public_html/naderonics/OnlineStore/admin/language/english/sale/coupon.php:87) in /home/thecashb/public_html/naderonics/OnlineStore/system/engine/controller.php on line 29
And although it generates this error, it still works creating the coupon. But obviously it doesn't take me back to the coupon page and say successfully created or anything!
Please please help!!
Hi there, i too have been faced with Voucher codes which are over 10 characters in length. I followed the suggested process and it works but I do have a question for someone.
Before making the changes to the database and files I was running vqmod so that I could add multiple codes at once. This has now stopped working and I believe that there must be something else that I’d need to change in order to use the vqmod with the extra characters.
Has anyone else come across this?
Before making the changes to the database and files I was running vqmod so that I could add multiple codes at once. This has now stopped working and I believe that there must be something else that I’d need to change in order to use the vqmod with the extra characters.
Has anyone else come across this?
I managed to fix this after some testing. If you are using the vqmod for Batch Coupon Codes there is a file called vqmod_batch_coupn.xml there is 3 sections that you need to change the characters from 10 to for example 25. Once i did this i was able to upload longer voucher codes up to 25 characters and multiple amounts.
So far its working for me.
So far its working for me.
Initially I couldn't do it as my admin name was different then in language there was no file so I had to go into language/english then file. Also in Mysql DB changed it.
But finally made it. Thank You mystifier a ton for the way out
But finally made it. Thank You mystifier a ton for the way out
So, I'm having this same problem again, even though the code I altered is still intact -- that line of coupon.php reads
if ((utf8_strlen($this->request->post['code']) < 3) || (utf8_strlen($this->request->post['code']) > 25)) {
$this->error['code'] = $this->language->get('error_code');
Yet when I enter a coupon whose coupon code is longer than 10 characters, the system truncates it to only 10 characters. I need to be able to input longer coupon codes so they match my gift card codes; do I need to be altering the code somewhere else as well?
if ((utf8_strlen($this->request->post['code']) < 3) || (utf8_strlen($this->request->post['code']) > 25)) {
$this->error['code'] = $this->language->get('error_code');
Yet when I enter a coupon whose coupon code is longer than 10 characters, the system truncates it to only 10 characters. I need to be able to input longer coupon codes so they match my gift card codes; do I need to be altering the code somewhere else as well?
Scroll up to post by "s3d » Sat Jul 23, 2011 3:15 pm", there is your answerYarniaPDX wrote:So, I'm having this same problem again, even though the code I altered is still intact -- that line of coupon.php reads
if ((utf8_strlen($this->request->post['code']) < 3) || (utf8_strlen($this->request->post['code']) > 25)) {
$this->error['code'] = $this->language->get('error_code');
Yet when I enter a coupon whose coupon code is longer than 10 characters, the system truncates it to only 10 characters. I need to be able to input longer coupon codes so they match my gift card codes; do I need to be altering the code somewhere else as well?
Followed This for OC 1.5.6
And This
I changed the length to 15
Thanks for this thread
The field Coupon.Code is defined in the database as Varchar(10), so you will need to increase the size.
In admin/language/sale/coupon.php, you need to change:
CODE: SELECT ALL
$_['error_code'] = 'Code must be between 3 and 10 characters!';
...to suit your new size.
In admin/controller/sale/coupon.php, you need to change:
CODE: SELECT ALL
if ((strlen(utf8_decode($this->request->post['code'])) < 3) || (strlen(utf8_decode($this->request->post['code'])) > 10)) {
...to validate your new size.
That's it!
And This
I found the setting through my PHP Admin>OC_COUPON>COLUMNS>CODEFollow the above, and of course, edit the table PREFIX_coupon - making the varchar amount of the field 'code' more suitable (e.g. more than 10)
I changed the length to 15
Thanks for this thread
Hi. I was google searching for this issue. I'm using 2.2.0.0. and need to expand the limit. Where is this PREFIX_coupon setting? I've edited both php and language file and it's still giving me the same max 10 feedback. Maybe the server is slow and will turn out fine in a few hours, it's not the first time changes take time. Anyway, where is that table thing? Please.s3d wrote: ↑Sun Jul 24, 2011 4:15 amits works fine
if your going to whine, then make sure you have more than a ounce of braincells and some gratitude for those who are helping you
Follow the above, and of course, edit the table PREFIX_coupon - making the varchar amount of the field 'code' more suitable (e.g. more than 10)
Regards
Matt
Thank you for your support,
Ana.
Who is online
Users browsing this forum: No registered users and 97 guests