Jump to content

Eutanasio

Members
  • Posts

    1,156
  • Joined

  • Last visited

  • Days Won

    2

Eutanasio last won the day on November 13 2023

Eutanasio had the most liked content!

4 Followers

Profile Information

  • Location
    Spain
  • Activity
    Other

Recent Profile Visitors

10,600,408 profile views

Eutanasio's Achievements

  1. you need to see with a programmer for a custom solution. Ask @dnk.hack, he may know
  2. Yes this is standard behavior of Prestashop when calculating the shipping costs. I had also an issue with this feature that have recently been resolved in this post: Check the Class Cart.php (method getPackageList), here it calculates the shipping costs, you may be able to change the logic on what carrier is choosen, but don't know about letting the customer choose delivery method on this complex case of yours.
  3. have you tried deleting the cache of Prestashop? do you have access to the advanced parameters?
  4. I guess you have to configure this from the product configuration page, where you can select which carriers are available for each product. If you don't select any, then all available may be available for the product as well. Then also you can customize the details of each product, by adding dimensions and weight, so you can choose shipping rules accordingly as well. Also, if you have products in another country, you may think about the option of duplicating the product in your catalog, so the ones in country A may be offerend shipping A and the ones in country B may be offered carrier B. Your case is very special and you're using quite an old version of Prestashop. So you either work smart and find a way out with tricks like this, or you need a custom solution that may be using a paid module (be careful because it's difficult to find good ones compatible with ASM) or you may have to pay a savvy programmer to code for you a custom solution
  5. Hi, Has anyone already tried or experimented with integration of a chatbot based on GPT? There's already a module on Addons but it's still on a very early limited stage that doesn't really do what eCommerce owners really need to actually work as a real customer support. With the latest updates on ChatGPT, the technology is already there! but how to actually use it? we need a chatbot trained on the catalogs we have as well as sales conditions so can help customers find what they really need without the traditional limited manual menu navigation and input searching Anyone?
  6. YOU ARE SO RIGHT!! I've been suffering from this issue for years! such an easy simple fix and now it works as I want. THANK YOU!
  7. Thanks for the suggestion, but while this method might simplify the shipping fee issue, it introduces new challenges in logistics and backend management as it assigns all products the same warehouse no matter the stock levels. I'm looking for a solution that maintains warehouse integrity while solving the shipping cost issue.
  8. Hello everyone! I've encountered a common issue with ASM in PrestaShop 1.7 where shipping fees are doubled when a customer orders products from multiple warehouses. To address this, I've developed a modification to the Cart.php file that ensures shipping fees are added only once per order, regardless of the number of warehouses involved. The approach is to introduce a flag within the getDeliveryOptionList method that tracks if the shipping cost has been applied. Once the cost is added for the first package, the flag prevents any additional shipping fees for subsequent packages. Here's the proposed code change: // Add this flag before the foreach loop that iterates through $package_list $shipping_cost_added = false; // Inside the loop, where shipping costs are calculated for each carrier: if (!$shipping_cost_added) { $price_with_tax = ...; // original logic to calculate shipping with tax $price_without_tax = ...; // original logic to calculate shipping without tax $shipping_cost_added = true; } else { $price_with_tax = 0; $price_without_tax = 0; } // Continue with the rest of the loop I invite feedback on this solution, especially from those who have experienced similar issues. Your insights will be invaluable to validate and improve this approach. Thank you!
  9. of course, thanks for sharing! but I have no clue how to properly create a module. I've been customizing code for Prestashop for more than 10 years on a very basic level and trying to do it myself and with the help of the community, so others may also profit from what we achieve together and not to always rely on external programmers for every single tweak we need.
  10. Well, my first solution didn't work, so I modified AdminLoginController.php as @ventura suggested. This code modification prevents users (with profile ID's 5 & 13) from login on the specified schedule, but what I didn't get to make work are: - The error message the user gets when not allowed to login - The logout redirection that should reload the admin login page // Add the restricted profiles array and the time-based restriction methods protected $restrictedProfiles = [5, 13]; // Adjust the profile IDs as needed protected function canEmployeeLogin($employee) { $originalTimezone = date_default_timezone_get(); $shopTimezone = Configuration::get('PS_TIMEZONE'); if (!in_array($shopTimezone, timezone_identifiers_list())) { PrestaShopLogger::addLog("Invalid timezone set in PrestaShop configuration: {$shopTimezone}.", 3, null, 'Configuration', null); return false; } date_default_timezone_set($shopTimezone); $currentHour = date('G'); $currentDay = date('N'); $canLogin = $this->isLoginTime($currentDay, $currentHour); date_default_timezone_set($originalTimezone); return $canLogin; } protected function isLoginTime($currentDay, $currentHour) { $defaultWeekdayHours = ['start' => 9, 'end' => 21]; $loginHours = [ 1 => $defaultWeekdayHours, // Monday 2 => $defaultWeekdayHours, // Tuesday 3 => $defaultWeekdayHours, // Wednesday 4 => $defaultWeekdayHours, // Thursday 5 => $defaultWeekdayHours, // Friday 6 => ['start' => 10, 'end' => 20], // Saturday 7 => ['start' => 0, 'end' => 0], // Sunday ]; return $currentHour >= $loginHours[$currentDay]['start'] && $currentHour < $loginHours[$currentDay]['end']; } public function processLogin() { // ... (previous code for field validity checks) if (!count($this->errors)) { // ... (any existing code right before the employee validation) // Time-based restriction logic starts here // Find employee $this->context->employee = new Employee(); $is_employee_loaded = $this->context->employee->getByEmail($email, $passwd); if ($is_employee_loaded && in_array($this->context->employee->id_profile, $this->restrictedProfiles)) { if (!$this->canEmployeeLogin($this->context->employee)) { // Log the failed login attempt for administrative purposes PrestaShopLogger::addLog( "Employee with ID {$this->context->employee->id} attempted to log in outside the working hours.", 1, null, 'Employee', $this->context->employee->id ); // Add an error to prevent login $this->errors[] = $this->trans( 'You cannot log in at this time.', array(), 'Admin.Login.Notification' ); // Log out the employee immediately to prevent session from continuing $this->context->employee->logout(); // No need to redirect as the logout method should take care of this return; } } // Time-based restriction logic ends here // ... (rest of the login process, if no errors) } // ... (any other code that should run regardless of whether there are errors or not) }
  11. Not sure, the route seem to be good. But anyway, you should really consider optimizing the entire template and the images you use, its not very clean and may cause you troubles. You need a cleaner code, more responsive template and lighter images
  12. Try fixing the url's of the images, they have double slashes "//" which a browser may be able to handle but maybe the email client not. For example this one: https://bisubombom.com//mails/themes/modern/assets/baseline-credit_card-24px.png Put it like this: https://bisubombom.com/mails/themes/modern/assets/baseline-credit_card-24px.png
×
×
  • Create New...