Jump to content
thirty bees forum

Wartin

Members
  • Posts

    347
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by Wartin

  1. I changed a little bit my code to:

        public function simulateCarriersOutput(Country $defaultCountry = null, $flush = false)
        {
            $carriers = parent::simulateCarriersOutput($defaultCountry, $flush);
            foreach ($carriers as $id => $carrier) {
                    if ($carrier['id_carrier'] == 264000) {
                            $carriers[$id]['delay'] = 'my updated delay';
                            //$carrier['delay'] = "delay_from_webservice";
                    }
            }
            return $carriers;
        }

    If I print the smarty variable $carriers in order-carrier.tpl with:

    {$carriers|@debug_print_var}

    I see the list of carriers modified, with my delay.

    BUT, it's not updated in carrier list

    What am I missing?

     

    Thanks again!!

  2. 22 hours ago, datakick said:

    Carrier delay is stored in the database, it's not dynamic at the moment.

    I guess we could create new hook that would allow modification of carrier list returned from Cart::simulateCarriersOutput.

    At the moment, I suggest you to create override of this method, call the parent one and modify it's result. Something like this:

     

    
    public function simulateCarriersOutput(Country $defaultCountry = null, $flush = false)
    {
    	$carriers = parent::simulateCarriersOutput(defaultCountry, flush);
    	foreach ($carriers as $carrier) {
    		if ($carrier['id_carrier'] === <myID>) {
    			$carrier['delay'] = '<delay_from_webservice>';
    		}
    	}
    	return $carrier;
    }

     

    Great, I managed to make it work (a couple of missing $, and I'm not sure if the return should return $carriers in plural like its parents.

    My override looks like:

    class Cart extends CartCore
    {
    
        public function simulateCarriersOutput(Country $defaultCountry = null, $flush = false)
        {
            $carriers = parent::simulateCarriersOutput($defaultCountry, $flush);
            foreach ($carriers as $carrier) {
                    if ($carrier['id_carrier'] == 264000) {
                            $carrier['delay'] = "delay_from_webservice";
                    }
            }
    
            return $carrier;
        }
    }

    I'm not sure why if my carrier's ID is 64 id_carrier is 264000, but this way it 'works'. I'm trying to first print 'delay from webservice' before using the new actual value.

    I don't know what's next, nor what we are doing exactly, besides reading each carrier data and changing the carrier we want to be changed.

    Thanks in advance!

  3. 3 hours ago, jollyfrog said:

    To sum up: Measuring server logs manually is not going to be feasible for everyone and, while not everyone want's to use Google, Matamo may be a happy medium.

    There is something left, and in the middle between the Matrix and full tracking. Using Apache, like ten years ago I used Webalizer. It shows you what logs can give you, and it's pretty easy to set up. I suppose it works with Nginx's logs too.

    Quote

    Hence, I would like to know more about your experiences with Matamo. Also, do ad blockers affect Matamo in the same way as GA?

    I used it before start using TB, setting by hand some 'events' to know what people were clicking. Then installed Thirtybees module and give it Matomo credentials and it start showing all about e-commerce. It's pretty nice. I can't compare it with GA really, haven't used it.

     

    • Like 1
  4. Hello. I'm trying to modify a carrier module to make it show the real delay for a specific order shipping.

    I read a couple of modules on github and they always set '$carrier->delay' to an array of strings in different languages, like:

                    'delay' => array(
                        'es' => 'Envío rapido',
                        'en' => 'Fast Shipping', // English value is required
                    ),

    I thought I could make something similar to what updates the price of the shipping, but I could see that the shop calls to getOrderShippingCost(), present in every module (or *External, sometimes). And there's not getOrderDelay() or similar.

    I do have the real delay (in days) that comes from the same webservice that returns the shipping price. Do I have to use JS to write it in the carrier list at order-carrier.tpl or maybe I can set some smarty variable?

    Thanks!

    edit: I found this:

    https://www.prestashop.com/forums/topic/219629-changing-carrier-delay-from-within-shipping-module/

    the last post adds a hook (hookDisplayBeforeCarrier()). I'm not sure how to 'call' it.

    edit2: maybe it has to be called like this (register the hook in module installation and then in template use     {$hookDisplayAfterCarrier nofilter} ?

    https://github.com/PrestaShop/PrestaShop/pull/5346/commits/a7914cbbfb494c07e0142d1f1315cee06e74f01e

  5. Thanks for the data, Jollyfrog.

    I use Matomo as I really don't like sending my customer's data to Google. It's not needed, with Matomo served locally I can know what people are doing and can choose not to save specific things like their exact IPs, for example.

    Using grep and awk is fine (like Neo reading the Matrix XD), of course, but when more data is needed, I think it's really important to know there are other things out of GA.

     

    • Like 1
    • Thanks 2
  6. Es un camino a veces un poco largo, hasta que más o menos encontrás las cosas que buscás. Pero no te desanimes! Hay una buena comunidad que en general responde las preguntas. Por lo menos en inglés, en castellano se mueve menos..

    Si algo no está traducido podés ir al mismo lugar y elegir el módulo en cuestión. Hay un botón de 'Expandir' que te muestra todas las oraciones, que muchas veces es muy práctico si buscás cambiar alguna traducción que no te parece correcta.

    Sobre el error, si te lo da la tienda, podés ponerla en 'modo depuración', para que te muestre errores lo más detallados posible.

    En el Backoffice, es decir el administrador de la tienda, tenés un buscador, hasta que te habitúes a los menúes.

    Saludos y suerte!

    • Like 1
  7. Hola!
    Qué cosas módulos te aparecen no traducidos?

    Fijate en Localización -> Traducciones en "Añadir / Actualizar un idioma", tal vez estás usando un tipo de español que tiene algunas cosas no traducidas? yo uso Español (Spanish).

    Para editar un tema de qué forma? Solo cambiar algunos colores o modificar cosas grandes? Para cositas podés usar el Custom CSS, o 'Código personalizado', donde se pueden meter estilos en línea para cambiar colores o cosas simples. Sino el módulo está dentro de /themes/nombre-de-tu-tema

    • Like 1
  8. Is it posible to edit specific prices? I see it's posible to erase them and create new ones. I have to change a lot of discounts prices.

    I tried Prestools too, and it show them, but can't edit them.

    I didn't try searching in the database directly.

    Thanks!

  9. Hello, yes, from BO you can select the account you want to delete and then 'delete selection' (thanks Mark, I couldn't find it earlier). But I think customers should be able to delete their accounts, as Andy's shop.

    Did you install some kind of module @AndyC?

    Thanks!

  10. Hello. Is it possible to delete a customer account?

    I read this thread(1) and it suggests that customers can't do it, or maybe I could find where to do it!

    I found some paid modules for prestashop in order to make such deletion, it seems to me weird to pay for such a feature.

    Thanks!

     

    (1)

    .

  11. On 1/23/2018 at 9:54 AM, datakick said:

    TB uses google location services to help you determine if customer's address is valid or not. This might prevent you from sending your goods to non-existing address. I would say that's a good thing.

    In order for this to work, you need to get google api key and save it to Preferences > General > Google Maps API Key. Without api key this whole process is useless.

    If you are really that paranoid and think that google is out there to get you, you can always edit file /controllers/admin/AdminOrdersController.php . line ~ 400. :)

    Hello, today I found this geocoding feature in BO, I didn't know it existed.
    Google is now requiring you to have a billing account in it's cloud services. In theory, it is free if you don't use it very often (they give you $200 every month).

    Would it be possible to reimplement georeference with a service like openstreetmaps for example? I prefer Matomo over Analitics, and really don't like the addresses of every customer being calculated by Google.

    Thanks!

    • Like 1
  12. Hello, nice to hear the good news about a new theme!

    When I start using TB a year ago I choose Niara because I thought it was the newer theme and, at least to me, is much cleaner and nicer. I had to change a lot of stuff, starting with mobile.

    It would be nice  to have some configurations in the new theme, for example the width of the items for top menu (I suppose it will have one!)

    Register forms have to be clean and simple. I agree with having an easy way of disabling some data as gender, birthday, etc.

    It would be really nice to use free fonts and having them locally, I prefer to not call google if I can. Changing fonts would be nice too.

    3 step checkout like (1) is really nice. I had to make some changes for niara, but I uploaded them as a .zip.

    A nice contact button (whatsapp/telegram, or whatever) flying easy to clic. I made one that goes to whatsapp if it's on mobile and goes to contact form if it's not.

    An more or less optimized rich content for search engines. I had to work a lot in order to make google read my products' information.

    +1 to FOSS, of course :)

    An easy way of changing colors. Custom CSS is OK, but not really easy for begginers.

    (1) https://forum.thirtybees.com/topic/2673-3-page-checkout-sort-of-for-community-default-theme/

    • Like 2
  13. It's OK. I'll explain how to do it in case someone else reads the thread.

    You have to create a new file called, for example, mysqltest.php with the code I pasted. The username and password has to be changed, of course. After saving it, you have to visit that file from the browser, like: yourdomainname.com/mysqltest.php

    If does not connect, it will show the error.

     

  14. 37 minutes ago, jollyfrog said:

    I would love to get to the bottom of it.

    If I were you I'd try connecting to the database directly from PHP, like:

     <?php
    $servername = "localhost";
    $username = "username";
    $password = "password";
    
    // Create connection
    $conn = mysqli_connect($servername, $username, $password);
    
    // Check connection
    if (!$conn) {
      die("Connection failed: " . mysqli_connect_error());
    }
    echo "Connected successfully";
    ?> 

    (from https://www.w3schools.com/php/php_mysql_connect.asp)

    Gook luck!

  15. On 1/13/2021 at 9:33 AM, vincentdenkspel said:


    Does somebody have some tips for me what i can do to rank higher ?

    You can use the Google Search Console to see if it's indexing all your site well. Rich content is one of the things that can improve the way your site is showed.

    • Like 1
×
×
  • Create New...