Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/11/2022 in all areas

  1. Ciao, Si prega di seguire questo> Modifica: public_html/src/PrestaShopBundle/Resources/views/Admin/Product/CatalogPage/Lists/list.html.twig file alla riga 64 trova {% if 'PS_STOCK_MANAGEMENT'|configuration %} e aggiungi questo codice dopo/sotto {% if product.sav_quantity == 0 %} <td class="product-sav-quantity text-center" style="background:red;" data-product-quantity-value="{{ product.sav_quantity|default('') }}"> <a href="{{ product.url|default('') }}#tab-step3"> {% if product.sav_quantity is defined and product.sav_quantity > 0 %} {{ product.sav_quantity }} {% else %} {{ product.sav_quantity|default('N/A'|trans({}, 'Admin.Global')) }} {% endif %} </a> </td> {% endif %} salvalo, svuota la cache e poi controlla i risultati! Dovrebbe sembrare come questo. (puoi giocarci insieme se hai bisogno di aree defirent in rosso) Saluti
    1 point
  2. Finalmente activé la geolocalización por IP y ha sido la manera de solucionar el problema. Gracias a los dos por las respuestas.
    1 point
  3. Hello, Please follow this> Edit: public_html/src/PrestaShopBundle/Resources/views/Admin/Product/CatalogPage/Lists/list.html.twig file on line 64 find {% if 'PS_STOCK_MANAGEMENT'|configuration %} and add this code after/below After {% if 'PS_STOCK_MANAGEMENT'|configuration %} Replace the code to this (please look at the screenshot where it should be) {% if product.sav_quantity == 0 %} <td class="product-sav-quantity text-center" data-product-quantity-value="{{ product.sav_quantity|default('') }}"> <a href="{{ product.url|default('') }}#tab-step3" style="background:red; padding: 5px 5px;"> {% if product.sav_quantity is defined and product.sav_quantity > 0 %} {{ product.sav_quantity }} {% else %} {{ product.sav_quantity|default('N/A'|trans({}, 'Admin.Global')) }} {% endif %} </a> </td> {% else %} <td class="product-sav-quantity text-center" data-product-quantity-value="{{ product.sav_quantity|default('') }}"> <a href="{{ product.url|default('') }}#tab-step3"> {% if product.sav_quantity is defined and product.sav_quantity > 0 %} {{ product.sav_quantity }} {% else %} {{ product.sav_quantity|default('N/A'|trans({}, 'Admin.Global')) }} {% endif %} </a> </td> {% endif %} {% else %} <td></td> {% endif %} save it, clear cache and then check the results! (you can play with it along if you need deffirent areas in red) Please hit the like button if you find this helpful Regards
    1 point
  4. Hi @danyw3b, Unfortunately, PrestaShop does not allow this. However, there is a module that allows you to do. Module name: Cart rules to products with or without discounts https://addons.prestashop.com/en/promotions-gifts/25901-conditional-cart-rules-without-offers-on-sale.html Kind regards, Leo
    1 point
  5. There was a bug in some browsers 😅 It's fixed now:
    1 point
  6. Whoever still have issue with such spam, here is simple fix by creating override of contactform module. If you want to block more email adresses, just add them to array. <?php if (!defined('_PS_VERSION_')) exit; class ContactformOverride extends Contactform { public function sendMessage() { $banned = array('[email protected]','[email protected]'); if(!in_array(trim(Tools::getValue('from')),$banned)){ $extension = ['.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg']; $file_attachment = Tools::fileAttachment('fileUpload'); $message = trim(Tools::getValue('message')); $url = Tools::getValue('url'); $clientToken = Tools::getValue('token'); $serverToken = $this->context->cookie->contactFormToken; $clientTokenTTL = $this->context->cookie->contactFormTokenTTL; if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from)) { $this->context->controller->errors[] = $this->trans( 'Invalid email address.', [], 'Shop.Notifications.Error' ); } elseif (empty($message)) { $this->context->controller->errors[] = $this->trans( 'The message cannot be blank.', [], 'Shop.Notifications.Error' ); } elseif (!Validate::isCleanHtml($message)) { $this->context->controller->errors[] = $this->trans( 'Invalid message', [], 'Shop.Notifications.Error' ); } elseif (!($id_contact = (int)Tools::getValue('id_contact')) || !(Validate::isLoadedObject($contact = new Contact($id_contact, $this->context->language->id))) ) { $this->context->controller->errors[] = $this->trans( 'Please select a subject from the list provided. ', [], 'Modules.Contactform.Shop' ); } elseif (!empty($file_attachment['name']) && $file_attachment['error'] != 0) { $this->context->controller->errors[] = $this->trans( 'An error occurred during the file-upload process.', [], 'Modules.Contactform.Shop' ); } elseif (!empty($file_attachment['name']) && !in_array(Tools::strtolower(Tools::substr($file_attachment['name'], -4)), $extension) && !in_array(Tools::strtolower(Tools::substr($file_attachment['name'], -5)), $extension) ) { $this->context->controller->errors[] = $this->trans( 'Bad file extension', [], 'Modules.Contactform.Shop' ); } elseif ($url !== '' || empty($serverToken) || $clientToken !== $serverToken || $clientTokenTTL < time() ) { $this->context->controller->errors[] = $this->trans( 'An error occurred while sending the message, please try again.', [], 'Modules.Contactform.Shop' ); $this->createNewToken(); } else { $customer = $this->context->customer; if (!$customer->id) { $customer->getByEmail($from); } /** * Check that the order belongs to the customer. */ $id_order = (int) Tools::getValue('id_order'); if (!empty($id_order)) { $order = new Order($id_order); $id_order = (int) $order->id_customer === (int) $customer->id ? $id_order : 0; } $id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($from, $id_order); if ($contact->customer_service) { if ((int)$id_customer_thread) { $ct = new CustomerThread($id_customer_thread); $ct->status = 'open'; $ct->id_lang = (int)$this->context->language->id; $ct->id_contact = (int)$id_contact; $ct->id_order = $id_order; if ($id_product = (int)Tools::getValue('id_product')) { $ct->id_product = $id_product; } $ct->update(); } else { $ct = new CustomerThread(); if (isset($customer->id)) { $ct->id_customer = (int)$customer->id; } $ct->id_shop = (int)$this->context->shop->id; $ct->id_order = $id_order; if ($id_product = (int)Tools::getValue('id_product')) { $ct->id_product = $id_product; } $ct->id_contact = (int)$id_contact; $ct->id_lang = (int)$this->context->language->id; $ct->email = $from; $ct->status = 'open'; $ct->token = Tools::passwdGen(12); $ct->add(); } if ($ct->id) { $lastMessage = CustomerMessage::getLastMessageForCustomerThread($ct->id); $testFileUpload = (isset($file_attachment['rename']) && !empty($file_attachment['rename'])); // if last message is the same as new message (and no file upload), do not consider this contact if ($lastMessage != $message || $testFileUpload) { $cm = new CustomerMessage(); $cm->id_customer_thread = $ct->id; $cm->message = $message; if ($testFileUpload && rename($file_attachment['tmp_name'], _PS_UPLOAD_DIR_ . basename($file_attachment['rename']))) { $cm->file_name = $file_attachment['rename']; @chmod(_PS_UPLOAD_DIR_ . basename($file_attachment['rename']), 0664); } $cm->ip_address = (int)ip2long(Tools::getRemoteAddr()); $cm->user_agent = $_SERVER['HTTP_USER_AGENT']; if (!$cm->add()) { $this->context->controller->errors[] = $this->trans( 'An error occurred while sending the message.', [], 'Modules.Contactform.Shop' ); } } else { $mailAlreadySend = true; } } else { $this->context->controller->errors[] = $this->trans( 'An error occurred while sending the message.', [], 'Modules.Contactform.Shop' ); } } $sendConfirmationEmail = Configuration::get(self::SEND_CONFIRMATION_EMAIL); $sendNotificationEmail = Configuration::get(self::SEND_NOTIFICATION_EMAIL); if (!count($this->context->controller->errors) && empty($mailAlreadySend) && ($sendConfirmationEmail || $sendNotificationEmail) ) { $var_list = [ '{firstname}' => '', '{lastname}' => '', '{order_name}' => '-', '{attached_file}' => '-', '{message}' => Tools::nl2br(Tools::htmlentitiesUTF8(Tools::stripslashes($message))), '{email}' => $from, '{product_name}' => '', ]; if (isset($customer->id)) { $var_list['{firstname}'] = $customer->firstname; $var_list['{lastname}'] = $customer->lastname; } if (isset($file_attachment['name'])) { $var_list['{attached_file}'] = $file_attachment['name']; } $id_product = (int)Tools::getValue('id_product'); if ($id_order) { $order = new Order((int)$id_order); $var_list['{order_name}'] = $order->getUniqReference(); $var_list['{id_order}'] = (int)$order->id; } if ($id_product) { $product = new Product((int)$id_product); if (Validate::isLoadedObject($product) && isset($product->name[Context::getContext()->language->id]) ) { $var_list['{product_name}'] = $product->name[Context::getContext()->language->id]; } } if ($sendNotificationEmail) { if (empty($contact->email) || !Mail::Send( $this->context->language->id, 'contact', $this->trans('Message from contact form', [], 'Emails.Subject').' [no_sync]', $var_list, $contact->email, $contact->name, null, null, $file_attachment, null, _PS_MAIL_DIR_, false, null, null, $from )) { $this->context->controller->errors[] = $this->trans( 'An error occurred while sending the message.', [], 'Modules.Contactform.Shop' ); } } if ($sendConfirmationEmail) { $var_list['{message}'] = self::MESSAGE_PLACEHOLDER_FOR_OLDER_VERSION; if (!Mail::Send( $this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? $this->trans( 'Your message has been correctly sent #ct%thread_id% #tc%thread_token%', [ '%thread_id%' => $ct->id, '%thread_token%' => $ct->token ], 'Emails.Subject' ) : $this->trans('Your message has been correctly sent', [], 'Emails.Subject')), $var_list, $from, null, null, null, $file_attachment, null, _PS_MAIL_DIR_, false, null, null, $contact->email )) { $this->context->controller->errors[] = $this->trans( 'An error occurred while sending the message.', [], 'Modules.Contactform.Shop' ); } } } if (!count($this->context->controller->errors)) { $this->context->controller->success[] = $this->trans( 'Your message has been successfully sent to our team.', [], 'Modules.Contactform.Shop' ); } } }else{ $this->context->controller->errors[] = $this->trans( 'Invalid email address.', [], 'Shop.Notifications.Error' ); } } } contactform.zip
    1 point
  7. I managed to create a tiny module where I show both prices (with and without tax) using: $priceWithTax = Tools::displayPrice($product->getPrice(true, null, 6, null, false, false), $this->context->currency); $priceWithoutTax = Tools::displayPrice($product->getPrice(false, null, 6, null, false, false), $this->context->currency); Just need to find out how to display the discounted prices with and without tax
    1 point
  8. Regarder le tableau de compatibilité.,. La première ligne 👌
    1 point
  9. On index.php too ? (not only in js, because bots attacks the controller and not the web page) Bots can't pass this^^
    1 point
  10. Change friendly URL of the 'contact us' page at SEO & URL. For example, from contact-us to contact.
    1 point
  11. Wen man zeit hat und etwas Grundkenntnisse kann man auch selber erstellen nach eigenen wünschen. Dazu nimmt man den Default Template von Presta und Exportiert es, nähere Beschreibung hier im Doku. http://doc.prestashop.com/display/PS16/Templates
    1 point
  12. Witam. W tej chwili jest 1 główna kategoria i podkategorie. Podkategorie wyświetlają się wg numeru id. Chciałbym, żeby wyświetlały się w kolejności alfabetycznej. Da się to jakoś zmienić? Presta 1.6.1.4, moduł default. Link do sklepu kolegi: http://www.czescidosamochodow.eu ps. Znalazłem coś takiego w internecie - dotyczyło wersji 1.5. NIESTETY TO NIE POMOGŁO: cytuję: Wystarczyła jedna modyfikacja kodu i już jest ok. W pliku classes/Categorry.php wiersz: ORDER BY `level_depth` ASC, category_shop.`position` ASC zmieniłem na: ORDER BY `level_depth` ASC, cl.`name` ASC Piotr
    1 point
  13. Hi, to stop showing products from sub-categories in parent category page i solved using layered navigation block module. In "configuration" section uncheck "Show products from subcategories". (ps 1.5.6) Hope this helps
    1 point
  14. on old domain and website you can do it with htaccess 301 redirection: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]
    1 point
  15. The problem when using this hook is that all not the modules use it, so you will find these "hidden" products in some places.
    0 points
  16. Closing open new topic if u don't find answer here.
    0 points
  17. Like I wrote before you can hire someone to make those changes and you can pull it to prestashop github to make theme free in future. You have PrestaShop for free, so if you give your customer your motcycles also for free without wheels I think they will buy those wheels because it's not that much cost like buy whole vehicle. You can easly extends any part on prestashop, by making changes in code or by installing moduls. In that case you have right this thread is about spam issue, not for reading yours complaints or reading my "not relevant" comments, so any other post not in topic subject will be removed, so please do not reply to my post.
    0 points
  18. Open source doesn't mean all is free. @madmartian On forum is a lot of tutorials how you can disable unwanted messages from specific email address, what differs between 1.6 and 1.7 is file where you must do changes but code in both files is simmilar and changes are almost identical. @Snobs Prestashop is open source so if any thing is missing or not working as expect you can look into code and add missing functionallity or fix any issue, also those changes you can provide on prestashop github project and probably they will be added in future with next version release. Thats how opens source work. I think there isn't any other opensource platform with that much free functionality as prestashop have, of cource prestashop is not ready for all bussiness thats why you might need some modules, themes or services by programmers. You can also learn how make those changes by yourself and then you can make it all for free. Once I also had problem with unwanted email thats why I make module to protect my contact form for specific email addresses, domains, some signs, and also I added reCaptcha protection. You can make those changes for free in your store or you can hire programmer and pay someone for his job or buy ready module.
    0 points
  19. The reason to have open source is that it can be modified. If you cannot modify then you get what you got.
    0 points
  20. perdona amigo, no es algo q se pueda explicar por aqui ya q no es un archivo el checkout, es un labertiento de archivos php i tpls. Busca ayuda de algun experto en prestashop para algo tan complejo, q te haga un modulo propio o te modificque codigo o prueba en addons, hay modulos para checkouts personalizados, creo. Suerte
    0 points
  21. @akoylini this is not forum issue but your PrestaShop, best way is add recaptcha to your contact form.
    0 points
×
×
  • Create New...