Jump to content

kalle@makewebo

Members
  • Posts

    41
  • Joined

  • Last visited

About kalle@makewebo

  • Birthday 12/06/1990

Profile Information

  • First Name
    Kalle
  • Last Name
    Ekelund

Recent Profile Visitors

397 profile views

kalle@makewebo's Achievements

  1. Hi! We are trying to use the same database for our local development in our team. We have managed to connect to the database but it's extremly slow at fetching the data. We have trouble finding why, and perhaps someone here can shed some light. So we are using Xampp and have setup a Mysql server on Azure (Basic setting, 2 virtual cores, 10GB). Testing using the local db from Xampp our start page loads within 3-5 seconds (No caching or performance settings turned on) Loading the same page using our remote mysql server it loads within 30-40 seconds. One thing that could obviously be the bottleneck is our MySql Server just being to slow. But fetching data using Mysql Workbench is no problem in speed. We are only three members in our team, so the server should be able to handle the workload. It feels like there is some setting in either Xampp or Prestashop that just doesn't play with our remote server. Does anyone have any ideas what we can try to speed things up? Or should we just give up on the idea to be able to use the same database (or any other way to do it?) The reason we want to share database is so we don't have to setup all configurations for shops/modules/whatever for every user every time we makes changes/improvements. Best Regards
  2. Hi! So we have two shops that are on the same domain. www.domain.com (Shop 1) and www.domain.com/shop (Shop 2). What we want is that when you logout from shop 2 that you also are logged out from shop 1 and vice versa. We got login to work, but logout seems impossible. It works fine on our local environment with both login and logout. Since everything is on the same domain I just can't understand why the cookies won't be cleared. So we have a module that is hooked to hookActionAuthentication (login) and hookActionCustomerLogoutAfter (logout) and one Configuration value holding the shop id of the opposite shop. This is our code: public function hookActionAuthentication($params) { $cookie = new Cookie('ps-s' . Configuration::get('OPPOSITE_SHOP')); $shop = new Shop(Configuration::get('OPPOSITE_SHOP')); $cookie->__set('id_compare', $this->context->cookie->id_compare); $cookie->__set('id_customer', $this->context->cookie->id_customer); $cookie->__set('customer_lastname', $this->context->cookie->customer_lastname); $cookie->__set('customer_firstname', $this->context->cookie->customer_firstname); $cookie->__set('logged', 1); $cookie->__set('is_guest', $this->context->cookie->is_quest); $cookie->__set('passwd', $this->context->cookie->passwd); $cookie->__set('email', $this->context->cookie->email); $cookie->setPath($shop->getUrls()[0]['physical_uri']); $cookie->write(); } public function hookActionCustomerLogoutAfter($params) { $cookie = new Cookie('ps-s' . Configuration::get('OPPOSITE_SHOP')); $shop = new Shop(Configuration::get('OPPOSITE_SHOP')); setcookie($cookie->getName(), '', 1); setcookie($cookie->getName(), '', 1, '/'); setcookie($cookie->getName(), '', 1, $shop->getUrls()[0]['physical_uri']); } So what am I missing? I just can't understand why the cookies won't be cleared. The physical_uri for both shops is '/' (needed to unset it for local development). Even tried other php scripts for clearing cookies, which clears them locally but doesn't logout on opposite shop. So what kind of [spam-filter] does Prestashop do with my cookies? Kind Regards Kalle
  3. What permission does the Employee have? Because I just noticed you can untick the option to create orders for different employee profiles. But I would assume you are SuperAdmin, but that is the only thing out of the box I can think of.
  4. We solved this today with an easy fix. The problem is that the customer has managed to add products into the cart with different delivery addresses. You can check ps_cart_product table in the database to confirm this is the case. What happens then is that when an order is created it fetches a package list from the cart. The package list combines an array merged with the products for each address. So if there is multiple addresses for the products then there will be multiple orders with the same reference. This solution is to make sure that the package list only contains one address.So we create an override of the Cart class and overrides the function getProductList. We simply look at the result and checks if the products id_delivery_address is the same as the cart if not set it to the carts address. This is the code we use: public function getProducts($refresh = false, $id_product = false, $id_country = null) { $product_list = parent::getProducts($refresh, $id_product, $id_country); foreach($product_list as &$product){ if($product["id_address_delivery"] != $this->id_address_delivery) { $product["id_address_delivery"] = $this->id_address_delivery; } } return $product_list; } Thanks to ebonit and selectshop.at for all the help.
  5. Well that could be a reason since we have redone the templates and we have overrides. What we found also is that the cart is rather old compared to when the product was added. That somehow made it possible to add products with different id_delivery_addresses. Which is odd because when I change delivery address the system changes all the products id_delivery_address. But I would still say this is a bug in Prestashop since there is no configuration in our Prestashop that says we can do split orders. I think I will post a ticket on forge so the developers can look into it.
  6. I found the reason why two orders are created. It's like you describe it, just we can't recreate that. The order is created in PaymentModule::ValidateOrder in this function it gets a list from Cart::getPackageList. That list is split by two addresses so it creates one order with the same reference for each address. So where does the address comes from? Well in Cart::getPackageList it gets the products from Cart::getProducts and uses each products address. If you look in your database you and ps_cart_product you can see that for the cart the order was created the products have multiple addresses. So somehow the customer has managed to add products with different addresses to the cart. So hopefully we can manage to find a solution for this tomorrow.
  7. That option has been disabled since well I don't know, but from the beginning I would say. If we check the database there is no record of the PS_SHIP_WHEN_AVAILABLE. Sure we have some imported carts from the old database that have been struggling. But we are getting orders fro yesterday with carts created yesterday that generates a linked order. We managed to recreate on once by manipulate the cart directly. It's frustrating when you can't recreate it properly, so you have to guess and if you think you found a solution wait.
  8. Hi! That option is already disabled for all shops. So in our case that isn't the problem, but sounds like a solution
  9. Thank you @ebonit for looking into this. I just can't see why Multi Shipping would have anything to do with this. There is no record of it in the database and every instance of multishipping in the code checks if true or false. Since it doesn't exist it will always return false. But we found today a connection between the orders or more accurate the carts. It would be grateful if you could check this yourself, because we can't recreate any linked orders. In the ps_cart table we found that on these linked orders there was two addresses in the delivery_option table. Is this something that is the same for you? Our guess is that because there is two addresses then Prestashop think it should be split. So we are now gonna try and see if we can fix that. My guess is that the fix should be to always try have that column empty.
  10. Exporting a theme only exports the theme folder and the modules that you wanted. Your settings is in the database so you'll need to export some tables as well. I would export all ps_modules_xxxx tables and then ps_hook_xxxx tables. Then maybe ps_tab and ps_theme tables could be useful. (I never done this sort of operation myself since every time I had to export a theme I also took the entire database)
  11. In an override of the PaymentModule.php that you put under /override/classes/ folder. If you haven't overwritten the file you can download my script in post #47. Not sure what you are asking secondly about identical orders, but that might be a different issue.
  12. If you go into blocklayered configure page. Then you should have a filter template if not create one. In the template you can deactivate the filters you don't want/need.
  13. If related products is a module then you can just register the module to whatever hook you want it on. The product page has a couple of hooks you could use.
  14. The .php file you are looking for is PaymentModule.php that you can find under Classes folder. In the validateOrder() function the Order confirmation mail is being sent. So override that and change the total_paid or add more parameters.
×
×
  • Create New...