Jump to content

mtm

Members
  • Posts

    44
  • Joined

  • Last visited

Profile Information

  • Activity
    User/Merchant

mtm's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I had no help or any reply with this post and i'm hoping that this time i can get some luck. Maybe it wasn't posted at the right place... Here's what i posted: (PS 1.4.8.2) Hi, I managed to add product image to my block whishlist in header/top of the page (it slides down/up with a click, like the log/sign in at Prestashop site). The problem is that the images (path) get broken when i switch from wishlists in the drop-down list. If i refresh the page, it's ok. It seems that the ajax part is not working and the images are not refreshed... The correct path is /img/p/21-118-small.jpg (ok when i refresh the page or when the product is added). After i change wishlists in the drop-down list, the image is broken and the path changes to /img/p/1/1/8/118-small.jpg. In Chrome's console, i get this error: WishlistChangeDefault.$.ajax.success ajax-wishlist.js:85 and the piece of code in the ajax-whishlist.js file and the line 85 in the WishlistChangeDefault function: function WishlistChangeDefault(id, id_wishlist) { $.ajax({ type: 'GET', url: baseDir + 'modules/blockwishlist/cart.php', async: true, data: 'id_wishlist=' + id_wishlist + '&token=' + static_token, cache: false, success: function(data) { $('#' + id).slideUp('normal'); document.getElementById(id).innerHTML = data; $('#' + id).slideDown('normal'); } }); } The line 85 in the function: document.getElementById(id).innerHTML = data; I tried to follow the blockcart structure (which i also managed to add product images and solved the ajax issue) but it's diferent (easier, imo). I guess something is missing in the cart.php (or somewhere else for sure) file of the block wishlist. Can anyone help me how to figure out this? Thanks.
  2. (PS 1.4.8.2) Hi, I managed to add product image to my block whishlist in header/top of the page (it slides down/up with a click, like the log/sign in at Prestashop site). The problem is that the images (path) get broken when i switch from wishlists in the drop-down list. If i refresh the page, it's ok. It seems that the ajax part is not working and the images are not refreshed... The correct path is /img/p/21-118-small.jpg (ok when i refresh the page or when the product is added). After i change wishlists in the drop-down list, the image is broken and the path changes to /img/p/1/1/8/118-small.jpg. In Chrome's console, i get this error: WishlistChangeDefault.$.ajax.success ajax-wishlist.js:85 and the piece of code in the ajax-whishlist.js file and the line 85 in the WishlistChangeDefault function: function WishlistChangeDefault(id, id_wishlist) { $.ajax({ type: 'GET', url: baseDir + 'modules/blockwishlist/cart.php', async: true, data: 'id_wishlist=' + id_wishlist + '&token=' + static_token, cache: false, success: function(data) { $('#' + id).slideUp('normal'); document.getElementById(id).innerHTML = data; $('#' + id).slideDown('normal'); } }); } The line 85 in the function: document.getElementById(id).innerHTML = data; I tried to follow the blockcart structure (which i also managed to add product images and solved the ajax issue) but it's diferent (easier, imo). I guess something is missing in the cart.php (or somewhere else for sure) file of the block wishlist. Can anyone help me how to figure out this? Thanks.
  3. Hi PascalVG, Hope you're healthy now! In fact, i was about to to post because it's kinda solved... I explain: the block has now images but the ajax part is not working, because the images are broken when i change the whishlist in the drop down list. How i solved the images issue: Similar to the solution for the 1.5 version. In my case, the code that you said to add in the blockwishlist.ph file to the public function hookRightColumn($params), i copied it from the private function _displayProducts($id_wishlist) that i have a few lines and pasted at the end in the public function hookHeader($params), following your directions (see the differences of my case above). So, for this part i used the code from my file. It was not working because of PS diferent versions of the syntax code, i guess. For the rest, i did the editing in the blockwishlist.tpl and in the wishlist.php files like you and tuxinside sugested. Now, what's not working is the ajaz refresh of the images when i change the whishlist in the drop down menu in the block. The images are broken and only works well with a page refresh. What i got in Chrome from the console is the following error: WishlistChangeDefault.$.ajax.success ajax-wishlist.js:85 c.extend.handleSuccess jquery-1.4.4.min.js:142 c.extend.ajax.w.onreadystatechange jquery-1.4.4.min.js:141 The problem, from what i understand is in the ajax-whishlist.js file and the line 85 in the WishlistChangeDefault function: function WishlistChangeDefault(id, id_wishlist) { $.ajax({ type: 'GET', url: baseDir + 'modules/blockwishlist/cart.php', async: true, data: 'id_wishlist=' + id_wishlist + '&token=' + static_token, cache: false, success: function(data) { $('#' + id).slideUp('normal'); document.getElementById(id).innerHTML = data; $('#' + id).slideDown('normal'); } }); } The line 85 in the function: document.getElementById(id).innerHTML = data; Can anyone help me how to figure out this? Thanks.
  4. Hi PascalVG and tuxinside, I was looking for a solution like this one but it's not working on my store. I have PS 1.4.8.2. First, i just edited the blockwishlist-ajax.tpl and the blockwishlist.tpl to place this code: <img src="{$link->getImageLink($product.link_rewrite, $product.cover, 'medium_default')}" alt="{$product.name|escape:'htmlall':'UTF-8'}""> The problem is that the images are broken. On my store, the link becomes: <img src="http://www.mysite.com/prestashop/img/p/-medium.jpg" alt="MyProduct"> I got -medium.jpg but no id_image... Then i saw this post and tried to replicate it with no success. Another thing: my module is not on the right column but in the top/header with a click to show up (like the login here at the Prestashop site). So, my blockwishlist.php is a bit different: public function hookHeader($params) { /*Tools::addCSS(($this->_path).'blockwishlist.css', 'all');*/ Tools::addJS( ($this->_path).'assets/script.js', 'all'); return $this->display(__FILE__, 'blockwishlist-header.tpl'); } public function hookTop($params) { global $smarty, $errors; require_once(dirname(__FILE__).'/WishList.php'); if ($params['cookie']->isLogged()) { $wishlists = Wishlist::getByIdCustomer($params['cookie']->id_customer); if (empty($params['cookie']->id_wishlist) === true || WishList::exists($params['cookie']->id_wishlist, $params['cookie']->id_customer) === false) { if (!sizeof($wishlists)) $id_wishlist = false; else { $id_wishlist = (int)($wishlists[0]['id_wishlist']); $params['cookie']->id_wishlist = (int)($id_wishlist); } } else $id_wishlist = $params['cookie']->id_wishlist; $smarty->assign(array( 'id_wishlist' => $id_wishlist, 'isLogged' => true, 'wishlist_products' => ($id_wishlist == false ? false : WishList::getProductByIdCustomer($id_wishlist, $params['cookie']->id_customer, $params['cookie']->id_lang, null, true)), 'wishlists' => $wishlists, 'ptoken' => Tools::getToken(false))); } else $smarty->assign(array('wishlist_products' => false, 'wishlists' => false)); return ($this->display(__FILE__, 'blockwishlist.tpl')); } public function hookLeftColumn($params) { return $this->hookRightColumn($params); } When i paste the code that PascalVG posted (not in the hookRightColum but in the topRightColum), the page is blank whit a "fatal error". I don't know if the reason is that ithe code must be placed only on the hookRightColum or a code/syntax issue (PascalVG is for PS 1.5). Regarding this, i noticed some differences in the 1.5 and my 1.4.8.2 code: global $smarty, $errors; opposed to global $errors; But the main difference that i can see is that i have $params instead of $this: if ($params['cookie']->isLogged()) opposed to if ($this->context->customer->isLogged() You can see the many different instances on the code i posted from my blockwishlist.php file that illustrates this. Or must i edit the script.js and/or the blockwishlist-header.tpl files? So, if anyone can help me out it would be great. Thanks.
  5. Thanks Robin! It works now! I just don't know what happened but mostly, why was the template that i copied from a clean PS download wrong?
  6. Hi Robin, Thanks a lot! I will inspect and compare; modify and hopefully understand what - and mostly why - this is happening. Just out of curiosity: the html file that i attach was a copy from a PS download (1.4.7 i belive). Why is the template like that?
  7. Hi Robin, As far as i know, the PaymentModule.php filewasn't modified. I don't understand what you mean... I uploaded in attachment the order_conf,html. Can you check it and see what's wrong with it? The tables get all misconfigured differently from different webmails. Check the pics. The orders where made with a couple of minutes from eachother and with different "clients". How come the template displays like this? Again, the html template was copied from a Prestashop installation... I realy don't get it and i need that. Thanks. order_conf.html
  8. Hi Robin, As i told you, i even replaced it with an original conf.html, so the problem doesn't seem to be with the html template file. The same one was working ok. Anyway, here's the html code from an original instalation template that is also giving me that messed up layout: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Message from {shop_name}</title> </head> <body> <table style="font-family: Verdana,sans-serif; font-size: 11px; color: rgb(55, 73, 83); width: 550px;"> <tbody> <tr> <td align="left"><a title="{shop_name}" href="%7Bshop_url%7D"><img style="border: medium none ;" src="%7Bshop_logo%7D" alt="{shop_name}"></a></td> </tr> <tr> <td> </td> </tr> <tr> <td align="left">Hi <strong style="color: rgb(219, 52, 132);">{firstname} {lastname}</strong>,<br> <br> Thank you for shopping with <strong>{shop_name}</strong>!</td> </tr> <tr> <td> </td> </tr> <tr> <td style="padding: 0.5em 1em; background-color: rgb(219, 52, 132); color: rgb(255, 255, 255); font-size: 12px; font-weight: bold;" align="left">Order details</td> </tr> <tr> <td> </td> </tr> <tr> <td align="left">Order: <strong><span style="color: rgb(219, 52, 132);">{order_name}</span> placed on {date}</strong> <br> Payment: <strong>{payment}</strong></td> </tr> <tr> <td> </td> </tr> <tr> <td align="left">{products} {discounts} <table style="width: 100%; font-family: Verdana,sans-serif; font-size: 11px; color: rgb(55, 73, 83);"> <!-- Title --><tbody> <tr style="background-color: rgb(185, 186, 190); text-align: center;"> <th style="padding: 0.6em 0pt; width: 15%;">Reference</th> <th style="padding: 0.6em 0pt; width: 35%;">Product</th> <th style="padding: 0.6em 0pt; width: 15%;">Unit price</th> <th style="padding: 0.6em 0pt; width: 15%;">Quantity</th> <th style="padding: 0.6em 0pt; width: 20%;">Total price</th> </tr> <!-- Products --><!-- Footer: prices --> <tr style="text-align: right;"> <td> </td> <td style="padding: 0.6em 0.4em; background-color: rgb(185, 186, 190);" colspan="3">Products</td> <td style="padding: 0.6em 0.4em; background-color: rgb(185, 186, 190);">{total_products}</td> </tr> <tr style="text-align: right;"> <td> </td> <td style="padding: 0.6em 0.4em; background-color: rgb(235, 236, 238);" colspan="3">Discounts</td> <td style="padding: 0.6em 0.4em; background-color: rgb(235, 236, 238);">{total_discounts}</td> </tr> <tr style="text-align: right;"> <td> </td> <td style="padding: 0.6em 0.4em; background-color: rgb(235, 236, 238);" colspan="3">Gift-wrapping</td> <td style="padding: 0.6em 0.4em; background-color: rgb(235, 236, 238);">{total_wrapping}</td> </tr> <tr style="text-align: right;"> <td> </td> <td style="padding: 0.6em 0.4em; background-color: rgb(221, 226, 230);" colspan="3">Shipping</td> <td style="padding: 0.6em 0.4em; background-color: rgb(221, 226, 230);">{total_shipping}</td> </tr> <tr style="text-align: right; font-weight: bold;"> <td> </td> <td style="padding: 0.6em 0.4em; background-color: rgb(241, 174, 207);" colspan="3">Total paid</td> <td style="padding: 0.6em 0.4em; background-color: rgb(241, 174, 207);">{total_paid}</td> </tr> </tbody> </table> </td> </tr> <tr> <td> </td> </tr> <tr> <td style="padding: 0.5em 1em; background-color: rgb(219, 52, 132); color: rgb(255, 255, 255); font-size: 12px; font-weight: bold;" align="left">Shipping</td> </tr> <tr> <td> </td> </tr> <tr> <td align="left">Carrier: <strong>{carrier}</strong></td> </tr> <tr> <td> </td> </tr> <tr> <td> <table style="width: 100%; font-family: Verdana,sans-serif; font-size: 11px; color: rgb(55, 73, 83);"> <tbody> <tr style="background-color: rgb(185, 186, 190); text-transform: uppercase;"> <th style="padding: 0.3em 1em; text-align: left;">Delivery address</th> <th style="padding: 0.3em 1em; text-align: left;">Billing address</th> </tr> <tr> <td style="padding: 0.5em 0pt 0.5em 0.5em; background-color: rgb(235, 236, 238);">{delivery_block_html}</td> <td style="padding: 0.5em 0pt 0.5em 0.5em; background-color: rgb(235, 236, 238);">{invoice_block_html}</td> </tr> </tbody> </table> </td> </tr> <tr> <td> </td> </tr> <tr> <td align="left">You can review your order and download your invoice from the <a style="color: rgb(219, 52, 132); font-weight: bold; text-decoration: none;" href="%7Bshop_url%7Dhistory.php">"Order history"</a> section of your customer account by clicking <a style="color: rgb(219, 52, 132); font-weight: bold; text-decoration: none;" href="%7Bshop_url%7Dmy-account.php">"My account"</a> on our shop.<br> <br> </td> </tr> <tr> <td align="left">If you have guest account, you can follow your order via the <a style="color: rgb(219, 52, 132); font-weight: bold; text-decoration: none;" href="%7Bshop_url%7Dguest-tracking.php">"Guest Tracking"</a> section on our shop.</td> </tr> <tr> <td> </td> </tr> <tr> <td style="border-top: 1px solid rgb(217, 218, 222); font-size: 10px;" align="center"><a style="color: rgb(219, 52, 132); font-weight: bold; text-decoration: none;" href="%7Bshop_url%7D">{shop_name}</a> powered by <a style="text-decoration: none; color: rgb(55, 73, 83);" href="http://www.prestashop.com/">PrestaShop™</a></td> </tr> </tbody> </table> </body> </html> Thanks.
  9. Hi, Suddenly, my order_conf.html email layout is all messed up when generated with content. The template itself seems ok but when the email is automatically sent after an order is placed, the email that the client receives have problems with tables layout. I replaced the template with new ones from a fresh install but the problem remains. However, the new_order.html that is sent to the store with basically the same info is displaying fine. I tried to use that template in place of the order_conf.html but it won't work because it uses a diferent key for the product info: the order_conf.html uses {products} {discounts} and the new_order.html uses {items}. So, the layout displays ok but without the product information: it shows the {items} code element above the product row description - as we see on the template. If i change the {items} in new_order.html with the {products} {discounts} from the order_conf.html, the product information is now displayed but the table layout becomes messed up - just like it does when using the order_conf.html. So, i'm assuming that the problem is somehow related with the {products} {discounts} keys. One thing i would like to try is using the the {items} instead of {products} {discounts} but i guess i have to edit some other php files and i just don't know which one(s), or what to edit... The ideal solution is to fix the problem and use the {products} {discounts} as it should be but if i can't solve it, i belive changing it to use {items} could be a workaround. I attached some pics to show both cases: the messed up order_conf.html and new_order.html using the {products} {discounts}; the good new_order.html using the {items} and the order_conf.html using the non-working {items}. Thanks. Using P.S. 1.4.8.2
  10. Hi vekia, thanks for reply. For what i understand, it's up to my host to make those configurations, right? Because i don't have access to such files on my server. I'll contact them tomorrow morning and ask them about it. I'll update my post as soon as i have some news. Thanks again for the tip.
  11. No one can help me with this "fatal error" in BO translations?
  12. Well, the translations are not updated on other languages in the email templates but only for the email modules. Only works on the core email templates in PT, ES or FR - despite the blank "fatal error" page after saving the modifications. For the EN email templates, there is no "fatal error" but the "Forbidden" error described above. And no modifications are saved to the translations: not for the core or module emails... Any help???
×
×
  • Create New...