Leaderboard
Popular Content
Showing content with the highest reputation on 07/03/2019 in all areas
-
Hi, Looking for some advice on best practises on Presashop 1.7.x. I am looking to include at least one image of each product's colour on the product list / category page on a modification I am making to the Prestashop 1.7.0.4 starter theme. (Either to list them next to each other on the page or to have the product image thumbnail change when you hover over the various colour swatches). I can see that the products array is passed in the $listings object in Smarty. The individual product array contains a main_variants attribute which has almost all the info I need (url / colour / id_product_attribute / e.t.c) It would seem the best option would be to add an override that would addan image url to each varrient on the array. However I am not sure on best practises as to achieving this? Looking though the code i can see this array is populated in the addMainVariantsInformation() function in the ProductPresenter class in /src/Core/Product/ProductPresenter.php. This function is called by the controller class ProductListingFrontController on the function prepareProductForTemplate(array $rawProduct) As far as I can gather there isn't a mechanism to override functions in the Symfony framework code (/ProductPresenter.php) so we don't want to be making changes to the code in there. As such I think I will have to override the controller function (prepareProductForTemplate) and just add another attribute to the product class maybe main_variants_color and add my info here (once I work out how to get it ). Would this be current best practise or have I totally missed something on how to do this? --- Going forward I could see this being a pretty common type of modification theme designers might want to make to the product list page. Are there any plans to include this info in the default products listing object going forward? --- On a wide point I can see a lot of the logic is being shunted into the Symfony codebase on Prestashop. While I am totally on board with Prestashops push to hand off the dirty gubins of their platform to an established framework I wonder if they have a solid plan to give the same flexibility to override aspects of the framework that allow upgrades in the same way as current overrides mechanism? The only output on this I have seen so far is submit a change request and we will factor it into a future release. That kind of answer is likely to raise the hairs on the back of the neck of any sales manager offering theme dev or support on presatshop :/ --- Thanks in advice on any advice on the above points.1 point
-
What is even more interesting is that black-hatting (as this technique is called) is not only unfair - as you never accepted for it to be implemented - it can also be DESTRUCTIVE for your website. Google is extremely serious against these kind of methods. Within a matter of days your domain can be shadowbanned from Google, quite litteraly, forever.1 point
-
En désactivant le mode debug, je n'ai plus d'erreur puisqu'il s'agit d'un warning, en condition de production cela ne déclenche pas d'erreur.1 point
-
Det hjalp ikke så meget med udvikleren... Men langt om længe fandt jeg løsningen. Oversættelsen tilføjes i: themes > MY THEME > mails > da > lang.php1 point
-
Εμείς δεν έχουμε βρει κάτι τέτοιο να υπάρχει, για αυτό έχουμε βάλει το παραπάνω module,που όταν κάνει εγγραφή ο πελάτης , επιλεγεί εάν θα κάνει σαν ιδιώτης η σαν επιχείρηση.1 point
-
Hallo Wir haben soeben ein neues ESR Modul hochgeladen: https://addons.prestashop.com/de/andere-zahlungsmethoden/45408-bezahlung-mit-orangener-einzahlungsschein-esr.html QR Rechnung Update wird dann auch noch kommen.1 point
-
Hey and Hello Dear Community, we want to present here our new Prestahsop Module. What? ESR / ISR Orange Payment Slip Payment for Prestashop 1.6 and 1.7.. The Module adds the possibillity to your Customers to Pay Orders easily by ESR (Orange Payment Slip). All Data stays in your Shop...No external Payment Service or something! This Module generates a ESR Reference Number in Front Offiice, your Customer can use it for Pay by ESR (Orange Payment Slip) This Module also Can generate Orange Payment Slips for every single order (also for older orders) in Backoffice. This Module can automaticly update the Orderstate by CAMT054 File Import vor Cronjob. How it Works? Just Install the Module Over The Backoffice Module Manager. Enter Your ESR Bank Data in Module Configuration. A New added Payment Method will be visible for your Customers. You can Setup a Cronjob or Update your Orders by CAMT054 (you can get This/these File/s by Your Bank) (for other Formats contact us Please) File Import (more details in Manual) How to Get it? You can buy it on Prestashop Addons Marketplace https://addons.prestashop.com/en/product.php?id_product=45408 And if I have Problems with Installation? Just Contact us and we will find a Solution https://addons.prestashop.com/en/contact-us?id_product=45408 or just leave a comment in this Topic. Thank You and Cya1 point
-
I'm back! Nothing like find your own two year old thread when trying to fix a new bug in the code your wrote... Presatshop 1.7.5 which now throws this exception using the above fix Lucky I have worked out how to hammer this override back into shape, see below: private function prepareProductForTemplate(array $rawProduct) { $product = (new ProductAssembler($this->context))->assembleProduct($rawProduct); $presenter = $this->getProductPresenter(); $settings = $this->getProductPresentationSettings(); $productOut = $presenter->present($settings, $product, $this->context->language); // Force delete this value from the ProductListingLazyArray > ProductLazyArray. Cya! $productOut->offsetUnset('main_variants', true); // Regenerate (performance hit). $mainVs = $productOut->getMainVariants(); // This time we can play around with the 'main_variants' var however we like foreach ($mainVs as &$varient) { $imgs = Image::getImages($this->context->language->id, $varient['id_product'], $varient['id_product_attribute']); $varient['image_url'] = ''; if (count($imgs) > 0) { $varient['image_url'] = $this->context->link->getImageLink($productOut['link_rewrite'], $product['id_product'] . '-' . $imgs[0]['id_image'], 'home_default'); } } // Put it back (using their method, because why not). $productOut->__set('main_variants', $mainVs); return $productOut; } Hope this helps. P.S. They also seem to have fixed the bug with it not working on the search pages that i filed. Nice work PS! P.S. P.S I still think this would be done better by inserting a custom smarty function that uses Image::getImages & getImageLink to get the info you need directly. If anyone does this please post it up here.1 point
-
Good Evening, Iam using a store based in prestashop 1.7, and iam3 looking for a way to desable or by pass address informations in guest checkout also, guest checkout is enable only when Phone number is submit instead of email address. I will be waiting for your answer.1 point
-
Test this: open: var/cache/prod/ContainerXo3vxws/appProdProjectContainer.php around row 905, change the database config with your own. Clean the web browser caché and restart your page. Good luck!1 point
-
Dear, Our system is using Presta 1.7.3 have anyone know to remove {lastname] or remove the "required" of {lastname} in Register Form, Customer form and Address form? Help me solve it! Tks1 point
-
Thanks ! for me it was the file: /themes/Theme name/templates/catalog/_partials/miniatures/product-listgrid.tpl i changed it to: <div class="product-description"> {block name='product_name'} <h3 class="h3 product-title" itemprop="name"><a href="{$product.url}">{$product.name|truncate:75:'...'}</a></h3> {/block} working perfect !1 point
-
I't seem like no one can explain how to import correctly Product features into Prestashop, here in the forum and searchin in Google, and it is quite frustrating, as many things in Prestashop... Anyway, after some work around, if someone needs to import via CSV the Product Features with Customized values here the solution: Feature (Name: Value: Position:Customized) = Name of the feature: Value of the feature : 1: 2 So it is important to put 2 at the end, so easy but not indicated in any doc...1 point
-
1 point