Jump to content

drolex

Members
  • Posts

    13
  • Joined

  • Last visited

Profile Information

  • Location
    US
  • Activity
    Freelancer

drolex's Achievements

  1. I didn't get help but I figured it out as I stated in the 1st post. I listed the files I had to edit.
  2. Solution: http://addons.prestashop.com/en/front-office-features-prestashop-modules/17936-default-combination-images.html
  3. I found that if some products have the same position number (even 0) then drag and drop position changing does not work. I think that qualifies as a bug. I was using SQL to quickly add products to categories and setting the position to default (0), which wouldn't allow me to re-position them in the back office. I started using the id_product for the position to have unique positions, and then I could re-position in the back office; however, it's still not perfect. If I have positions like 452, 784, 792, 810, etc., I can move 792 to the top and it will become 0, but the others will keep their number. Then, if I try to move something down the list below non-re-positioned products it won't work. For example, if I then try to move 452 to the bottom, it will just stay where it is. I'm guessing it would get the position 1 or something low, but the others are still 784 and 810.
  4. I'm not sure what your exact spacing issue was since there is no screenshot. I also had a spacing issue that the suggested code delete did not fix. The problem was that 2 links in the menu would appear as one link because there is no vertical spacing. Here is my solution. PrestaShop 1.6.0.8 Open file themes/default-bootstrap/css/modules/blocktopmenu/css/superfish-modified.css Find this code starting at line 148: .sf-menu > li > ul > li { float: left; width: 20%; padding-right: 15px; Change to: .sf-menu > li > ul > li { float: left; width: 20%; padding-right: 15px; min-height:50px; margin-bottom:20px; } Clear cache.
  5. Can anyone answer my question: To override the controller function, do I copy the entire function and modify it in my override file?
  6. I have PS version 1.6. I want to add a field to the DB table product_attribute and be able to enter the value on the Combinations tab of Products in the back office. I think I need to override the function processProductAttribute in AdminProductsController as well as a tpl file. This new field will allow me to define different dimensions and weight for each attribute combination. To override the controller function, do I copy the entire function and modify it in my override file?Thank you for helping! EDIT: I already figured this out, but I didn't use overrides, so I still want the answer to that question. This required substantial modification of the following files: controllers/admin/AdminProductsController.php classes/Product.php classes/Combination.php admin/themes/default/template/controllers/products/combinations.tpl js/admin-products.js classes/Cart.php I also have a modified shipping module to make use of the new field.
  7. The delivery section refers to an address called "My address", which doesn't exist. My address is labeled "Home". That seems like an obvious problem. Yes, I do have carriers that deliver to my "Home" address. When you install Fedex and UPS, it enters all their delivery options in the carriers and sets them to deliver to all zones. I did not change them. The test product doesn't have any carrier selected, so it automatically uses all available carriers. UPS is actually working. I forgot I had selected only Fedex for the product before. Fedex still isn't showing up. Another problem: When I try to delete a carrier ("My carrier"), the alert box asks me if I really want to delete it, I click OK, and then it takes me to edit the carrier. I can't delete it. Another problem with "Connect to Fedex" module: I can't delete a rule under the "Product Settings" tab. Error message: An error occurred while deleting the object. configuration (cannot load object) Another problem with "Connect to UPS" module: The test product name doesn't show up in the list of products under the "Product Settings" tab. It has a blank entry whereas Fedex actually has the product name.
  8. I have a fresh install of PrestaShop 1.6.0.5. I have registered as a customer with my address in the United States. I select my state and zip code, but the state and zip code are not shown in my addresses on the checkout page. Under delivery methods it says, "No carriers available for the address "My address".". However, my address is actually called "Home". I have Fedex and UPS shipping modules installed and configured. I am using the default theme with 1-page checkout.
  9. I made a PHP script to take CSV data of attributes and values and generate SQL commands to import the data. You can put this on any PHP server and it just gives you SQL commands that you can run in phpMyAdmin for example. Here is the required CSV format. You only need these fields. They can actually be in whatever order you want. The script will automatically generate the attribute and attribute_group IDs and positions based on the order in the CSV data. All attribute groups of the same name (name_attribute) must be grouped together. name_attribute,public_name,name_value,is_color_group,color,group_type Amount Weight,Amount,8 oz,0,,radio Amount Weight,Amount,32 oz,0,,radio Size Relative,Size,Small,0,,radio Size Relative,Size,Medium,0,,radio Size Relative,Size,Large,0,,radio PHP: <?php $sql_output = ''; if($_POST['csv']){ /* Generate SQL to import PrestaShop attributes from CSV text input. */ $delimiter = $_POST['delimiter']; $id_shop = $_POST['id_shop']; $id_lang = $_POST['id_lang']; $lines = explode("\r\n", $_POST['csv']); // Make array of lines from CSV input. $num_lines = count($lines); $fti = array_flip(explode($delimiter, $lines[0])); // field-to-index array. // Make array of rows that are arrays of columns. $rows = array(); for($i=1; $i<$num_lines; $i++){ $rows[] = explode($delimiter, $lines[$i]); } $id_attribute = 0; $id_attribute_group = 0; $position_value = 0; $groups = array(); $rows_attribute = array(); $rows_attribute_group = array(); $rows_attribute_group_lang = array(); $rows_attribute_group_shop = array(); $rows_attribute_lang = array(); $rows_attribute_shop = array(); foreach($rows as $fields){ $id_attribute++; $name_attribute = $fields[$fti['name_attribute']]; $public_name = $fields[$fti['public_name']]; $name_value = $fields[$fti['name_value']]; $is_color_group = $fields[$fti['is_color_group']]; $color = $fields[$fti['color']]; $group_type = $fields[$fti['group_type']]; if(! in_array($fields[$fti['name_attribute']], $groups)){ $id_attribute_group++; $position_attribute = $id_attribute_group; $groups[] = $fields[$fti['name_attribute']]; $rows_attribute_group[] = "($id_attribute_group, $is_color_group, \"$group_type\", $position_attribute)"; $rows_attribute_group_lang[] = "($id_attribute_group, $id_lang, \"$name_attribute\", \"$public_name\")"; $rows_attribute_group_shop[] = "($id_attribute_group, $id_shop)"; } if($id_attribute > 1 && $rows[$id_attribute-1][$fti['name_attribute']] != $rows[$id_attribute-2][$fti['name_attribute']]){ $position_value = 0; }else{ $position_value++; } $rows_attribute[] = "($id_attribute, $id_attribute_group, \"$color\", $position_value)"; $rows_attribute_lang[] = "($id_attribute, $id_lang, \"$name_value\")"; $rows_attribute_shop[] = "($id_attribute, $id_shop)"; } $sql = array(); if($_POST['truncate']){ $sql[] = "TRUNCATE TABLE attribute;"; $sql[] = "TRUNCATE TABLE attribute_group;"; $sql[] = "TRUNCATE TABLE attribute_group_lang;"; $sql[] = "TRUNCATE TABLE attribute_group_shop;"; $sql[] = "TRUNCATE TABLE attribute_lang;"; $sql[] = "TRUNCATE TABLE attribute_shop;"; } $sql[] = "INSERT INTO attribute VALUES ".implode(',', $rows_attribute).";"; $sql[] = "INSERT INTO attribute_group VALUES ".implode(',', $rows_attribute_group).";"; $sql[] = "INSERT INTO attribute_group_lang VALUES ".implode(',', $rows_attribute_group_lang).";"; $sql[] = "INSERT INTO attribute_group_shop VALUES ".implode(',', $rows_attribute_group_shop).";"; $sql[] = "INSERT INTO attribute_lang VALUES ".implode(',', $rows_attribute_lang).";"; $sql[] = "INSERT INTO attribute_shop VALUES ".implode(',', $rows_attribute_shop).";"; $sql_output = implode("\r\n\r\n", $sql); } ?> <!DOCTYPE html> <html> <head> <title>Import Attributes</title> </head> <body> <p>This will generate SQL commands to import PrestaShop attributes from CSV text input. You can copy the output and run it on your SQL server thru phpMyAdmin.</p> <form method="post" enctype="multipart/form-data"> Input CSV Data:<br /> <textarea name="csv" style="width:800px; height:400px;"><?=$_POST['csv']?></textarea><br /> CSV Delimiter: <input type="text" name="delimiter" value="<?=$_POST['delimiter']?$_POST['delimiter']:','?>" /><br /> id_shop: <input type="text" name="id_shop" value="<?=$_POST['id_shop']?$_POST['id_shop']:'1'?>" /><br /> id_lang: <input type="text" name="id_lang" value="<?=$_POST['id_lang']?$_POST['id_lang']:'1'?>" /><br /> <input type="checkbox" name="truncate" value="1" <?=$_POST['truncate']?'checked="checked"':''?> /> Include SQL to truncate (empty) attribute tables<br /> <input type="submit" /> </form> <br /> Output:<br /> <textarea style="width:800px; height:400px;"><?=$sql_output?></textarea> </body> </html>
  10. I haven't imported products yet. I wanted to make the attributes and values first as I would before manually creating products. I am not saying "when try combinations import prestashop create new product". I read that if you let PrestaShop generate attributes and values from a combinations import then it makes duplicates of the attributes and values for each combination. I don't want duplicate attributes or values.
  11. I am aware of the combinations import. That is for importing combinations of attributes for products. I believe it would create attributes and values, but why not have something for attributes and values only? It seems like I would first have to make a product for each attribute value since a combination can only have one value of each attribute.
  12. I have PrestaShop 1.5.6.2 and I want to import Attributes and Values, but there is no option for that on the CSV Import page. Why is this not an option? Is there a way to do it?
×
×
  • Create New...