Jump to content

Miguel86

Members
  • Posts

    60
  • Joined

  • Last visited

  • Days Won

    1

Miguel86 last won the day on May 21 2020

Miguel86 had the most liked content!

Profile Information

  • Location
    Spain
  • Activity
    Developer

Recent Profile Visitors

3,161,483 profile views

Miguel86's Achievements

Rookie

Rookie (2/14)

  • First Post Rare
  • Collaborator Rare
  • Conversation Starter Rare
  • Week One Done Rare
  • One Month Later Rare

Recent Badges

5

Reputation

  1. Hi: I'm using Prestashop 8 with latest version and I trying to override the facetedsearch to add few extra sort options in the category page. I tried to create an override of the ps_facetedsearch.php I put the file in override/modules/ps_facetedsearch/ps_facetedsearch.php <?php if (!defined('_PS_VERSION_')) { exit; } require_once implode(DIRECTORY_SEPARATOR, array( __DIR__, 'src', 'Product', 'SearchProvider.php', )); use PrestaShop\PrestaShop\Core\Product\Search\SortOrder; use PrestaShop\Module\FacetedSearch\URLSerializer; use PrestaShop\Module\FacetedSearch\Filters\Converter; use PrestaShop\Module\FacetedSearch\Filters\DataAccessor; use PrestaShop\Module\FacetedSearch\Filters\Provider; class Ps_FacetedsearchOverride extends Ps_Facetedsearch { public function hookProductSearchProvider($params) { $query = $params['query']; if ($query->getIdCategory()) { $urlSerializer = new URLSerializer(); $dataAccessor = new DataAccessor($this->getDatabase()); $provider = new Provider($this->getDatabase()); return new SearchProviderOverride( $this, new Converter( $this->getContext(), $this->getDatabase(), $urlSerializer, $dataAccessor, $provider ), $urlSerializer, $dataAccessor, null, $provider ); } else { return null; } } } And the SearchProviderOverride.php I put it in override/modules/ps_facetedsearch/src/Product/SearchProvider.php <?php use PrestaShop\Module\FacetedSearch\Filters; use PrestaShop\Module\FacetedSearch\URLSerializer; use PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext; use PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery; use PrestaShop\PrestaShop\Core\Product\Search\SortOrder; use PrestaShop\Module\FacetedSearch\Product\SearchProvider; use PrestaShop\Module\FacetedSearch\Product\SearchFactory; class SearchProviderOverride extends SearchProvider { private $_module; public function __construct( Ps_Facetedsearch $module, Filters\Converter $converter, URLSerializer $serializer, Filters\DataAccessor $dataAccessor, SearchFactory $searchFactory = null, Filters\Provider $provider ) { $this->module = $module; $this->filtersConverter = $converter; $this->urlSerializer = $serializer; $this->dataAccessor = $dataAccessor; $this->searchFactory = $searchFactory === null ? new SearchFactory() : $searchFactory; $this->provider = $provider; } private function getAvailableSortOrders($query) { $sortSalesDesc = new SortOrder('product', 'sales', 'desc'); $sortPosAsc = new SortOrder('product', 'position', 'asc'); $sortNameAsc = new SortOrder('product', 'name', 'asc'); $sortNameDesc = new SortOrder('product', 'name', 'desc'); $sortPriceAsc = new SortOrder('product', 'price', 'asc'); $sortPriceDesc = new SortOrder('product', 'price', 'desc'); $sortDateAsc = new SortOrder('product', 'date_add', 'asc'); $sortDateDesc = new SortOrder('product', 'date_add', 'desc'); $sortRefAsc = new SortOrder('product', 'reference', 'asc'); $sortRefDesc = new SortOrder('product', 'reference', 'desc'); $translator = $this->module->getTranslator(); $sortOrders = [ $sortSalesDesc->setLabel( $translator->trans('Sales, highest to lowest', [], 'Shop.Theme.Catalog') ), $sortPosAsc->setLabel( $translator->trans('Relevance', [], 'Shop.Theme.Catalog') ), $sortNameAsc->setLabel( $translator->trans('Name, A to Z', [], 'Shop.Theme.Catalog') ), $sortNameDesc->setLabel( $translator->trans('Name, Z to A', [], 'Shop.Theme.Catalog') ), $sortPriceAsc->setLabel( $translator->trans('Price, low to high', [], 'Shop.Theme.Catalog') ), $sortPriceDesc->setLabel( $translator->trans('Price, high to low', [], 'Shop.Theme.Catalog') ), $sortRefAsc->setLabel( $translator->trans('Reference, A to Z', [], 'Shop.Theme.Catalog') ), $sortRefDesc->setLabel( $translator->trans('Reference, Z to A', [], 'Shop.Theme.Catalog') ), ]; if ($query->getQueryType() == 'new-products') { $sortOrders[] = $sortDateAsc->setLabel( $translator->trans('Date added, oldest to newest', [], 'Shop.Theme.Catalog') ); $sortOrders[] = $sortDateDesc->setLabel( $translator->trans('Date added, newest to oldest', [], 'Shop.Theme.Catalog') ); } return $sortOrders; } } However the website returns a 500 error: [18-Mar-2024 15:40:42 Europe/Madrid] PHP Fatal error: Uncaught Error: Call to a member function createFacetedSearchFiltersFromQuery() on null in /home/testewebsite/public_html/modules/ps_facetedsearch/src/Product/SearchProvider.php:163 Stack trace: #0 /home/testewebsite/public_html/classes/controller/ProductListingFrontController.php(357): PrestaShop\Module\FacetedSearch\Product\SearchProvider->runQuery(Object(PrestaShop\PrestaShop\Core\Product\Search\ProductSearchContext), Object(PrestaShop\PrestaShop\Core\Product\Search\ProductSearchQuery)) #1 /home/testewebsite/public_html/override/controllers/front/listing/CategoryController.php(111): ProductListingFrontControllerCore->getProductSearchVariables() #2 /home/testewebsite/public_html/controllers/front/listing/CategoryController.php(138): CategoryController->doProductSearch('catalog/listing...', Array) #3 /home/testewebsite/public_html/classes/controller/Controller.php(319): CategoryControllerCore->initContent() #4 /home/testewebsite/public_html/classes/Dispatcher.php(510): ControllerCore->run() #5 /home/testewebsite/public_html/index.php(28): DispatcherCore->dispatch() #6 {main} thrown in /home/testewebsite/public_html/modules/ps_facetedsearch/src/Product/SearchProvider.php on line 163
  2. I'm not able to create any image in Webp in the prestashop. I confirmed that my server supports webp. My theme also in the documentation supports webp, but i upload a product image in webp, and website still converts it to jpeg. I also have the latest PS version 1.8.2
  3. Hi: I'm running a Prestashop with version 8.0.1 i upgraded all modules before trying to upgrade the prestashop. I installed the latest version of the 1-click upgrade (version 4.16.4). I tried to update my website, everything related with the 1-click upgrade went fine and finished ok. The problem is that when you enter to the website is almost white screen. I noticed that the problem is that with the upgrade all my installed modules are disabled so that is the reason why is not loading. I reactivated the modules from IQIT (i'm using warehouse theme). The problem is that there are other modules i can't activate, like the Advanced Cookie Banner (from Presta-Module), or Pretty Clean URLs (from My-presta.eu). Gives an error the undefined module. I restored a backup i had from my hosting provider of this night. Everything works another time, the problem is that i would like to upgrade from 8.0.1 to 8.0.5 and later if everything works fine i would try to update to 8.1 Is it normal that all modules are disabled after upgrade with 1-click and why i can't enable it another time. I'm using PHP 8.1 so its compatible with both versiones of prestashop. Thanks
  4. I had a same problem. I bough the Pretty friendly URL, installed in PS 8, even used the link that was intended for that PS versiones. Got in contact with him, solved the problem but never more answered to me with the link of the valid module, so i can't upgrade or do anything else. Never more replied since months ago. Support doen't exist...
  5. If you want Prestashop 8.0.2 you can't downgrade to PHP 5.6 because is not compatible with less than PHP7.2 At least I'm using PHP8.1 (the recommended one) and works fine for me.
  6. Hi: I'm running Prestashop 8.0.1 & PHP 8.1 & Theme Warehouse. The main problem i'm experiencing is that i enabled in the image settings to use webp images, however even i upload webp images (products & carriers) website still converts and uses jpg images. I know the settings shows that maybe my theme is not compatible but i don't think is the case. Any help or something i can check to see where could be the problem? Best regards
  7. Hi: I would like to design my contact page with full layout or at least change the small column to the right, i found how to change that, the problem is that i would like to change the contact info rich from the left column to the right and i don't see that module in the module positions to change the position. How can i do to change it form left to right? Thanks
  8. If i understand right what you expect is that when some changes quatity of a product make a remote call to the POS?
  9. That means that instead of having an unique css file for all css files that are included in your website you will have all independently. The same apply for .js Also wont be minified (minify makes the file smaller). Usually is good to have it enable in terms of performance. As the client makes less requests to server and files are compressed usually website should load faster.
  10. Hi JBW: Yes i done it some minutes ago: https://github.com/PrestaShop/PrestaShop/issues/22204 Best regards.
  11. Hi JBW: Clearing browser cache don't seem to work. Product loads fine if you click the image, but if you click the color (white for example) not. Also in http://ps17.hostcreativosnet.com/es/2-inicio When i try to load Mountain fox cushion returns me a 404 error. Does it load OK for you in this situations?
  12. Hi: With a completely new fresh installation of Prestashop 1.7.6.9 i just added few langs to the website. Later i try to change products route from default: {category:/}{id}{-:id_product_attribute}-{rewrite}{-:ean13}.html To: {category:/}{rewrite}{id}{-:id_product_attribute}{-:ean13}.html Now when you enter to a product with combination shows another product different. You can test it in: http://ps17.hostcreativosnet.com/ If you click in the Hummingbird Printed T-Shirt instead of showing that article shows: THE BEST IS YET TO COME' FRAMED POSTER This is a completely fresh installation, in another installation that i have with all the products, categories, etc from a live site when i enter to a product shows a 404 error. I suppose is not detecting fine the ids with the rewrite in front. I'm trying to change this order because in my old Prestashop 1.6 i have: {category:/}{rewrite}-{id}.html as product route, and i would like to maintain this scheme to make easier redirections, otherwise i will get punished by google after the update. Anyone experiencing this error too?
  13. Hi Solskin: You need to change in the test environment the file: config/settings.inc.php with the new details to access to the test environment database. Once that you should enter to the backoffice and change de URL. Your prestashop backoffice will still have the URL of your production website and you should change if for the test environment URL. Best regards
  14. I suppose the left one is edge and the right one is chrome, right? Depending on the design same code could look different in different browsers. I use chrome and without identification i see webpage like right image. Please provide a demo login so we can see what is different when you are logged, but provably when you are logged has no sense to display the icons of facebook, google, amazon and paypal login as you are already logged. The other icons? without a login we can't see if there are css changes (different class, etc) in you template and that makes different look later. In my opinion you are saying this is a cache problem and when you use CCC a new file is created so as this is after the changes done in the css files there is no cache affecting.
  15. ¿Cual es tu web para que podamos ver las propiedades CSS de los elementos? Si quieres que sólo el cambio afecte a este formulario se me ocurre usar algún id o css que haya en esa página y no en la otra para crear propiedades CSS, pero lo mejor es verlo con tu plantilla.
×
×
  • Create New...