Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

Wartin

Members
  • Content Count

    286
  • Joined

  • Last visited

  • Days Won

    13

Wartin last won the day on March 20

Wartin had the most liked content!

Community Reputation

50 Excellent

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. I had to use phpmailer, as my server forbids me to use mail(). But you said you can use it from another script.
  2. 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: If I go to checkout: But, after clicking finish order the rule applies: Is it expected? the rule is applied only when finishing order, and not when adding products beyond my rule limit. Thanks!
  3. If you are in a shared hosting and have access to cPanel you can turn off ModSecurity just to make the change. I have to do it sometimes to make some changes, for example in SQL queries from the BO, it gives me permission error.
  4. I think I did it from Localization -> Countries, and then deleted 'birthdate' from 'address format'. But if hiding it works, it will do it for every country
  5. 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...
  6. Hola, de nada! espero que funcione. Mandá lo que tenes hecho hasta ahora. Saludos!
  7. Wartin

    Demo site

    I came for the same thing :)
  8. 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.
  9. Wartin

    Demo site

    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.
  10. Hooks are something more complex, I thought you were trying to just add some stuff there. I read this thread the other day, I think it's easy to follow: https://www.prestashop.com/forums/topic/403588-calling-value-of-a-function-of-a-module-within-a-file-theme-tpl/ bye!
  11. 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!
  12. 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!
  13. 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' :(
  14. 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!
  15. 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...