Jump to content

matik4

Members
  • Posts

    38
  • Joined

  • Last visited

  • Days Won

    1

matik4 last won the day on August 22 2022

matik4 had the most liked content!

Profile Information

  • Location
    Ireland
  • Activity
    User/Merchant

Recent Profile Visitors

4,137,665 profile views

matik4's Achievements

  1. In case someone is still looking for a solution. I used the following module: https://www.idnovate.com/en/1443-146-same-price-products-and-shipping-after-vat-applied.html#/support-3_months
  2. Hi! Perhaps someone will be able to help or suggest some direction in solving the following issue. PrestaShop sends e-mails to customers in wrong language when creating the order via back office. For example - customer is registered with with id_lang for English, but e-mail is sent in Spanish, which is the default language. Screen attached below. The order and customer were created via back office. Presta v. 1.7.6.9 All e-mail templates & languages are present both in /mails and /themes/x/mails/ I edited ps_customer, ps_order and ps_cart id_lang to english as well (no effect) When creating the order in BO my profile language was actually English, not Spanish
  3. @knacky @MerseyRay Just wanted to say thank you to both of you 🙏 based on your code I was able to make a module that allows editing customer's registered language.
  4. Dla innych szukajacych - dziala rowniez w PrestaShop 1.7.6.7 👌 Wielkie dzieki!
  5. Hi guys, For Prestashop 1.7.7.0-1.7.7.4 you need to modify a different file since the order page was migrated to Symfony: [please note that you will lose this modification if you upgrade Prestashop in future] File path: /src/Adapter/Order/CommandHandler/UpdateOrderShippingDetailsHandler.php You need to comment out the following part - in my case line 111 to 124: Before: //send mail only if tracking number is different AND not empty if (!empty($trackingNumber) && $oldTrackingNumber != $trackingNumber) { if (!$orderCarrier->sendInTransitEmail($order)) { throw new TransistEmailSendingException('An error occurred while sending an email to the customer.'); } $customer = new Customer((int) $order->id_customer); $carrier = new Carrier((int) $order->id_carrier, $order->id_lang); Hook::exec('actionAdminOrdersTrackingNumberUpdate', [ 'order' => $order, 'customer' => $customer, 'carrier' => $carrier, ], null, false, true, false, $order->id_shop); } After: //send mail only if tracking number is different AND not empty // if (!empty($trackingNumber) && $oldTrackingNumber != $trackingNumber) { // if (!$orderCarrier->sendInTransitEmail($order)) { // throw new TransistEmailSendingException('An error occurred while sending an email to the customer.'); // } // $customer = new Customer((int) $order->id_customer); // $carrier = new Carrier((int) $order->id_carrier, $order->id_lang); // Hook::exec('actionAdminOrdersTrackingNumberUpdate', [ // 'order' => $order, // 'customer' => $customer, // 'carrier' => $carrier, // ], null, false, true, false, $order->id_shop); // }
  6. Hi all! I wonder if you could help me. I'm trying to add a bit of JS code so that on product page, the product image is replaced with smaller size on mobile devices. I got it working on all product images except for the active image (cover) and the next one. From what I'm guessing, I think jquery is overriding my code, but I can't figure out a way to stop that from happening. If I add my code in the browser console it works perfectly with all images, but when I include the code in custom.js or theme.js (or via theme configuration - it has a custom js section) it doesn't work. I'm using Warehouse 4.4.2 template on Prestashop 1.7. My code is: const metaTagValue = document.querySelector('meta[property="og:type"'); const imageToReplace = document.querySelectorAll('#product-images-large .product-lmage-large img'); const thumbClick = document.querySelectorAll('img.thumb.js-thumb.img-fluid.swiper-lazy.swiper-lazy-loaded'); if (metaTagValue.content === 'product') { function replaceImages() { if (imageToReplace.length !== 0 && window.innerWidth <= 767) { for (const replacedImg of imageToReplace) { let x = `${replacedImg.dataset.src}`; let y = `${replacedImg.src}`; if (x.includes('large_default')) { replacedImg.src = `${x.replace('large_default', 'home_default')}`; replacedImg.width = '360'; replacedImg.height = '360'; } else if (y.includes('large_default')) { replacedImg.src = `${y.replace('large_default', 'home_default')}`; replacedImg.width = '360'; replacedImg.height = '360'; } } } } replaceImages(); for (eachThumb of thumbClick) { eachThumb.addEventListener('click', () => { replaceImages(); }) } } The website is www.cbdstore.ie but I'm trying it on test environment with template v 4.4.2, while the production site is 4.4.1. Any tips would be much appreciated!
  7. I tried different combinations with no success. I even changed the product.tpl instead from: <div class="row"> <div class="col-xs-12 {if $postheme.product_thumbnail == 0}col-md-5 {else} col-md-6 {/if}"> {block name='page_content_container'} <section class="page-content" id="content"> {block name='page_content'} {block name='product_cover_thumbnails'} {include file='catalog/_partials/product-cover-thumbnails.tpl'} {/block} {/block} </section> {/block} </div> to <div class="row"> <div class="col-xs-12 {if $postheme.product_thumbnail == 0}col-md-5 {else} col-md-6 {/if}"> {block name='page_content_container'} {foreach from=$product.images item=image} {if empty($product.cover)} <div style="width:100%;height:auto;"><img src="/img/p/pl.jpg" style="width:100%;" /></div> {else} <section class="page-content" id="content"> {block name='page_content'} {block name='product_cover_thumbnails'} {include file='catalog/_partials/product-cover-thumbnails.tpl'} {/block} {/block} </section> {/if} {/foreach} {/block} </div> and that still returns empty div
  8. Hi! I wonder if anyone can help me with this. I have a problem with 'no image' image not being displayed on the product page. On product list it works perfect. I tried to change the tpl in many different ways with 'if empty', 'if image > 0' etc with no effect. I changed the no image variable to direct link and still no effect whatsoever. Patient: https://elektronova.pl/akcesoria/16616-uklad-zaplonowy-mhs-35-230-spectrum--5907418719096.html Presta 1.7.5.2 My product-cover-thumbnail.tpl: <div class="images-container left_vertical"> {block name='product_images'} <ul class="product-images slider-nav"> {foreach from=$product.images item=image} <div class="thumb-container"> <div> <img class="thumb js-thumb {if $image.id_image == $product.cover.id_image} selected {/if}" src="{$image.bySize.home_default.url}" alt="{$image.legend}" title="{$image.legend}" itemprop="image" > </div> </div> {/foreach} </ul> {/block} {block name='product_cover'} <div class="product-view_content"> {block name='product_flags'} <ul class="product-flag"> {foreach from=$product.flags item=flag} <li class=" {$flag.type}">{$flag.label}</li> {/foreach} </ul> {/block} <div class="product-cover slider-for"> {foreach from=$product.images item=image} <div class="thumb-item"> {if $product.cover} <div class="easyzoom easyzoom--overlay"> <a href="{$image.bySize.large_default.url}"> <img class="" style="width:100%;" src="{$image.bySize.large_default.url}" alt="{$image.legend}" title="{$image.legend}" itemprop="image"> </a> </div> {else} <img src="{$urls.no_picture_image.bySize.large_default.url}" style="width:100%;"> {/if} </div> {/foreach} </div> </div> {/block} </div> {hook h='displayAfterProductThumbs'} <script type="text/javascript"> $(document).ready(function() { $('.images-container .slider-for').slick({ slidesToShow: 1, slidesToScroll: 1, focusOnSelect: true, arrows: true, fade: true, infinite: true, lazyLoad: 'ondemand', asNavFor: '.slider-nav' }); if ({$postheme.product_thumbnail} == 0) { $('.images-container .slider-nav').slick({ slidesToShow: 4, slidesToScroll: 1, asNavFor: '.slider-for', dots: false, arrows: true, infinite: true, focusOnSelect: true }); }else { $('.images-container .slider-nav').slick({ slidesToShow: 4, slidesToScroll: 1, asNavFor: '.slider-for', vertical:true, dots: false, arrows: true, infinite: true, focusOnSelect: true, responsive: [ { breakpoint: 991, settings: { slidesToShow: 2, slidesToScroll: 1, } }, { breakpoint: 767, settings: { slidesToShow: 4, slidesToScroll: 1, } }, { breakpoint: 543, settings: { slidesToShow: 3, slidesToScroll: 1, } }, { breakpoint: 399, settings: { slidesToShow: 2, slidesToScroll: 1, } } ] }); } $('.images-container .slider-for').slickLightbox({ src: 'src', itemSelector: '.thumb-item img' }); if($(window).width() >= 992) { var $easyzoom = $('.images-container .easyzoom').easyZoom(); } $(window).resize(function(){ if($(window).width() >= 992) { var $easyzoom = $('.images-container .easyzoom').easyZoom(); $('.easyzoom--overlay').addClass('easyzoom'); } else { $('.easyzoom--overlay').removeClass('easyzoom'); } }); }); </script>
  9. Solved courtesy of @atomek , the solution is as below: {nl2br($field.text) nofilter}
  10. Powyzsza formula rozwiazala problem, happy days! Dzieki wielkie!
  11. Witam, Potrzebuje pomocy z ponizszym problemem. Probuje edytowac szablon realizacji zamowienia w Prescie 1.7.5.1 w taki sposob, aby tekst personalizacji produktu zachowal formatowanie tzn. odstepy miedzy wierszami - line breaks. Obecnie jezeli tekst zapisany jest tak jak w ponizszy sposob: line 1 blabla line 2 blablab line 3 blablaba Prestashop w koszyku czy w realizacji zamowienia wyswietli to jako: line 1 blabla line 2 blablab line 3 blablaba Na poziomie back office problem rozwiazalem w ponizszy sposob: {$data['value']|replace:' ':'<br />'} Niestety podobny kod nie dziala na FO i powoduje wysypanie sie strony (zamiast $data uzylem $field.text) Udalo mi sie czesciowo rozwiazac problem poprzez: {nl2br($field.text)} Niestety to powoduje, ze dodane jest <br /> jako tekst, a nie jako czesc kodu html tak jak ponizej: line 1 blabla<br /> line 2 blablab<br /> line 3 blablaba Plik w ktorym probuje dokonac zmian to cart-detailed-product-line.tpl: <div> {foreach from=$customization.fields item="field"} <div class="product-customization-line row"> <div class="col-sm-6 col-xs-6 perso-koszyk"> {$field.label} </div> <div class="col-sm-6 col-xs-6 perso-koszyk"> {if $field.type == 'text'} {if (int)$field.id_module} {$field.text nofilter} {else} {nl2br($field.text)} {/if} {elseif $field.type == 'image'} <img src="{$field.image.small.url}"> {/if} </div> </div> {/foreach} </div> Bylbym niezmiernie wdzieczny za jakiekolwiek wskazowki. Pozdrawiam, Mateusz
  12. Hello, I wonder if anyone can help me with this. I'm trying to edit the shopping cart template in Presta 1.7.5.1 so that the product customization text is displayed with preserved line breaks. Currently if there are any line breaks Presta ignores them. For example customer's product customization text is: line 1 blabla line 2 blablab line 3 blablaba Prestashop will display it in the summary as: line 1 blabla line 2 blablab line 3 blablaba I have it sorted in the back office by using: {$data['value']|replace:' ':'<br />'} I cannot get it working in the front office. The above code breaks the website (used with $field.text instead). I got it working partially by using: {nl2br($field.text)} However this results in <br /> tags shown as a text - rather than doing anything - as on the below example: line 1 blabla<br /> line 2 blablab<br /> line 3 blablaba The file I am trying to edit is located in cart-detailed-product-line.tpl and is as follows: <div> {foreach from=$customization.fields item="field"} <div class="product-customization-line row"> <div class="col-sm-6 col-xs-6 perso-koszyk"> {$field.label} </div> <div class="col-sm-6 col-xs-6 perso-koszyk"> {if $field.type == 'text'} {if (int)$field.id_module} {$field.text nofilter} {else} {nl2br($field.text)} {/if} {elseif $field.type == 'image'} <img src="{$field.image.small.url}"> {/if} </div> </div> {/foreach} </div> I would really appreciate any help on this! Kind Regards, Mateusz
  13. Already solved - if anyone encounters similar issue: for me it happened because I actually played with product-cover-thumbnails.tpl code to move the miniatures under the product cover and then I gave it few touches with CSS. The second I restored original file the issue disappeared, so I moved the miniatures using CSS only with 'order' property.
  14. Hello, I wonder if you could help me or point me to where the issue might be. I am working on a new shop based on Prestashop 1.7.5.1 and I have a little issue with attributes. I have two 'colours' of a product and when you select one of the variants on product page, for some reason it adds a new set of product thumbnails as on the below screen. If you keep switching between variants it will keep adding a new line of the same thumbnails every time. I would greatly appreciate any help.
  15. I actually found the cause- it is php error in module $categoryId = Context::getContext()->controller->getCategory()->id; can anyone advise where's the error in this line? for some reason it's referring to search controller and returning an error
×
×
  • Create New...