I imported 10000 product to my store after importing I am getting the following error when I try to open the product landing page
Fatal error: Allowed memory size of 88080384 bytes exhausted (tried to allocate 46 bytes) in [link] on line 2196
Any idea to fix?
--
Fatal error: Allowed memory size of 88080384 bytes exhausted (tried to allocate 46 bytes) in [link] on line 2196
Any idea to fix?
--
Try uninstalling the "New products" module or any other modules that may try to get all the products at one time.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.
Yup. I tried by un-installing the following module
Products Category v1.2.1
Display products of the same category on the product page
Now it working fine. But again when I install the module I get the same error. Any fix?
Products Category v1.2.1
Display products of the same category on the product page
Now it working fine. But again when I install the module I get the same error. Any fix?
The recently viewed products are stored in PrestaShop's cookie, whether or not the customer is logged in. I don't know why they wouldn't work, unless cookies aren't working on your site, but then customers wouldn't be able to log in at all.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.
By default, the "In the same category" gets 30 products in the same category. You could try reducing that number. For example, change line 51 of modules/productscategory/productscategory.php from:
to:
and lines 84-89 from:
to:
$sizeOfCategoryProducts = $category->getProducts(intval($cookie->id_lang), 1, 30, NULL, NULL, true);
to:
$sizeOfCategoryProducts = $category->getProducts(intval($cookie->id_lang), 1, 10, NULL, NULL, true);
and lines 84-89 from:
// If products tab higher than 30, slice it
if ($sizeOfCategoryProducts > 30)
{
$categoryProducts = array_slice($categoryProducts, $middlePosition - 15, 30, true);
$middlePosition = 15;
}
to:
// If products tab higher than 10, slice it
if ($sizeOfCategoryProducts > 10)
{
$categoryProducts = array_slice($categoryProducts, $middlePosition - 5, 10, true);
$middlePosition = 5;
}
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.
I tired your code now the page gets loaded with Products Category module but its taking huge time(>1 Min) to load the product page. Any comments??
Also Kindly see to the attachment which this thread. I got the error message when I tried to import products to the shop I dont know why so many products were not able to load into the store though all single and double quotes in all names and descriptions i mentioned as HTML Ascii code so that it wont clash with MySQL Syntax. Any fix for this?
Also Kindly see to the attachment which this thread. I got the error message when I tried to import products to the shop I dont know why so many products were not able to load into the store though all single and double quotes in all names and descriptions i mentioned as HTML Ascii code so that it wont clash with MySQL Syntax. Any fix for this?
Attached Files
I can't reproduce the problem with the "In the same category" module, but I don't have a huge number of products in any one category. It is the SQL query in the getProducts() function of classes/Category.php that gets the products. I guess it isn't efficient for huge catalogs. Perhaps it would be more efficient to split it into two queries, one that gets selects the categories and then one that joins all the tables together, instead of the current single query that joins all the tables together, then selects the categories.
The reason those product names are failing may be because they are longer than 128 characters, which is the maximum a product name is allowed to be, or they have symbols that are not allowed. What version of PrestaShop are you using? I'm using PrestaShop v1.3.1 and looking at the code, only <>;=#{} are not allowed. It seems many of those failed named have an ' or : though. If you are using an older version of PrestaShop, perhaps one of them is being disallowed.
The reason those product names are failing may be because they are longer than 128 characters, which is the maximum a product name is allowed to be, or they have symbols that are not allowed. What version of PrestaShop are you using? I'm using PrestaShop v1.3.1 and looking at the code, only <>;=#{} are not allowed. It seems many of those failed named have an ' or : though. If you are using an older version of PrestaShop, perhaps one of them is being disallowed.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.
I will try by modifying the query for "In the same category" as you said; and for the import issue, I am using latest stable version and many products with : is imported and also for ` i have converted to HTML code and then imported.
How do I change the character limit for Product Name. and what will be the best solution for me to upload product with :, ;, [] characters.
How do I change the character limit for Product Name. and what will be the best solution for me to upload product with :, ;, [] characters.
In my PrestaShop v1.3.1 installation, It is the isCatalogName() function in classes/Validate.php that checks for invalid characters in the product name:
You can change it to the following to allow ; in your product names:
To change the character limit is difficult. You will need to edit your database using phpMyAdmin and increase the size of the 'name' field in the 'ps_product' table from 128 to however many characters you need. Then edit classes/Product.php and change line 188:
Change the 128 after 'name' to the maximum number of characters you changed the name to be in the database.
return preg_match('/^[^<>;=#{}]*$/ui', $name);
You can change it to the following to allow ; in your product names:
return preg_match('/^[^<>=#{}]*$/ui', $name);
To change the character limit is difficult. You will need to edit your database using phpMyAdmin and increase the size of the 'name' field in the 'ps_product' table from 128 to however many characters you need. Then edit classes/Product.php and change line 188:
'meta_title' => 128, 'link_rewrite' => 128, 'name' => 128, 'available_now' => 255, 'available_later' => 255);
Change the 128 after 'name' to the maximum number of characters you changed the name to be in the database.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.
Fine will try now. By the way how about the character length. How can I increase the character length. I changed the field size in back-end any changes required in code-level.
See my previous post to increase the product name character limit. I updated it after posting and realising that I forgot to answer both your questions. I guess you only saw my first answer.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.
Cool.. Have got it now. Will try and let you know. Once I am done with all stuff i will share the store link for showcase :) Prestashop Rocks ...
How can I display price including tax.
When I use $product->price leads to same output as $product_wholesale_price why so?
When I use $product->price leads to same output as $product_wholesale_price why so?
I have no idea. Try using $product->getPrice(true) instead.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.
I want the value price with tax value in smarty I am calling all values from product object from PHP in foreach loop.
Also I have one more query.
In home page I implemented JQuery Tabs to each category for featured products now I want to display featured product for each category separately how to achieve this.
Now I am using
This returns all the homefeatured products under all categories but I need for specific category.
Also I have one more query.
In home page I implemented JQuery Tabs to each category for featured products now I want to display featured product for each category separately how to achieve this.
Now I am using
$category = new Category(1);
$products = $category->getProducts(1, 1, 6);
$smarty->assign(array('products' => $products, 'homeSize' => Image::getSize('home')));
This returns all the homefeatured products under all categories but I need for specific category.
Try the following:
This code will get the first 6 products from every category. You can then use code like the following in homefeatured.tpl:
$categories = Category::getSimpleCategories($params['cookie']->id_lang);
$products = array();
foreach ($categories as $category)
{
$categoryObj = new Category($category['id_category'], $params['cookie']->id_lang);
$products[$category['id_category']] = $categoryObj->getProducts($params['cookie']->id_lang, 1, 6);
}
$smarty->assign(array('cat_products' => $products, 'homeSize' => Image::getSize('home')));
This code will get the first 6 products from every category. You can then use code like the following in homefeatured.tpl:
{foreach from=$cat_products key=id_category item=products}
{foreach from=$products item=product}
- Product code goes here
{/foreach}
{/foreach}
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.
It's working on my test site. I don't know why it isn't working for you.
Check out Nethercott Constructions for PrestaShop guides and modules. Like us on Facebook for news updates.
Cool. Found the issue and fixed thanks a ton. I have few queries.
1. I want to mask the "Your Address" section from the registration page. I want to get only Email and Password alone in registration time remaining fields can be updated at any time from My Profile page
2. I want to have the friendly URL as /ean13-title-reference.html not like /id_product-title-reference.html How can I achieve this.
1. I want to mask the "Your Address" section from the registration page. I want to get only Email and Password alone in registration time remaining fields can be updated at any time from My Profile page
2. I want to have the friendly URL as /ean13-title-reference.html not like /id_product-title-reference.html How can I achieve this.



Back to top









