Search the Community
Showing results for tags 'Listing'.
-
Warianty produktu wyświetlane w listingu produktów
rkonik posted a question in Wsparcie i pomoc użytkowników
Nie wiem jak to nazwać i przez to nie wiem jak szukać. Dlatego opiszę problem i liczę, że ktoś zrozumie i naprowadzi mnie jak rozwiązać problem. Chodzi o to że w produkcie ustawiam warianty. Co jest ważny nie jeden wariant ale kilka. Dla celów rozmowy powiedzmy że jest to kolor, rozmiar i kształt. Dla każdego wariantu jest oczywiście stan magazynu. Na listingu wyświetla się dany produkt i w zależności od szablonu np informacja o kolorze. Czyli że możemy wybrać dany produkt w różnych kolorach. Natomiast ja chciałbym aby każdy z tych wariantów które ma dany produkt wyświetlił się na listingu jako osobny produkt a nie tylko informacja że produkt posiada warianty. Czy w Prestashop jest to realne? Technicznie w różnych systemach widziałem, że sklepy to mają. Pytanie czy w Presta jest to dostępne. Nawet nie wiem jak to nazwać by móc znaleźć takie rozwiązanie nawet jeżeli wiązało by się to z zakupem rozszerzenia. Z góry dziękuję za podpowiedź. -
Hello, I was coding my custom listing products in a front controller, i got stack in the sort function this code is from my controller : public function postProcess() { $this->setAuctionOrder(); $this->setAuctionsData(); if (Tools::isSubmit('from-xhr')) { $this->setOrdering(); } parent::postProcess(); } private function setAuctionOrder() { if ($order = Tools::getValue('order')) { $order = explode('.', $order); $this->orderBy = isset($order[1]) ? $order[1] : 'position'; $this->orderWay = isset($order[2]) ? $order[2] : 'asc'; } else { $this->orderBy = 'position'; $this->orderWay = 'asc'; } } private function setOrdering() { ob_end_clean(); header('Content-Type: application/json'); die(json_encode($this->getAjaxProductSearchVariables())); } private function getAjaxProductSearchVariables(){ $this->setAuctionOrder(); $sort_orders = $this->getAvailableSortOrders(); $this->setAuctionsData(); $page_link = $this->context->link->getModuleLink('auctionpremium', 'allauctions'); $order_by = Tools::strtolower($this->orderBy); $order_way = Tools::strtolower($this->orderWay); $url = Tools::url($page_link, 'order=product.'.$order_by.'.'.$order_way); if ($this->p > 1) { $url = Tools::url($url, 'page='.$this->p); } $searchVariables = [ 'label' => $this->l('Auctions'), 'sort_orders' => array('sort_orders' => $sort_orders), 'pagination' => $this->getPagination(), 'js_enabled' => true, 'current_url' => $url, 'rendered_products' => $this->context->smarty->fetch( $this->module->getLocalPath() . 'views/templates/front/AuctionsList.tpl' ) ]; return $searchVariables; } private function getAvailableSortOrders(){ $page_link = $this->context->link->getModuleLink('auctionpremium', 'runningauctions'); $order_by = Tools::strtolower($this->orderBy); $order_way = Tools::strtolower($this->orderWay); return [ [ 'url' => Tools::url($page_link, 'order=product.position.asc'), 'current' => $order_by == 'position' && $order_way == 'asc', 'label' => $this->l('Relevance') ], [ 'url' => Tools::url($page_link, 'order=product.name.asc'), 'current' => $order_by == 'name' && $order_way == 'asc', 'label' => $this->l('Name, A to Z') ], [ 'url' => Tools::url($page_link, 'order=product.name.desc'), 'current' => $order_by == 'name' && $order_way == 'desc', 'label' => $this->l('Name, Z to A') ], [ 'url' => Tools::url($page_link, 'order=auction.end_time.asc'), 'current' => $order_by == 'end_time' && $order_way == 'asc', 'label' => $this->l('End time, near to far') ], [ 'url' => Tools::url($page_link, 'order=auction.end_time.desc'), 'current' => $order_by == 'end_time' && $order_way == 'desc', 'label' => $this->l('End time, far to near') ] ]; } private function setAuctionsData() { $auctions_data = $this->getAuctionsData(); $sort_orders = $this->getAvailableSortOrders(); $this->context->smarty->assign(array("auctions" => $auctions_data, "sort_orders"=>array('sort_orders' => $sort_orders),"pagination" => $this->getPagination())); } And this is a part of the Template <div class="products-select"> <div class="col-md-6 hidden-sm-down total-products"> {if $auctions|count > 1} <p>{l s='There are %s products.' mod='auctionpremium' sprintf=[$auctions|count]}</p> {else} <p>{l s='There is %s products.' mod='auctionpremium' sprintf=[$auctions|count]}</p> {/if} </div> <div class="col-md-6"> {block name='sort_by'} {include file='catalog/_partials/sort-orders.tpl' listing=$sort_orders} {/block} </div> </div> The problem is i got an error with this message ContextErrorException Notice: Undefined index: sort_selected. Any Help , And Thanks.
- 2 replies
-
- frontcontroller
- products
- (and 4 more)
-
Hi community members. I was trying to override a listing controller from this path `controllers/front/listing/CategoryController.php`. As you all know you just need to copy and paste this file with the relative path into your custom module like this `modules/mymodule/override/controllers/front/listing/CategoryController.php` and then do the override based on your needs. After all you just need to install the module in a prestashop instance or reset it if you have installed this before. That is what I went through. But it did not work for me. Actually nothing new appears in `override/controllers/front`. I checked that in a fresh install of prestashop there is no `listing` folder within this path `override/controllers/front`. I searched for this and found this answer by @hexadog which says you have to create `listing` folder in `override/controllers/front` and then install or reset your module. And it works for me. Thanks @hexadog
- 1 reply
-
- controller
- listing
-
(and 3 more)
Tagged with:
-
Bonjour à tous, Tout d'abord, je précise que j'utilise Prestashop 1.7.7.1 et PHP 7.2.34. Ma version MySQL est 10.3.34-MariaDB. Je souhaiterais créer une nouvelle page dynamique type listing comme les pages "best-sales", "new-products" et "prices-drop" permettant d'afficher les produits disponibles en précommande. Pour définir qu'un article est disponible en précommande, j'utilise simplement cette option du back-office : Lorsque la quantité est à 0 et que les préférences de disponibilité sont réglées sur "Accepter les commandes", l'article est considéré comme étant disponible en précommande. Niveau BDD, cette information est identifiable dans la table ps_stock_available grâce à l'attribut out_of_stock pouvant posséder 3 valeurs (0 : Le produit n'est pas en stock et le comportement consiste à refuser les commandes / 1 : Le produit n'est pas en stock, mais le comportement autorise les commandes (la valeur qui va nous intéresser ici) / 2 : Le produit est en stock et peut être commandé). Cette table possède également l'attribut 'id_product' , qui permet d'identifier chaque article. On peut donc facilement identifier les articles disponibles en précommande grâce à la requête : Après un rapide test, la requête renvoie bien l'id de tous mes articles dispos en précommande. Cette requête sera utile par la suite pour mettre en place la fonction getPreordersProducts dans le fichier/dans un override du fichier Product.php. Je créé un fichier preorders.tpl dans le dossier monsite.fr/themes/MonTheme/templates/catalog/listing qui contient : {* * This file allows you to customize your preorders page. * You can safely remove it if you want it to appear exactly like all other product listing pages *} {extends file='catalog/listing/product-list.tpl'} Je créé ensuite un fichier PreordersProductSearchProvider.php dans le dossier monsite.fr/src/Adapter/Preorders/PreordersProductSearchProvider.php (le dossier Preorders venant d'être créé) qui contient : <?php namespace PrestaShop\PrestaShop\Adapter\Preorders; use PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext; use PrestaShop\PrestaShop\Core\Product\Search\ProductSearchProviderInterface; use PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery; use PrestaShop\PrestaShop\Core\Product\Search\ProductSearchResult; use PrestaShop\PrestaShop\Core\Product\Search\SortOrder; use PrestaShop\PrestaShop\Core\Product\Search\SortOrderFactory; use Product; use Symfony\Component\Translation\TranslatorInterface; /** * Used to query the products available on preorder, see PreordersController in Front Office. */ class PreordersProductSearchProvider implements ProductSearchProviderInterface { /** * @var TranslatorInterface */ private $translator; /** * @var SortOrderFactory */ private $sortOrderFactory; public function __construct( TranslatorInterface $translator ) { $this->translator = $translator; $this->sortOrderFactory = new SortOrderFactory($this->translator); } /** * @param ProductSearchContext $context * @param ProductSearchQuery $query * @param string $type * * @return array */ private function getProductsOrCount( ProductSearchContext $context, ProductSearchQuery $query, $type = 'products' ) { return Product::getPreordersProducts( $context->getIdLang(), $query->getPage(), $query->getResultsPerPage(), $type !== 'products', $query->getSortOrder()->toLegacyOrderBy(), $query->getSortOrder()->toLegacyOrderWay() ); } /** * {@inheritdoc} */ public function runQuery( ProductSearchContext $context, ProductSearchQuery $query ) { if (!$products = $this->getProductsOrCount($context, $query, 'products')) { $products = []; } $count = $this->getProductsOrCount($context, $query, 'count'); $result = new ProductSearchResult(); if (!empty($products)) { $result ->setProducts($products) ->setTotalProductsCount($count); $result->setAvailableSortOrders( [ (new SortOrder('product', 'date_add', 'desc'))->setLabel( $this->translator->trans('Date added, newest to oldest', [], 'Shop.Theme.Catalog') ), (new SortOrder('product', 'date_add', 'asc'))->setLabel( $this->translator->trans('Date added, oldest to newest', [], 'Shop.Theme.Catalog') ), (new SortOrder('product', 'name', 'asc'))->setLabel( $this->translator->trans('Name, A to Z', [], 'Shop.Theme.Catalog') ), (new SortOrder('product', 'name', 'desc'))->setLabel( $this->translator->trans('Name, Z to A', [], 'Shop.Theme.Catalog') ), (new SortOrder('product', 'price', 'asc'))->setLabel( $this->translator->trans('Price, low to high', [], 'Shop.Theme.Catalog') ), (new SortOrder('product', 'price', 'desc'))->setLabel( $this->translator->trans('Price, high to low', [], 'Shop.Theme.Catalog') ), ] ); } return $result; } } Ainsi que le controller PreordersController.php dans le dossier monsite.fr/controllers/front/listing/ qui contient : Je me suis également occupé de tout ce qui est relatif à la traduction/cryptage MD5 et config (monsite.fr/app/Resources/translations/default/ShopNavigation.xlf , monsite.fr/classes/lang/KeysReference/MetaLang.php , monsite.fr/config/xml/themes/default.xml , monsite.fr/themes/Montheme/config/theme.yml , monsite.fr/controllers/front/SitemapController.php , etc... Voilà où j'en suis actuellement, j'ai copié au maximum la syntaxe des fichiers relatifs à la page dynamique "new-products". Quelqu'un pourrait-il m'aiguiller sur ce qu'il me manque à réaliser, et éventuellement m'aider à compléter la fonction getPreordersProducts si nécessaire ? Je suppose ne pas être loin du but, mais je galère à rendre tout ceci concret et fonctionnel. Jusque là, aucun changement, la page d'apparaît nulle part, et je ne sais pas vraiment quoi faire d'autre. Il me manque une ou plusieurs pièces du puzzle, mais je bloque. En remerciant par avance ceux qui prendront la peine de lire tout ça !
-
Salut @all j'ai un prob au niveau du prix des produits côté Listing Produits ; ils ne sont pas conformes au produits niveau fiche produit . côté BD , pour un produit donné je vois au niveau ps_product le champ "price" n'admet pas la même valeur que au niveau ps_prodct_shop . je voulais savoir quel fonction responable de l'affichage des prix au niveau Listing Produit ? Merci d'avance
-
Bonjour, Je cherche comment ajouter plusieurs colonnes dans le listing commande BO de Prestashop j'évolue sous PS 1.7.5.1, j'ai déjà réussi à ajouter deux colonnes via deux tutos trouvés sur le net (le logo du transporteur et la ville de livraison). Je souhaite ajouter le nom du code promo (règle panier). Si le client en a utilisé un. J'ai compris que je dois faire un override sur le controllers "AdminOrdersController.php" (c'est ce que j'ai fait pour l'ajout de ma colonne avec logo transporteur et celle avec la ville de livraison). Par défaut l'actuel controlleur ne va pas cherche la table qui m'intéresse "ps_order_cart_rule" qui contient le code promo utilisé dans la commande. j'ai donc compris que je dois faire une "jointure" entre la table "ps_orders" et "ps_order_cart_rule" via l'id de la commande pour pouvoir avoir accès à cette information. Voici le code pour faire la jointure que j'ai récupéré pour avoir l'id_carrier : $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'order_carrier` oc ON (a.`id_order` = oc.id_order)'; J'ai donc fait cette modif en supposant que dans le précédent code le "oc" correspond à : "order_carrier" j'ai donc mis "ocr" pour "order_cart_rule : $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'order_cart_rule` ocr ON (a.`id_order` = ocr.id_order)'; et ensuite pour afficher ma colonne : $this->_select .= ', ocr.`name`,'; Bon... j'ai des bases très simple en PHP et je viens juste d'apprendre comment faire une jointure mais la façon dont j'ai appris ne correspond pas à la façon ci-dessus... évidemment ça ne fonctionne pas... quelqu'un pourrait-il m'aider en m'expliquant ce que j'ai fait de mal ? Dans le même esprit j'ai un module qui permet au client de choisir un cadeau en fonction de son montant d'achat au moment de passer sa commande. Je souhaite que le cadeau s'affiche dans le listing de commande. Je me dis que si j'arrive à faire afficher le code promo je pourrais facilement afficher le cadeau en allant chercher les bonnes tables mais encore faut-il arriver à les appeler...
-
Hi, I'm new to Prestashop and struggling since a couple of days with a basic task... I just would like to list the products of each category into my header (header.tpl). I don't know how to do it. I know how to list products : {if $listing.products|count} {block name='product_list'} {include file='catalog/_partials/products.tpl' listing=$listing} {/block} {else} {include file='errors/not-found.tpl'} {/if} But I don't know how to set up a category to this listing. Please can you help me ? Thanks a lot ! NB. I'm using Prestashop 1.7.4
-
Hello everybody, I have the following problem: I have added a self-defined property (boolean) that can be maintained per product. The aim should be that visitors (not logged in) shouldn't see all the products. That means: If the property is true, then the visitor of the shop sees the product. If the property is false, then the visitor of the shop doesn't see the product. Only when he is logged in the product should be displayed. Unfortunately, I am currently a bit in despair. Adding the property was not a problem. As I understand it, I have to adjust the search query in the category view. Unfortunately, I do not understand how. Can someone help me? Thanks in advance.
-
Hi, I want get new products from category. So i tried change controller. In prestashop 1.7 is NewProductsController.php, And inside is function protected function getProductSearchQuery() { $query = new ProductSearchQuery(); $query ->setQueryType('new-products') ->setSortOrder(new SortOrder('product', 'date_add', 'desc')) ; return $query; } And i change protected function getProductSearchQuery() { $query = new ProductSearchQuery(); $query ->setIdCategory('MY-NEW-ID-CATEGORY') ->setQueryType('new-products') ->setSortOrder(new SortOrder('product', 'date_add', 'desc')) ; return $query; } But still showing all products, not products from category.
-
Hi, im looking for info of how can I customize my product listing at category pages of my prestashop 1.6. Exactly what I want to do is to show an image between products at category page. For example. if products are listing as 3 per row, I want to show a banner at the second row, so that row has a product and the banner. The third row should list the normal 3 products. How can I modify the category tpl so I can show banners? At each category, the banners have to be different, ofc. Does exist a module which can do this? Or how can I customize my tpl? Thanks in advance.
-
Potrzebuję ukryć listing produktów w kategoriach które mają podkategorie... obecnie będąc w kategorii wyższego poziomu widać w listingu wszystko w głąb przez co wyświetla się wielki bigos :/ da się to gdzieś ustawić ?? czy jakimś modem trzeba ? ktoś przerabiał temat ?
-
Prestashop - hurtowe zamówienia (kastomizacja listingu)
dawidt posted a question in Wsparcie i pomoc użytkowników
Witam wszystkich, Interesuje mnie wykorzystanie PrestaShop jako panelu hurtowego. Głównie chodzi o możliwość dodawania wielu produktów do koszyka, z możliwością określenia ilości, bezpośrednio z listingu produktów. Listing powinien pokazywać nazwę produktu, cenę netto, cenę brutto, pole "ilość" i przycisk do koszyka. Załączam zdjęcie poglądowe żeby zwizualizować o co konkretnie chodzi. Czy ktoś robił coś podobnego? Jaki dodatek mógłby być przydatny w takiej sytuacji? Tak na dobrą sprawę moduł do kastomizacji listingu produktów byłby wystarczający. Jakieś pomysły? -
Hi, Have just been looking to see if I could get a column showing whether a product is "Available for order" next to the active column. I looked at the following thread which saw this done on PS 1.5: http://www.prestashop.com/forums/topic/302007-solved-bo-product-listing-available-for-order-online-only-fields-to-show-in-column-listing/ I've managed to adapt the code to the best of my ability to work with PS 1.6 as follows: $this->fields_list['available_for_order'] = array( 'title' => $this->l('Available'), 'active' => 'available_for_order', 'filter_key' => $alias.'!available_for_order', 'type' => 'bool', 'align' => 'text-center', 'class' => 'fixed-width-sm', 'orderby' => false ); however there is a slight issue. It works, but clicking the checkboxes does nothing, and filtering the value throws an error. Screenshots attached. I was wondering if anybody might be able to help. I am not using stock control, so use the "available for order" option. Hence a column would be very handy. Thanks,
- 2 replies
-
- available for order
- column
-
(and 2 more)
Tagged with:
-
Cześć, od razu zaznaczam, że nie mogłem rozwiązać mojego problemu w googlach. Chciałbym, aby na miniaturkach pojawiał się napis "produkt nowy". Coś w tym stylu: Czy istnieje jakiś moduł, który by mi to umożliwiał? Pozdrawiam
-
Hello all, I just started to use this module last week and now it works fine even if it doesn't get all my ebay shop categories (just the first one of the list) but the first time that i tried to sync my products,it ended up loading 45 actions with no pictures or description. Because of that i deleted them all from ebay manually (big mistake i guess) therefore it's now showing a wrong number of listings and i don't understand how to get rid of them from the module since those are no more existing. Does anyone know how to do that? By the way....i am already using the last version of the module
- 3 replies
-
- listing
- ebay module
-
(and 1 more)
Tagged with:
-
Hi All, We are seriously considering prestashop for our next big project. We are developing a Places listing website, which would be listing places and reviews about those places, and for some places we would like to sell their memberships as well. for Example - A website which would list Resurents along with their reviews and their monthly rental subscription. Apart from general reviews which are available by defaults in prestashop. We want user profile pages as well, means by clickign on any person name user can see the reviewrs profile as well. Is it doable in Prestashop, Shoul I go with prestashop if I will be having list of 5000 places. Example Site - Zomato.com
-
Bonjour, lorsque j'affiche la liste des produits d'une catégorie, il faudrait pouvoir afficher uniquement les produits dont le id_category_default est différent de 94... Or je ne sais pas ou placer cette exception. Quelqu'un a t-il une idée? Merci d'avance.
- 12 replies
-
In Stock Management, Listing Page, I just want to know, from where you are calling from 'stock'? For me it shows '--' like this. Quantity is not showing. so we cant able to remove or transfer stock. Please help me. i am new to prestashop.
- 1 reply
-
- stock
- stock management
-
(and 1 more)
Tagged with:
-
Version Using PrestaShop™ 1.6.0.6 I require help in the way the pricing is shown on the product listing. Currently it shows it without VAT. But it doesn't say 'Excl. VAT'. I require that to be shown on each product listing. I also require the RRP price to be shown. When adding a product, I have gone over each product and made sure each product has its own RRP and the pricing has been included as excl. VAT while applying the correct VAT onto the products. So I require an option to put 'Excl. VAT next to the price and also an RRP showing on each product listing. Many thanks! :-)
-
Hi people, Hope someone has come across this problem and can offer some advice. I have listed some items to eBay, but the Catalog Price Rules from Prestashop have been listed in French instead of English(UK). Do you know where these can be edited? I'm assuming it's something to do with translations? For example the item has listed: £9.40 au lieu de £11.40 (remise de -2) Thanks in advance!! Simon
-
- wrong language
- french
-
(and 3 more)
Tagged with:
-
#1 - How do I go about adding manufacturer logo in the product page and also on the product preview? #2 - How do I add manufacturer into product page and preview as well?
- 4 replies
-
- manufacturer
- logo
-
(and 1 more)
Tagged with:
-
I want to disable pagination in manufacturers list. So when I click "Manufacturers" all of them to appear. How can I achieve this?
- 18 replies
-
- manufacturer
- listing
-
(and 2 more)
Tagged with:
-
found a solution
-
Bonjour, Je suis en train de faire des modifications dans le code de : /themes/[mon_theme]/product-list.tpl Pour rajouter, en-dessous de la description courte, le nom de la catégorie. Si l'on ne met pas de conditions, le nom de la catégorie devrait s'afficher dans tous les cas : - listing produits dans chaque catégories - listing produits réductions et meilleurs ventes J'aimerais par la suite ne l'afficher que dans les pages "réductions" et "meilleurs ventes" Je teste avec le code suivant : ... {$product.description_short|truncate:360:'...'|strip_tags:'UTF-8'}</a></p> <!-- Ajout de l'affichage de la catégorie --> <br /> <h4>{$category->name}</h4> <br /> {$product.category} <!-- FIN --> </div> ... Avec $category->name, j'ai bien le nom correct complet. Avec $product.category, j'ai le nom "URL simplifiée" avec les mots séparés par un tiret. Voyez par exemple le résultat ici : http://photo-gravure...?id_category=24 Mon problème est que dans le cas des "réductions" et "meilleurs ventes", $category->name ne fonctionne pas, rien ne s'affiche ($product.category par contre s'affiche bien) : http://photo-gravure...prices-drop.php http://photo-gravure.../best-sales.php Je n'arrive pas à trouver pourquoi il ne s'affiche pas... Auriez-vous une idée? De plus, je ne sais pas trop comment faire le test pour afficher seulement si l'on est sur les pages "réductions" et "meilleurs ventes". Si vous avez une idée là-dessus, n'hésitez pas Merci beaucoup pour votre aide
-
Bonjour ! Voici mon problème : J'ai trouvé un nombre énorme de modules pour afficher les couleurs sur la couverture du produit dans le listing de la catégorie, mais moi je voudrais simplement afficher : "Il y a 5/8/3 teintes disponibles " sous le titre de la fiche, pas les carrés de couleurs en fonction du nombre d'attributs. (Si il y a 8 attributs couleurs que ça affiche : 8 teintes dispo) => Quelqu'un pourrait m'aider vers où je devrais chercher et comment l'afficher? (Si il existe un module sinon, je prends...) Je suis sous Presta 1.5.4.1 Merci d'avance !