tekexplore Posted September 5, 2010 Share Posted September 5, 2010 I imported 10000 product to my store after importing I am getting the following error when I try to open the product landing pageFatal error: Allowed memory size of 88080384 bytes exhausted (tried to allocate 46 bytes) in [link] on line 2196Any idea to fix?-- Link to comment Share on other sites More sharing options...
rocky Posted September 5, 2010 Share Posted September 5, 2010 Try uninstalling the "New products" module or any other modules that may try to get all the products at one time. Link to comment Share on other sites More sharing options...
tekexplore Posted September 5, 2010 Author Share Posted September 5, 2010 Yup. I tried by un-installing the following moduleProducts Category v1.2.1Display 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? Link to comment Share on other sites More sharing options...
tekexplore Posted September 6, 2010 Author Share Posted September 6, 2010 I am also not getting the Recently Viewed Products in my shop... any idea???? Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 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. Link to comment Share on other sites More sharing options...
rocky Posted September 6, 2010 Share Posted September 6, 2010 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: $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; } Link to comment Share on other sites More sharing options...
tekexplore Posted September 6, 2010 Author Share Posted September 6, 2010 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? Import_Error.pdf Link to comment Share on other sites More sharing options...
rocky Posted September 7, 2010 Share Posted September 7, 2010 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. Link to comment Share on other sites More sharing options...
tekexplore Posted September 7, 2010 Author Share Posted September 7, 2010 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. Link to comment Share on other sites More sharing options...
rocky Posted September 7, 2010 Share Posted September 7, 2010 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: 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. Link to comment Share on other sites More sharing options...
tekexplore Posted September 7, 2010 Author Share Posted September 7, 2010 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. Link to comment Share on other sites More sharing options...
rocky Posted September 7, 2010 Share Posted September 7, 2010 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. Link to comment Share on other sites More sharing options...
tekexplore Posted September 7, 2010 Author Share Posted September 7, 2010 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 ... Link to comment Share on other sites More sharing options...
tekexplore Posted September 8, 2010 Author Share Posted September 8, 2010 How can I display price including tax. When I use $product->price leads to same output as $product_wholesale_price why so? Link to comment Share on other sites More sharing options...
rocky Posted September 9, 2010 Share Posted September 9, 2010 I have no idea. Try using $product->getPrice(true) instead. Link to comment Share on other sites More sharing options...
tekexplore Posted September 9, 2010 Author Share Posted September 9, 2010 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 $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. Link to comment Share on other sites More sharing options...
rocky Posted September 9, 2010 Share Posted September 9, 2010 Try the following: $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} Link to comment Share on other sites More sharing options...
tekexplore Posted September 9, 2010 Author Share Posted September 9, 2010 I tried the above code its not returning any products. Link to comment Share on other sites More sharing options...
rocky Posted September 9, 2010 Share Posted September 9, 2010 It's working on my test site. I don't know why it isn't working for you. Link to comment Share on other sites More sharing options...
tekexplore Posted September 9, 2010 Author Share Posted September 9, 2010 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 page2. I want to have the friendly URL as /ean13-title-reference.html not like /id_product-title-reference.html How can I achieve this. Link to comment Share on other sites More sharing options...
rocky Posted September 10, 2010 Share Posted September 10, 2010 1. You will need to comment out all the address code in authentication.php and authentication.tpl. Change lines [spam-filter]131 of authentication.php (in PrestaShop v1.3.1) to: /* $address = new Address(); $address->id_customer = 1; $errors = array_unique(array_merge($errors, $address->validateControler())); if (!sizeof($errors)) { if (!$country = new Country($address->id_country) OR !Validate::isLoadedObject($country)) die(Tools::displayError()); if (intval($country->contains_states) AND !intval($address->id_state)) $errors[] = Tools::displayError('this country require a state selection'); else { */ $customer->active = 1; if (!$customer->add()) $errors[] = Tools::displayError('an error occurred while creating your account'); else { /* $address->id_customer = intval($customer->id); if (!$address->add()) $errors[] = Tools::displayError('an error occurred while creating your address'); else { */ if (!Mail::Send(intval($cookie->id_lang), 'account', 'Welcome!', array('{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{email}' => $customer->email, '{passwd}' => Tools::getValue('passwd')), $customer->email, $customer->firstname.' '.$customer->lastname)) $errors[] = Tools::displayError('cannot send email'); $smarty->assign('confirmation', 1); $cookie->id_customer = intval($customer->id); $cookie->customer_lastname = $customer->lastname; $cookie->customer_firstname = $customer->firstname; $cookie->passwd = $customer->passwd; $cookie->logged = 1; $cookie->email = $customer->email; Module::hookExec('createAccount', array( '_POST' => $_POST, 'newCustomer' => $customer )); if ($back) Tools::redirect($back); // } } // } // } Link to comment Share on other sites More sharing options...
rocky Posted September 10, 2010 Share Posted September 10, 2010 and lines 142-211 of authentication.tpl to: {* {l s='Your address'} {l s='Company'} <input type="text" class="text" id="company" name="company" value="{if isset($smarty.post.company)}{$smarty.post.company}{/if}" /> {l s='First name'} <input type="text" class="text" id="firstname" name="firstname" value="{if isset($smarty.post.firstname)}{$smarty.post.firstname}{/if}" /> * {l s='Last name'} <input type="text" class="text" id="lastname" name="lastname" value="{if isset($smarty.post.lastname)}{$smarty.post.lastname}{/if}" /> * {l s='Address'} <input type="text" class="text" name="address1" id="address1" value="{if isset($smarty.post.address1)}{$smarty.post.address1}{/if}" /> * {l s='Address (2)'} <input type="text" class="text" name="address2" id="address2" value="{if isset($smarty.post.address2)}{$smarty.post.address2}{/if}" /> {l s='Postal code / Zip code'} <input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}" /> * {l s='City'} <input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" /> * {l s='Country'} - {foreach from=$countries item=v} {$v.name|escape:'htmlall':'UTF-8'} {/foreach} * {l s='State'} - * {l s='Additional information'} <textarea name="other" id="other" cols="26" rows="3">{if isset($smarty.post.other)}{$smarty.post.other}{/if}</textarea> {l s='Home phone'} <input type="text" class="text" name="phone" id="phone" value="{if isset($smarty.post.phone)}{$smarty.post.phone}{/if}" /> {l s='Mobile phone'} <input type="text" class="text" name="phone_mobile" id="phone_mobile" value="{if isset($smarty.post.phone_mobile)}{$smarty.post.phone_mobile}{/if}" /> {l s='Assign an address title for future reference'} ! <input type="text" class="text" name="alias" id="alias" value="{if isset($smarty.post.alias)}{$smarty.post.alias}{else}{l s='My address'}{/if}" /> * *} 2. It's very difficult to do, since PrestaShop rewrites the URL to product.php?id_product=1. The file product.php is expecting a product ID, not an EAN13, and so it won't be able to find the product. You'd need to modify product.php so that it uses the EAN13 to create the product object instead of the product ID. There's a good chance that there is other code that depends on having the product ID in the URL, so you'll probably end up breaking something. Link to comment Share on other sites More sharing options...
tekexplore Posted September 12, 2010 Author Share Posted September 12, 2010 Cool.. Finally found a solution to implement the friendly URL with out product id its working fine. I have few queries,1. I have 2 Carriers in backend and assigned to Country INDIA but during checkout process it shows No Carriers Assigned to this country any Fix?2. I have set the product price Round Off at backend but itseems to be not working in front-end display any fix? Link to comment Share on other sites More sharing options...
rocky Posted September 13, 2010 Share Posted September 13, 2010 1. Go to the Shipping tab, select the carrier in the dropdown, then click "Save". If you forget to save the prices for a carrier, you will get that error message.2. Perhaps the theme is incompatible with your version of PrestaShop. Which theme are you using? Was is designed for PrestaShop v1.3.1 or v1.2.5? Link to comment Share on other sites More sharing options...
tekexplore Posted September 13, 2010 Author Share Posted September 13, 2010 Yup. I did the same. I selected the Carrier from the dropdown and saved the price range for that particular carrier but still I am not getting it. I am using the default prestashop theme that comes with v.1.3.1 Link to comment Share on other sites More sharing options...
rocky Posted September 13, 2010 Share Posted September 13, 2010 Check to make sure that the carrier is actually in the zone of the currently-logged-in customer's address. Also, check the "Out-of-range behavior" of the carrier. If that is set to "Disable carrier" and the customer's cart total doesn't fit in any of the ranges, then the carrier will be disabled and you will get that error message. Your ranges should overlap like 0-1, 1-2, etc. Link to comment Share on other sites More sharing options...
tekexplore Posted September 13, 2010 Author Share Posted September 13, 2010 This is the exact error message that I get..There are no carriers available that will deliver to this address! Link to comment Share on other sites More sharing options...
rocky Posted September 13, 2010 Share Posted September 13, 2010 That's the error message I am talking about. If the carrier is in the zone, the price ranges have been set, and the customer's cart total is in a price range or "Out-of-range behavior" is not set to "Disable carrier", then you shouldn't get that error message. I can't think of anything else that would cause that error message to appear. Link to comment Share on other sites More sharing options...
tekexplore Posted September 13, 2010 Author Share Posted September 13, 2010 What is the purpose of "Fees by carrier, geographical zone, and ranges" ?And I have enabled the Cheque/DD payment module but I am not getting that module in onepagecheckout which I bought. Link to comment Share on other sites More sharing options...
tekexplore Posted September 13, 2010 Author Share Posted September 13, 2010 oops.. Have got now. The Cheque/DD was restricted for some countries. Link to comment Share on other sites More sharing options...
tekexplore Posted September 13, 2010 Author Share Posted September 13, 2010 I would like to Round Off all prices across the store and remove the decimals .00 in all price display ...any way to achieve this. I have set the Round mode: Superior but still I am getting decimals in all places. Link to comment Share on other sites More sharing options...
rocky Posted September 13, 2010 Share Posted September 13, 2010 Go to Payment > Currencies, edit the currency and change "Decimals" to X, then click Save. Link to comment Share on other sites More sharing options...
tekexplore Posted September 13, 2010 Author Share Posted September 13, 2010 Cool. It works fine.. I have saved MRP Price in price_incl_tax and Out Site Price in wholesale_price and Discount Percentage in Reduction_amount_percent but in the store front I am getting some other price. See to the attachment you will get to know about it. Link to comment Share on other sites More sharing options...
tekexplore Posted September 13, 2010 Author Share Posted September 13, 2010 Try the following: $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} Hi, In this code its returning some product under category not Featured Products (Which is marked under Home Category) Any fix? Link to comment Share on other sites More sharing options...
rocky Posted September 14, 2010 Share Posted September 14, 2010 I don't understand. Can you post a link to your site? It would make it easier to help. Link to comment Share on other sites More sharing options...
Berk Posted October 2, 2010 Share Posted October 2, 2010 help me please toohttp://888.org.ua/shop/179-spyderco-by09bkp-byrd-crow.htmlthank you! Link to comment Share on other sites More sharing options...
Arafat Jahan Posted December 11, 2010 Share Posted December 11, 2010 Just add the following line into config/config.inc.php file@ini_set('memory_limit','512M'); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now