How many option values can be in option in Opencart - opencart

I am using Opencart 1.5.6.4. I stuck on strange issue. Lemme tell you about that a bit.
I added 16 options in the option tab without option values and when I tried adding the 17th option in the option tab it didn't let me do so. I deleted one and then tried with other and it is added successfully. In short i can't add more than 16 options in option tab in product page.
So my first question is that -> what I assuming is it true as i can't add the 17th option here.
Also Inside product in option tab under how many values can i can define for one option.
My question is that is there any limitation in the number of option values for option? If yes then how many, and can increase it?

There is no limitation on options or option values in Opencart. In all likelihood you are hitting a limit on the php post_max_size directive. Depending on your server configuration you might be able to increase it in a local php.ini file, in .htaccess, or if not contact your server admin and ask them to do so.

I added these lines to my php.ini file in the root & admin folder and the problem is solved!
max_input_vars = 50000;
suhosin.post.max_vars = 10000;
suhosin.request.max_vars = 10000;
max_input_nesting_level = 256;
upload_max_filesize = 256M;
max_input_time = 60;

Related

opencart: I can edit order but cannot delete it. (with Error log)

I use opencart version 2.1.0.1
Everytime I click admin > sales > order, it will pop up "error undefined." By closing that popup window, I can still edit order but cannot delete order (no response).
In my log, there is:
PHP Notice: Undefined variable: order_id in
/var/www/html/opencart2101/system/storage/modification/admin/view/template/sale/order_list.tpl on line 821
The line 821 is:
url: 'index.php?route=extension/openbay/addorderinfo&token=<?php echo $token; ?>&order_id=<?php echo $order_id; ?>&status_id=' + status_id,
However, I haven't installed any openbay related module. Also, line 821 is inside <!-- --> mark. It should have no effect.
Help!
Although this is now an older version of opencart, I still see this being reported a lot around and about.
The problem occurs due to the store front adding the http url rather than the https url to the order. So firstly you need to fix that. If you dont want to read all of my explanation, you can just hit up the bold points :)
Either way BACKUP EVERYTHING actually not really, back up the file you are going to edit and backup your whole database.
open:
catalog/controller/checkout/confirm.php at around line 100
Find:
$order_data['store_url'] = HTTP_SERVER;
Change to:
$order_data['store_url'] = HTTPS_SERVER;
Now you will want to fix your database because for reasons I cannot fathom, the domain name is placed in the order along with the stores id. and when editing orders it is the usage of that directly within your admin order page that throws up the undefined notice. Basically the browser blocks the request because its trying to make an insecure request from a secure page.
Crack open phpmyadmin or whatever database tool you have on hand.
locate the table, default is oc_orders
Browsing the table, look for the column that contains your store url (i cant remember the name off hand, i think its just store_url but it will be obvious anyway. if you are multi store you will need to run the query for each
I am sure somebody can come up with a clever way to automatically convert just the http into https with a single use sql query on the one column, but this works for me.
Run SQL: adjust as appropriate
UPDATE `oc_orders` SET `store_url` = 'https://example.com' WHERE store_id = 0;

How to add a new language in Sitecore 8?

I'm working on Sitecore 8 and want to add a new language but Im having a message:
The spell checker dictionary does not exist.
Could you please help me?
All the dictionary files are stored in sitecore\shell\Controls\Rich Text Editor\Dictionaries\ directory.
There is no en-AU dictionary there by default (there are en-UK and en-US dictionaries). You can use one of them I guess. Or you can try google en-AU and use something from the Internet "en-AU.tdf" google search.
I had the same issue. I was able to resolve it by editing the "InvalidItemNameChars" setting temporarily.
Our project had a patch for InvalidItemNameChars like this:
This setting is usually in web.config. If you don't find it there, check "/sitecore/admin/showconfig.aspx" for InvalidItemNameChars.
I had to remove the '-' from the value and create the language. You will not get the error on not selecting the spell checker. You can leave it empty.
Once you are done creating the language add the '-' back to the config (in my case it was a patch config).

Cpanel overwrites amazon SES entries in exim.conf

I need to add some additional configurations on my exim.conf file. But it will get overwrited after some time automatically. I read in some other forum to add entries via exim configuration editor in cpanel. But, on that editor, i cant add such entries. It only allows to select a field and its value only. How can i add custom entries?
begin authenticators
ses_login:
driver = plaintext
public_name = LOGIN
client_send = :
===========
begin routers
send_via_ses:
driver = manualroute
domains = ! +local_domains
transport = ses_smtp
route_list = * email-smtp.us-east-1.amazonaws.com
========
begin transports
#entry for amazon
ses_smtp:
driver = smtp
port = 25
hosts_require_auth = $host_address
hosts_require_tls = $host_address
Entry is something like the above entry. How can i resolve this?
In the Exim Advanced config edit, you can add them.
For the auth, search for the bold text "Section: AUTH" -- there is a text area below it... enter in the "ses_login" details.
For the routers, search for the bold text "Section: PREROUTERS" -- there is a text area below it... enter in the "send_via_ses" details.
Lastly, for the transports, search for the bold text "Section: TRANSPORTSTART" -- there is a text area below it... enter in the "ses_smtp" details.
Once you are finished, scroll all the way down and save your config.. It should now be maintained in your /etc/exim.conf.
You can go to /etc/exim.conf.local which is the customization file for Cpanel. You will find all sections described by half crazed.
In fact, the Advanced configuration page for exim stores all the custom data in exim.conf.local
Since the file is super small, it helps to quickly implement changes and test.

How to change indentation mode in Atom?

I haven't been able to figure this out yet. Atom seems to use spaces as the default indentation mode. I prefer to have tabs instead though. Sublime Text has built in functionality for switching and converting indentation.
Anyone found out how to change the indentation mode of Atom?
Some screenshots from Sublime Text:
See Soft Tabs and Tab Length under Settings > Editor Settings.
To toggle indentation modes quickly you can use Ctrl-Shift-P and search for Editor: Toggle Soft Tabs.
Go to File -> Settings
There are 3 different options here.
Soft Tabs
Tab Length
Tab Type
I did some testing and have come to these conclusions about what each one does.
Soft Tabs - Enabling this means it will use spaces by default (i.e. for new files).
Tab Length - How wide the tab character displays, or how many spaces are inserted for a tab if soft tabs is enabled.
Tab Type - This determines the indentation mode to use for existing files. If you set it to auto it will use the existing indentation (tabs or spaces). If you set it to soft or hard, it will force spaces or tabs regardless of the existing indentation. Best to leave this on auto.
Note: Soft = spaces, hard = tab
Add this to your ~/.atom/config.cson
editor:
tabLength: 4
OS X:
Go to Atom -> prefrences or CMD + ,
Scroll down and select "Tab Length" that you prefer.
You could try going to "Atom > Preferences > Editor" and set Tab length to 4.
This is for mac. For windows you will have to find the appropriate menu.
Adding #Manbroski answer here that worked for me:
try Ctrl-Shift-P Editor: Toggle Soft Tabs
Late to the party, but a clean way to do this on a per-project basis, is to add a .editorconfig file to the root of the project. Saves you from having to change Atom's settings when you're working on several projects simultaneously.
This is a sample of a very basic setup I'm currently using. Works for Atom, ST, etc...
http://editorconfig.org/
# Automatically add new line to end of all files on save.
[*]
insert_final_newline = true
# 2 space indentation for SASS/CSS
[*.{scss,sass,css}]
indent_style = space
indent_size = 2
# Set all JS to tab => space*2
[js/**.js]
indent_style = space
indent_size = 2
This is built into core: See Settings ⇒ Tab Type and choose auto:
When set to "auto", the editor auto-detects the tab type based on the contents of the buffer (it uses the first leading whitespace on a non-comment line), or uses the value of the Soft Tabs config setting if auto-detection fails.
You may also want to take a look at the Auto Detect Indentation package. From the docs:
Automatically detect indentation of opened files. It looks at each opened file and sets file specific tab settings (hard/soft tabs, tab length) based on the content of the file instead of always using the editor defaults.
You might have atom configured to use 4 spaces for tabs but open a rails project which defaults to 2 spaces. Without this package, you would have to change your tabstop settings globally or risk having inconsistent lead spacing in your files.
I just had the same problem, and none of the suggestions above worked. Finally I tried unchecking "Atomic soft tabs" in the Editor Settings menu, which worked.
If you are using the version 1.21.1:
Click on Packages / Settings View / Open
Select "Editor" on the left side panel
Scrool down until you see "Tab Length"
Edit the value. I like to set it to 4.
Now, just close the active tab pane and you are done.
Tab Control gives nice control in a similar manner to that described in your question.
Also nice, for JavaScript developers, is ESLint Tab Length for using ESLint config.
Or if you're using an .editorconfig for defining project-specific indentation rules, there is EditorConfig
If you're using Babel you may also want to make sure to update your "Language Babel" package. For me, even though I had the Tab Length set to 2 in my core editor settings, the Same setting in the Language Babel config was overriding it with 4.
Atom -> Preferences -> Packages -> (Search for Babel) -> Grammar -> Tab Length
Make sure the appropriate Grammar, There's "Babel ES6 Javascript Grammar", "language-babel-extension Grammar" as well as "Regular Expression". You probably want to update all of them to be consistent.
If global tab/spaces indentation settings no longer fit your needs (I.E. you find yourself working with legacy codebases with varied indentation formats, and you need to quickly switch between them, and the auto-detect isn't working) you might try the tab-control plugin, which sort of duplicates the functionality of the menu in your screenshot.
When Atom auto-indent-detection got it hopelessly wrong and refused to let me type a literal Tab character, I eventually found the 'Force-Tab' extension - which gave me back control.
I wanted to keep shift-tab for outdenting, so set ctrl-tab to insert a hard tab. In my keymap I added:
'atom-text-editor':
'ctrl-tab': 'force-tab:insert-actual-tab'
Changing language-specific configuration
I changed the default tab settings, and it still did not impact when I was editing my files, which were Python files. It also did not change when I modified the "*" setting in ~/.atom/config.cson . I don't have a good explanation for either of those.
However, when I added the following to my config.cson, I was able to change the tab in my Python files to 2 spaces:
'.source.python':
editor:
tabLength: 2
Thanks to this resource for the solution: Tab key not respecting tab length
All of the most popular answers on here are all great answers and will turn on spaces for tabs, but they are all missing one thing. How to apply the spaces instead of tabs to existing code.
To do this simply select all the code you want to format, then go to Edit->Lines->Auto Indent and it will fix everything selected.
Alternatively, you can just select all the code you want to format, then use Ctrl Shift P and search for Auto Indent. Just click it in the search results and it will fix everything selected.
Yet another answer: If you are using Atom Beautify note that it has its own settings to determine the "Indent Char".

Magento: changed layout to the default one and admin crashed absolutely

Went to Configuration - Design and changed everything at template section to Default.
After that I het this at each admin page.
Fatal error: Call to a member function setActive() on a non-object in /home/white/public_html/app/code/core/Mage/Adminhtml/Controller/Action.php on line 96
No I can't even turn it back! How to fix it? How to turn it back at least... Maybe directly through MySQL
Also, Magento was updated from 1.5 to 1.6 not so far.
Have a look at the table core_config_data
I do not recall the exact configuration paths, so you could do something like this:
SELECT * FROM core_config_data WHERE path like "%theme%"
SELECT * FROM core_config_data WHERE path like "%skin%"
This will show you the currente theme and skin configuration settings. Then you can use an
UPDATE core_config_data SET value = "workingskin" WHERE path = "configuration/path/goes/here"
to change the skin and theme. (the path must be replaced by what you just found out using the above SELECT.