Search the Community
Showing results for tags 'routing'.
-
Hallo liebe Gemeinde, Ich habe bei Allinkl.com einen Prestashop 1.6.1.6 umgezogen, d.h. von einem Konto zu einem anderen. Die Bedingungen sind exakt die gleichen. Ich habe sämtliche Daten mit einem von Allinkl.com angebotenen Tool umgezogen (1:1 übertragen) Ich habe in der Datenbank die shop_url die Pfade korrigiert. Die DB Daten in der settings.inc.php habe ich auch angepasst. DB Name, präfix, und DB Name. Cache gelöscht wie hier beschrieben: Um den Cache richtig zu leeren, löschen Sie den Inhalt der Ordner /cache/smarty/compile und /chache/smarty/cache, mit Ausnahme der Datei index.php in jedem dieser Ordner. Index.php, war keine drinnen. Link zum Shop https://burr.geistheiler-mallorca.com/ Nach dem Umzug wird automatisch noch immer auf den alten Shop umgeleitet, ich denke dass der cache noch nicht Vollständig gelöscht ist. Ich möchte aber jetzt nicht einfach alle Ordner löschen. Hat jemand einen Tip, wo es noch hängt nach meinem Umzug?
- 4 replies
-
- hoster
- umzug fehler
-
(and 1 more)
Tagged with:
-
Hello, I have been trying for several days to develop a module for order preparation. I am under version 1.7.5 and I code according to the new recommendations of PrestaShop for 1.7, so with Symfony. I tried to fix all my errors by myself, but I can't find the cause of this one. At the installation, my module adds a tab in the order parameters. But here's the thing, I have the following result when I click on the tab : However, I followed this documentation to the letter: https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/ Here is my code for the tab, in the main file orderpreparation.php : private function installTab(): bool { $tabId = (int) Tab::getIdFromClassName('AdminOrderPreparation'); if (!$tabId) { $tabId = null; } $tab = new Tab($tabId); $tab->active = 1; $tab->class_name = 'AdminOrderPreparation'; //$tab->route_name = 'admin_order_preparation'; $tab->name = array(); foreach (Language::getLanguages() as $lang) { $tab->name[$lang['id_lang']] = $this->trans('Order Preparation', array(), 'Modules.Orderpreparation.Admin', $lang['locale']); } $tab->id_parent = (int) Tab::getIdFromClassName('AdminParentOrders'); $tab->module = $this->name; return (bool) $tab->save(); } private function uninstallTab() { $tabId = (int) Tab::getIdFromClassName('AdminOrderPreparation'); if (!$tabId) { return true; } $tab = new Tab($tabId); return $tab->delete(); } My controller code : declare(strict_types=1); namespace Kaudaj\Module\OrderPreparation\Controller\Admin; use Doctrine\Common\Cache\CacheProvider; use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; use PrestaShopBundle\Security\Annotation\AdminSecurity; use Kaudaj\Module\OrderPreparation\Model\PreparationLine; use Kaudaj\Module\OrderPreparation\Repository\PreparationLineRepository; class AdminOrderPreparationController extends FrameworkBundleAdminController { private $cache; private $form_filename; /** * @var PreparationLinesRepository */ private $repository; public function __construct(CacheProvider $cache) { $this->cache = $cache; $this->repository = new PreparationLineRepository(); $this->form_filename = _PS_MODULE_DIR_ . $this->module->name . DIRECTORY_SEPARATOR . "orderpreparationform.html"; parent::__construct(); } /** * @AdminSecurity( * "is_granted('read', request.get('_legacy_controller'))", * message="You do not have permission to update this." * ) * * @return Response */ public function indexAction() { return $this->render( '@Modules/orderpreparation/views/templates/admin/orderpreparation.html.twig', array( "ajax_dl_link" => $this->context->link->getAdminLink($this->module->name) ) ); } } My routes.yml file : admin_order_preparation: path: /order-preparation methods: [GET] defaults: _controller: 'Kaudaj\Module\OrderPreparation\Controller\Admin\AdminOrderPreparationController::indexAction' And finally, my composer.json file : { "name": "kaudaj/order-preparation", "description": "Kaudaj - Order Preparation", "autoload": { "psr-4": { "Kaudaj\\Module\\OrderPreparation\\": "src/" }, "config": { "prepend-autoloader": false }, "type": "prestashop-module" } } If you need more information about the context or some code I didn't publish, feel free to ask me. Thank you in advance for your help!
- 2 replies
-
- routing
- controller
-
(and 2 more)
Tagged with:
-
Bonjour, Je suis actuellement en train de développer un module pour Prestashop 1.7.6.1. J'ai besoin d'appeler une fonction PHP via l'ajax pour modifier l'ordre des éléments à la volée. Pour créer la partie admin (qui renverra juste un JSON), je me suis basé sur le tuto suivant : https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/ J'ai donc mon controller : <?php // /modules/parallaxeffect/controller/AjaxParallaxController.php namespace ParallaxEffect\Controller; use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController; class AjaxParallaxController extends FrameworkBundleAdminController{ public function changeOrder(){ return Tools::jsonEncode(['coucou']); } } J'ai ensuite configuré le PSR-4 : // /modules/parallaxeffect/composer.json { "name": "moi/parallaxeffect", "description": "Affiche un carrousel avec des éléments sur la page d'accueil", "autoload": { "psr-4": { "ParallaxEffect\\Controller\\": "controller/" } }, "config": { "prepend-autoloader": false }, "type": "prestashop-module" } Quand je suis, via l'invite de commande, dans le dossier de mon module, je fais la commande composer dumpautoload J'ai le message suivant : Si je fais la commande composer dumpautoload -o J'ai le message : Est-ce normal ? J'ai tout de même fini le tuto en créant le fichier de routes mais je n'ai pas de résultat probant ... # /modules/parallaxeffect/config/routes.yml changeOrder: path: parallaxeffect/changeorder methods: [GET] defaults: _controller: 'ParallaxEffect\Controller\AjaxParallaxController::changeOrder' Deuxième question : Comment je fais pour accèder à cette page via l'url ? Dans le tuto, ils mettent /admin-dev/modules/your-module/demo mais à quoi correspond /admin-dev/ ? Merci d'avance !!! Guillaume
- 3 replies
-
- admin
- controller
-
(and 6 more)
Tagged with:
-
Hi Guys, Since Prestashop 1.7.5 allow the usage of Symfony controllers and routing : https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/. My problem now is to link the controller action to a tab in the back office, unfortunately the Prestashop docs does not really help in this area: https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/tabs/. If any one has crossed this problem and has any kind of a solution i would really appreciate the help.
-
Bonjour tout le monde, Je suis nouveau sur la communauté, et j'ai grandement besoin de votre aide. J'ai installé le module smartblog sur le site d'un client et j'ai constaté qu'il n'était pas au top niveau routing, je m'explique : Lorsque l'on créer un article qu'on le relie à une catégorie, si par exemple notre catégorie s'appelle "pigeon", dans l'url nous n'aurons pas : - site/blog/pigeon/monarticle.html mais : - site/blog/article/monarticle.html Donc je souhaite changer le terme "article" par un terme dynamique, je suis doc allé dans le fichier du module : 'smartblog_post' => array( 'controller' => 'details', 'rule' => $alias.'/articles/{slug}_{id_post}'.$html, 'keywords' => array( 'slug' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'slug'), 'id_post' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'id_post'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), pour le changer en ceci : 'smartblog_post' => array( 'controller' => 'details', 'rule' => $alias.'/articles/{slug}_{id_post}'.$html, 'keywords' => array( 'slug' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'slug'), 'id_post' => array('regexp' => '[_a-zA-Z0-9-\pL]*', 'param' => 'id_post'), ), 'params' => array( 'fc' => 'module', 'module' => 'smartblog', ), ), Sauf que lorsque j'effectue cette modification, je n'obtient pas le résultat escompté, mais une jolie erreur de ce style : Dispatcher::createUrl() miss required parameter "slug_cat" for route "smartblog_post" Comment faire ? Merci à vous ! PS: je suis sur prestashop 1.6.1.11
-
Hallo, ich arbeite gerade an einem devShopupdate von V1.5.4.1 auf 1.6.0.8. Das hat soweit auch alles ganz gut geklappt. Das neue Template funktioniert soweit schon mal. Nur gibt es irgendein Problem mit dem Pfad bei den Hersteller Links. Ein Problem mit fehlerhafter Programmierung würde ich ausschließen, auf der Testseite des Templates funktioniert es einwandfrei. Bei mir nun folgendes Szenario: Wenn ich auf einen Link klicke der mit einem Hersteller verlinkt ist, wird zwar die url korrekt ausgegeben und aufgerufen, doch ich lande auf der SupplierList Seite. Selbst die Breadcrumb gibt Supplier aus. Woran könnte dies denn liegen? Hat schon mal jemand ein ähnliches Problem gehabt? Ich bin mir nicht ganz sicher, doch ich glaube das dieses Problem schon in der alten Shopversion bestand. Dort haben wir aber dieses Feature mit den Links zu den Herstellerseiten nicht genutzt. Wenn friendly Urls ausgeschaltet ist, funktioniert es ganz normal. Mfg Jan
- 1 reply
-
- supplier
- manufacturer
- (and 4 more)