Jump to content

Enzo Savoi

New Members
  • Posts

    5
  • Joined

  • Last visited

Enzo Savoi's Achievements

Newbie

Newbie (1/14)

  • Week One Done Rare
  • First Post Rare
  • Dedicated Rare
  • Conversation Starter Rare

Recent Badges

1

Reputation

  1. We already talked about it, but my boss want it that way, anyway, I already thought about cronjob for the multiple activations, I'll try to follow the lead.
  2. Hello everyone, I would like to try and found a way to automatically remove a product from the cart after a period of time passed. Let me give you an example at 10.00 AM the client adds "Product A" to his cart. at 11.00 AM the client adds "Product B" to his cart. Let's imagine he comes back at 13.00 PM and we set our time limit to 3 hours (or 10 800 seconds) then product A will be automatically removed from his cart. I do not wish to just empty the cart completely, just the products who've been in it for some time automatically. So theoretically here's how I think it could work. Step 1) when product is added thx to add_to_cart, after it's added the product id and the date and time in which it was added is noted somewhere, as well as a $limit_time : (which will basically be the date and time + the temporal limit we want) example : $actual_time = date('d-m-y h:i:s'); and $limit_time = date("Y-m-d H:i:s", strtotime('+3 hours')). ) Step 2) find a way to verify when actual_time is equal to limit_time, basically 3 hours later. Step 3) when actual_time is equal to limit_time recuperate the id product and remove it from the cart The script should run in the background, and be able to be activated multiple time at once, each for every item in the cart, and if the product is removed manually from the cart the specific script related to that product. If anyone has any idea of how to set all that up, if someone already did something akin to that, or if you have another way to put this out do not hesitate to tell me, I really need to find a way to do that.
  3. Hey, Thanks but the problem is already solved ^^also it won't really work as I don't want to deactivate the modal completely, just on the case of the button pressed, the usual add to cart buttons still making the modal pop out, but still thanks ^^
  4. Problem Solved. I used core.js and added a function which was the exact copy of add-to-cart, then I redirected this new function to the cart's url just after it added the product to the cart, which happens before the modal pop up.
  5. Hello everyone! I'm new here and a newbie in using prestashop. I'm blocked on a problem and I couldn't found any forum post to help me with it. Here's my problem : I want to create a button that will add a product to the cart and then open the cart. My big problem is that I can't really use add-to-cart as it forcefully open the pop-up modal, which is something I absolutely don't want to activate with my button, my main plain was to create a copy of the add-to-cart function in which I'll skip the pop-up modal activation. However it seems I cannot find where the function is located at all ? I thought the "display the pop-modal if add-to-cart is used" was located in --modules/creativeelements/views/js/frontend.js -- however it doesn't seem to be the case ? I'm honestly really lost, could anyone lend me a hand ?
×
×
  • Create New...