Jump to content

DylzEn

Members
  • Posts

    32
  • Joined

  • Last visited

Posts posted by DylzEn

  1. You can try to convert these special chars also to their html entities:

    http://www.web2gener...m/html/entities

     

    for example, instead of the é, add

    é

     

    If I do that, all the breadcrumb text disappears, except from "Home". Too many headaches.

     

    I got rid of the breadcrumb. Thanks anyway. Can I go on and mark this topic as solved since the original issue was indeed solved? Thanks for your help, I really appreciated it.

     

    Dylan

  2. Alright, there were two missing " ' " around "path" in your line so it gave me a syntax error. The correct code should be:

     

    {assign var='path' value=html_entity_decode($path)}
    

     

    That being said, that works at 99%, becuase the entities are gone but now the characters with an accent are not recognized and show a question mark, like in this screenshot:

     

    msak.png

     

    So it's basically a decoding issue. Therefore, I used the parameters to explicit convert the path string to UTF-8, because the default conversion seems to be to Standard ISO, like this:

     

    {assign var='path' value=html_entity_decode($path, ENT_COMPAT, 'UTF-8')}
    

     

    and now Prestashop wants to give me this error:

     

    9tl.png

     

    Why does it say it expects a long parameter now? The html_entity_decode is defined like this:

     

    string html_entity_decode ( string $string [, int $flags = ENT_COMPAT | ENT_HTML401 [, string $encoding = 'UTF-8' ]] )
    

     

    From the official PHP manual. Bah, I'm thinking about losing the breadcrumb and just show the category title on top.

     

    Thanks again for your time, Pascal.

  3. Stranger even, I see for

    World bank notes->Africa

    a Benin (W.A.S.) (U)

     

    as with a normal space on my Mac->Chrome

    On my iPad however, I see

    Benin (W.A.S.) (U)

     

     

    If you checked on your iPad first, that might be because I had the   in there and after a few minutes I changed it back to a nromal space because I don't really need it there, maybe that's why you saw a normal space on your Mac. Anyway, I'm gonna look into it a bit more and let you know if I come up with something. Thanks again.

     

    EDIT: I solved it by removing all the escape modifiers from the category-branch-tree.tpl and delete the content of those two smarty subfolders again. The entities still show in the breadcrumb though, so I need to figure out how to solve this issue now.

     

    Dylan

  4. First of all, thanks for your time and effort, PascalVG. Now, I like your solution and I surely didn't think about using the   entity before. The thing is, Prestashop is acting weird as usual after I add the   to the category name. That is, it looks like it works perfectly in the back office but not in the front office: I pick a category from my site, for example

     

    CAMEROUN (C.A.S.) (U)

     

    and since I don't want it to split like

     

    CAMEROUN (C.A.S.)

    (U)

     

    I edit the name like you told and make it CAMEROUN (C.A.S.) (U)

     

    Now, I save and return to parent category. In the category list there, the thing splits correctly like it is meant to. When I go to my fron t office though, it's like the site won't recognize the   like an entity so it just displays the whole text, like this:

     

    CAMEROUN

    (C.A.S.) (U)

     

    Here's my site if you want to check it out: www.tangrediworldbanknotes.com/en/

    I edited a few categories like that. I also deleted the content of the /smarty/cache and /smarty/compile folders, but it didn't help. Do you have any idea why this is happening? Thanks again for your time, I really appreciate it.

     

    Dylan

  5. Hello guys. I'd like to know if there is any way to use insert a line break in the category name. I'd lke to use it because in the category tree of the blockcategories module I have some long name categories, and when there's no more room for a word it just goes into a new line in a wrong way. I'd like to decide when to go for a new line. I hope I explained myself.

     

    After some searches in the forums, I went and edited the file "classes/Validate.php" removing the characters "<" and ">" from the return statement of the isCatalogName() function, so it now looks like this:

     

    public static function isCatalogName($name)
    {
     return preg_match('/^[^;=#{}]*$/u', $name);
    }
    

     

    This allows me to not get an error when I insert the the tag <br> in the category name from the BO. It says update succesful but nothing really changes and the name stays like it was originally. Any help would be appreciated. Thank you guys.

  6. You will have to insert two extra lines in the itemsTable. It will look something like:

    <td style="padding:0.6em 0.4em; text-align:center;">'.(int)($product['description']).'</td>
    <td style="padding:0.6em 0.4em; text-align:center;">'.(int)($product['description_short']).'</td>
    

    But this is from the top of my head. You would need to test it and I don't have time for that. I have to make up for all the time I lost with a failed upgrade.

     

    An alternative is to add the following at the end of the itemsTable:

     

    <tr><td style="padding:0.6em 0.4em; text-align:center;">'.(int)($product['description']).'</td></tr>
    <tr><td style="padding:0.6em 0.4em; text-align:center;">'.(int)($product['description_short']).'</td></tr>
    

     

    That doesn't seem to work as descriptions are still not showed in the email table. Thank you for your time anyway, I really appreciate it.

     

    EDIT: Solved by another user here on the forums, here's his solution:

     

    Hi there, you'd have to add code to the mailalerts module php file.

     

    modules > mailalerts > mailalerts.php

     

    In the function hookNewOrder, the product details are read in from ps_order_detail in the database, which doesn't store the descriptions.

     

    An easier way would be to add product references e.g supplier codes or just tags as those do get stored in the order_details table but if you want the descriptions, you can make an instance of the product class and read the data.

     

    Just before $itemsTable .= insert the following:

     

    $prod_tmp = new Product((int)$product['product_id']);
    $pdescription = $prod_tmp->description[$id_lang];
    $pdescription_short = $prod_tmp->description_short[$id_lang];
    

     

    You'd then put $pdescription or $pdescription_short somewhere in the table. You can put it in a new column by say duplicating the product_reference line:

     

    <td style="padding:0.6em 0.4em;">'.$product['product_reference'].'</td>
    <td style="padding:0.6em 0.4em;">'.$pdescription.'</td>
    

  7. Hello everyone. I hope you can help me once again with the site I'm building and I thank you in advance for all the support you give us everyday.

     

    Now to my problem. The products on the site I'm building often have the very same name and they differ from some details explained in the short and long descriptions, so from a list of product or from a search it's impossible to distinguish them. And most importantly, I can't distinguish them from the "New Order" email that I receive when someone makes an order, because in that email only the name of the product is shown.

     

    Basically, there's 5 different places I'd like to show the descriptions in.

     

    1) Product page

    2) Featured products on the homepage

    3) New products block

    4) Top sellers block

    5) Search results page

    6) New Order email template

     

    Now, I've managed to make this work in the product page, in the new products block and in the featured products block, but I can't seem to find a way to do it with the other 3 places. I added this line to "blocknewproducts.tpl" to make the descriptions show in the new products block:

     

    <div align="center" class="item-desc"><a href="{$product.link}">{$product.description_short|strip_tags:'UTF-8'|truncate:75:'...'}</a><br /></div>
    {if $product.description}<div align="center" class="item-desc"><a href="{$product.link}">{$product.description|strip_tags:'UTF-8'|truncate:75:'...'}</a><br /></div>{/if}
    

     

    That works. Unfortunately, only the short description works for the top sellers block and the search results list, that is I can't display the long descriptions at all in those cases.

     

    Most importantly, I'd like to add the descriptions next to the product name in the "new_order.html", otherwise I could not distinguish the products when I receive an order. Thank you for your time guys, and sorry for the wall of text. I hope you can help me out with these problems.

     

    Best regards,

    Dylan

  8. In this context it may be nice to mention my modification. I made the products in the mailalert clickable so that you can easily check which products were ordered if the name is ambiguous. The advantage of links is that they don't take space.

    Well, thank you very much for sharing this, musicmaster. That works really well, and I'll surely use it if I don't come up with a solution to my problem. Because the thing is that I have orders with more than 10 products most of the time, so it would take a lot of time to click on the link, get 1 product from the stock and repeat that 10+ times. What I'd like to do is just print the new order mail with the products descriptions so I can grab all the products from the stock with a glance. But your solution is better than the default behaviour anyway, so thanks again.

     

    Dylan

  9. Have you made sure your cache directory is writeable? It's in tools/smarty_v2/cache. You can empty both cache and compile folders, make sure they are writeable using chmod 777 in a terminal. It will generate the files again once you visit pages and they should be new versions of the files.

    I emptied "cache" and "compile" folders from "smarty", set 777 permissions on both the folders and now everything works even with "Cache" option enabled. You, sir, are awesome. I don't know how to thank you or return the favour, you really gave me a huge help. I'm going to add "Solved" in the title, hoping I won't have any other problems. Thank you again, Andrew R.

  10. The cache option should always be enabled but after you've made a change to your code, it has to recompiled to the cache so you would turn on force recompile, visit the page you changed to update the cache and then disable force recompile.

    Nothing, I tried every combination and refreshed everytime, but as long as the Cache option is ON, the numbers just don't show up next to categories. Have no idea what could be causing this...

     

    post-298834-0-47724000-1349122794_thumb.png

  11. That is perfect! It works as it should, I've searched a solution for months and you finally resolved it for me. Thank you very much.

    Only one last problem though: I was in development mode until now, and I had "Force compile" on YES and "Cache" on NO. The problem is that if I set "Cache" on YES (prestashop says it is recommended), the brackets and the numbers next to the categories completely disappear, looking as the default module. Any idea on why that happens? Do you suggest me to leave the "Cache" option disabled? Thank you again.

     

    Dylan

  12. Mr. Andrew R, you almost reached the status of awesome to me. I attached 3 screenshots from my store so you can see understand better what is wrong now. I have 7 products in my store, specifically 1 product in "World Banknotes --> Asia --> Abkhazia" and 6 products in "World Banknotes --> Asia --> Afghanistan". So, the numbers next to "World Banknotes" and "Asia" (7) are correct, and so is the number next to "Abkhazia" (1), but, as you can see, every other Asia subcategory shows (7) instead of (0) and the same happens for Europe and Oceania and every subcategory of those two. I've tried to figure out what to edit in your code but I didn't come up with a solution. You already helped me a lot so I can only thank you for all your help and hope you can point me in the right direction once again. Thank you, sir.

     

    Dylan

     

    post-298834-0-11057800-1349080368_thumb.png

    post-298834-0-16365800-1349080375_thumb.png

    post-298834-0-53967300-1349080381_thumb.png

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More