Can't load product for free product

I am trying to add a free product to orders over $25 but I can’t get the products to load so I can select the one I need. I would imaging it is because I have 5000 products so the database may be too large for it to work. I did get it to work in the past last year but it took forever to load and I had about 1000 less products then. The page will constantly load without pulling up any product list. Is there a workaround?

You have something wrong on your store. Investigate your PHP error_log file and your browser's error console.

5000 products is nothing. I have a client with over 120K.



I will guess that you are running on a server without enough resources to run your store as you have it configured. So you are probably exceeding memory limits or other resource issue.

[quote name='tbirnseth' timestamp='1319003686' post='124026']

You have something wrong on your store. Investigate your PHP error_log file and your browser's error console.

5000 products is nothing. I have a client with over 120K.



I will guess that you are running on a server without enough resources to run your store as you have it configured. So you are probably exceeding memory limits or other resource issue.

[/quote]



The store functions properly other than that. I think I have plenty of resources considering this summer I had problems after an update and CS kept telling me that over and over. So I kept upgrading servers over and over. Come to find out there was some database corruption that was causing the issue. Which I always suspected since the store ran perfectly fine before the update to the cart. I now have 5GB of ram with 10GB of burst ram so I wouldn't think that would be the issue but maybe some setting is wrong. I actually had Jesse Lee go through and tweak the site too in order to make sure all was working up to its potential.

I assume you have looked in the first port of call and checked your config.local.php file at the root of your store to check the php memory limit setting, optimise the database as well as flushed the cache?

[quote name='StellarBytes' timestamp='1320459706' post='125361']

I assume you have looked in the first port of call and checked your config.local.php file at the root of your store to check the php memory limit setting, optimise the database as well as flushed the cache?

[/quote]



Well I assume the pro set up my php memory limit correctly. I've played with it in the past but I would think that would be one of the things he went through when optimizing the site. I did optimize the database and clear the cache with no luck. It will literally sit with the “loading” icon at the top the screen for a day if I let it without pulling up any products.

An AJAX request is probably failing and that tends to freeze up the rest of the processing. Check your PHP error_log to look for errors that happen at the time of the request.

[quote name='tbirnseth' timestamp='1320463409' post='125366']

An AJAX request is probably failing and that tends to freeze up the rest of the processing. Check your PHP error_log to look for errors that happen at the time of the request.

[/quote]



Well here is what my log says when I last tried to run it:

[quote][04-Nov-2011 22:38:28] PHP Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 81 bytes) in /home/fastdeca/public_html/shop/prepare.php on line 182[/quote]



And line 182 is:


				$data[$k] = ($revert == false) ? htmlspecialchars($sub, ENT_QUOTES, 'UTF-8') : htmlspecialchars_decode($sub, ENT_QUOTES);

Search your config.local.php file for 'memory_limit' and change the value to '96M' from '64M'.

[quote name='tbirnseth' timestamp='1320465892' post='125375']

Search your config.local.php file for 'memory_limit' and change the value to '96M' from '64M'.

[/quote]

Here's the funny thing:


// @ini_set('memory_limit', '1024M');

Why is having the line commented out funny? I must be missing something. When it's commented out, it means it is using the default for your server which is probably 64M.

[quote name='tbirnseth' timestamp='1320466371' post='125378']

Why is having the line commented out funny? I must be missing something. When it's commented out, it means it is using the default for your server which is probably 64M.

[/quote]

I guess I don't understand how or why it is like that. It is just WAY above what you said to change it to. But if it's commented out that does me no good. Not sure how to change it other than in that file. How it appears in my file:


// Set maximum memory limit
// @ini_set('memory_limit', '1024M');

// Set maximum time limit for script execution
@set_time_limit(3600);

[quote name='tbirnseth' timestamp='1320466371' post='125378']

Why is having the line commented out funny? I must be missing something. When it's commented out, it means it is using the default for your server which is probably 64M.

[/quote]



Okay, updated my php.ini file to 96M and it works now. Thanks…I appreciate you helping me out.



Jacy

change // @ini_set('memory_limit', '1024M'); to @ini_set('memory_limit', '96M'); if there's still a problem, then change it to @ini_set('memory_limit', '128M'); and so forth.



Memory needs differ between sites but are related to the number of categories, products, use of filters, features and options, etc. Nothing to worry about.



Someone changed it to a large value and then commented out their change. Just uncomment and set to meet your needs.