Jump to content
thirty bees forum

Wartin

Members
  • Posts

    347
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by Wartin

  1. Hi. I think you have to change order-address.js in your theme. I'm not sure if this is the way to go or is preferable to add custom javascript.

    image.png.251765045113370272433f84b931326c.png

    In order to see more information like in the screenshot above you have to right click the element and then choose 'Inspect element'.

    Good luck!

    • Like 1
  2. 18 hours ago, rubben1985 said:
    19 hours ago, Wartin said:

     

    The checkbox is "use the same address" so it should hide the repeating address. But If you see, this bug also affects the opposite (check the video how marking the checkbox each time makes the opposite. It only matter what was last settting, not if was marked or unmarked) 

    You could change that behavior changing the javascript function. Here is how to make it, in three different ways:

    https://www.tutorialsrack.com/articles/403/how-to-show-and-hide-div-on-checkbox-check-or-uncheck-using-jquery-or-javascript

  3. 56 minutes ago, rubben1985 said:

    Go to 0:20 sec in the video. You can see how I mark: "use same adress for invoice and shippin"g and this makes to show "two adresses" even if that usually means to show only one (it makes this because previously i unmarked and went back)

    Here it seems to be working well, if the checkbox is marked it shows two addresses, if it's not, it shows only one. No matter if I go to the third step and then go back.

    But i'm not using toplakd version, I made some changes for niara (i uploaded the .zip in the same thread)

  4. On 4/16/2021 at 6:23 PM, purechoice said:

    I am using TB and I use Canadapost for shipping.  I want to be able to give a customer group flat rate shipping of $9.99 on orders over $149.  Anyone know how to do this? I still need Canadapost module to mange the shipping.

    In each carrier you could make a new range and in prices over 149 set it to 9.99. BUT that won't make it just for one customer group, but everybody.

    In order to make something with just one customer group and shipping, you could make a Cart Rule. That way you can set free shipping for orders over 149. But I think you cant charge the 9.99...

    Maybe all this is helpful

  5. On 4/19/2021 at 10:31 AM, rubben1985 said:

    Hi, I just discovered a bug in the address step.

    The check button on "same invoice address" does have some troubles because can be activated and sometimes it shows both address and sometimes hide the repeated one. I discovered it seems to change the behavior each time we enter in this step keeping the "actual state" as the option that hides the second address. I mean: if use same address was activated, entering an unchecking the box will show the second address-> this is correct. But if we uncheck, go back and forward, "checking" the box, will show this time the second address.

    As it is complicate to understand we recorded a video:

    https://www.loom.com/share/7969460c80fe4517ac3721cdf177e3b6

    You can see the wrong behavior in second 22

    Note: I am not sure if hiding the address when "use same" checkbox is activated is the natural behavior or it was a modification we made here in the forum.

    Maybe you're using 3 step checkout for Niara? I think I added that behavior.

    The idea is that if you want the same address it should not show two addresses. I don't see an incorrect behavior with checkbox in your video, but it should start hidden, and then, if you want a different address for invoice you have to click the checkbox.

  6. Hello again.

    Yes, it does what is says it does, displays how much you have to spend to get the general free shipping. That value is read from carriers->preferences, or you have the option to set it in the module's configuration page.

    BUT, you don't have the option to show a message for the carrier selected. So if you have different free shipping values from different carriers (like in my case) it's not really useful.

    My ideal would be to show, in blockcart/includes/popup.tpl, how much is needed to pass the barrier of the free shipping that's being calculated in the selected carrier in that popup.

  7. 32 minutes ago, mwrouse said:


    I have tried using the PHP mail() function, doesn't work. But when I create a standard php page somewhere else on my server and go to it, the mail function works fine there.
    I have tried SMTP and that doesn't work either, but my SMTP settings are working and tested with the SMTP test website.

    I had to use phpmailer, as my server forbids me to use mail(). But you said you can use it from another script.

  8. Hello! I'm trying to set free shipping just for a carrier, starting from an amount of money (3000 in my case). I see there are two possibilities:

    1) from carrier, setting two ranges, 0 to 3000 with the actual price and 3000 to inf with zero

    2) setting a cart rule with a minimum of 3000, and setting just the carrier I want to give the free shipping.

    I think the second one is the best. I did it, and it shows free shipping but only just after buying, but not in the modal after adding to cart, nor in the summary.

    After adding a product that reaches 3000 the modal says:

    image.png.d9117a514bb9aad81acf93468d0cac83.png

    If I go to checkout:

    image.png.f52af5112a473c3d6b1916d49ae585ba.png


    But, after clicking finish order the rule applies:

    image.png.0a31e973efb30b0caabe9761da258add.png

    Is it expected? the rule is applied only when finishing order, and not when adding products beyond my rule limit.

    Thanks!

  9. On 3/18/2021 at 9:26 PM, haylau said:

    Looks OK, but is fixed. Should it be possible to add the relevant code from products.tpl to the html box to display and automatic table in the html block? That way I can display the actual prices. I have tried but it just displays code. 

    Possible?

    Mmm I think you will have to change the template, because you have to print smarty variables... I think you won't be able to do that with HTML block...

    • Like 1
  10. On 3/5/2021 at 7:07 PM, SLiCK_303 said:

    The demo sites front end.... The slider images are not showing correctly.

    I came for the same thing :)

    image.thumb.png.2a4daa38c5c644e719d1890f1cb45c0b.png

  11. Hola. Sí, si estás usando el checkout en 5 pasos el archivo a editar es themes/niara/order-carrier.tpl, y agregarías un nuevo <input> debajo del que tiene el label cgv. te quedaría algo as

              <label for="cgv">
                <input type="checkbox" name="cgv" id="cgv" value="1" {if $checkedTOS}checked="checked"{/if}>
                    <span class="label-text" style="font-weight:bold;">
                    {l s='I agree to the terms of service and will adhere to them unconditionally.'}
                    </span>
              </label>

                <input type="checkbox" name="tu-nuevo-input" id="elnombre">

    No entendí bien qué significa que el resultado aparezca en traducciones.

     

    • Thanks 1
  12. Yesterday I was trying to see the five step checkout in a clean TB, so I went to the demo. It would be nice to have a user/pw visible just to sign in without making an account.

     

  13. 58 minutes ago, datakick said:

    I would just suggest you don't use check (70 == $idCarrier), because $idCarrier will change every time you save carrier in back office. It would be better to modify this check and base it on different information from $data, maybe carrier name or carrier reference id

    Yes, it was something i didn't knew how to fix. Now instead of:

                        if (70  == $idCarrier) {

    reads:

                        if ($data["instance"]->name == 'My carrier's name') {

     

    Thanks again!

  14. Great, finally I tried two ways persisting the delay. First I tried with cookies, saving the value in the module with this:

    $this->context->cookie->__set('newdelay', $data->PlazoEntrega);
    $this->context->cookie->write();

    And then in the override of the function getDeliveryOptionList this:
     

        public function getDeliveryOptionList(Country $defaultCountry = null, $flush = false)
        {
            if (Context::getContext()->cookie->__isset('newdelay')){
                    $newdelay = Context::getContext()->cookie->__get('newdelay');
            }
            $delay = [
                1 => $newdelay.' días',
            ];
    
            $deliveryOptionList = parent::getDeliveryOptionList($defaultCountry, $flush);
            foreach ($deliveryOptionList as $idAddress => $deliveryOption) {
                foreach ($deliveryOption as $key => $value) {
                    foreach ($value['carrier_list'] as $idCarrier => $data) {
                        // override Carrier
                        if (70  == $idCarrier) {
                            $deliveryOptionList[$idAddress][$key]['carrier_list'][$idCarrier]['instance']->delay = $delay;
                        }
                    }
                }
            }
            return $deliveryOptionList;
        }

     

    The second try, that I chose over the cookie was to add a column in module's table in the database, as it already register there other values concerning orders and prices. Then, in getDeliveryOptionList I get order values and make a query to module's table:

    class Cart extends CartCore
    {
        public function getDeliveryOptionList(Country $defaultCountry = null, $flush = false)
        {
            $deliveryOptionList = parent::getDeliveryOptionList($defaultCountry, $flush);
    
            $weight = $this->getTotalWeight();
            $address = new Address(Context::getContext()->cart->id_address_delivery);
            $postcode = $address->postcode;
    
            foreach ($deliveryOptionList as $idAddress => $deliveryOption) {
                foreach ($deliveryOption as $key => $value) {
                    foreach ($value['carrier_list'] as $idCarrier => $data) {
                        // override Carrier
                        if (70  == $idCarrier) {
                            $query = new DbQuery();
                            $query->select('delay')
                            ->from('tb_ocae_quotes')
                            ->where('reference = 369 AND postcode ='.$postcode);
                            $newdelay = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
                            $delay = [
                                1 => $newdelay.' días',
                            ];
    
                            $deliveryOptionList[$idAddress][$key]['carrier_list'][$idCarrier]['instance']->delay = $delay;
                        }
                    }
                }
            }
            return $deliveryOptionList;
        }
    }

    I tried to get the total cart price with getDeliveryOptionList but it overflows php, no idea what am I doing wrong.

    @Quant, maybe this is useful for you too.

    Thanks!

  15. 1 hour ago, datakick said:

    You will probably also need to implement some cron job to periodically fetch delay value from webservice, unless the webservice is called on every page load of your checkout (which would be crazy performance bottlenect)

    Delay values comes in the same answer where the price comes from carrier webservice. The module indeed executes a call in every checkout (it's open source, I didn't made it). It saves in the database some values (weight, postal codes, price, etc.) to not call it again if it already did.

    Well, I thought I could use a cookie or some call to write the new delay in carrier list. Or to implement some function in my module like the one that returns the price.

    Thanks for your help. I think I'll have to just write 'from 2 to 8 days' :(

  16. On 2/17/2021 at 2:38 PM, datakick said:

    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:

    Hello! I'm still stuck here.

    I tried both suggestions. With the override of simulateCarriersOutput I could put some string in delay, visible in .tpl with the smarty variable $carriers. With Quant's solution (getDeliveryOptionList override) my new delay string is showed in carrier list.

    I couldn't pass the real delay value returned by the webservice in a module to Cart class. I need a tip here :)

    If I can do it I'll write my solution here.

    Thanks!

  17. Hello, thanks for your response. My idea is to write there the real delay, in days, returned by a webservice in a module. I thought you were doing the same.

    The module use a webservice method to ask for the price. I have an array in the module with the price and the delay. I'm reading a lot of posts and documentation, and @datakick gave me a nice hint, but couldn't finish doing what I'm trying to do (I think it's basic to know how many days a client will have to wait).

    I think I need a hook registered by the module, who receives the id and shows the delay for that carrier.

    Option. Save Adresse -> $ other = 'Als mein benutzerdefinierter Text'
    Delay, replace Verzögerung with Adresse -> $ andere. 

    I'm sorry, I don't understand what did you mean here.

    Thanks

×
×
  • Create New...