Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Activity

danielevigi's Achievements


Newbie (1/14)



  1. I'm trying to create a prestashop module that implements a gateway for a virtual POS. My module class extend PaymentModule. I saw that I can use displayPayment hook to display my payment in the list of payments. With a form with hidden inputs I can send order information to the URL of my virtual POS. The class PaymentModule has a method validateOrder. Should I call this method? And before or after confirmation of payment? I also saw that there is a class called PaymentCCCore. Can it be of help to me?
  2. I answer myself: yes, it's possible, just put override files (with correct folders structure) inside my module folder.
  3. Thanks for the reply. Can I put the override inside a module? So I can disable it when I no longer need.
  4. Is there a hook to change price (to all products) or to aplly a price reduction?
  5. This is my raw solution from the start: Create a controller In the method init() I check if exists a GET parameter with a specified code, in case I store a boolean variable in $context->cookie In the method initContent() I call setTemplate to display my template that show an alert to the user I have overwritten the method priceCalculation in Product.php adding at the end something like this: $myvar = (bool) intval($context->cookie->myvar); if ($myvar) { $price = $price - (($price * 30) / 100); // 30% discount } So when user visit my custom page (that use the created controller) will see the prices discounted of 30%.
  6. What I've done: create a controller save the parameters of the GET request in some variables create a template in the theme directory set the template in the controller What I need now and that I don't understand is how to apply my custom discount in the cart. I've seen the context object but I don't see where apply the discount or add the cart rule or the catalog rule. Can I use a hook? If yes, what hook?
  7. Yes, I know this. I've already created it in the backoffice. What I need is to automatic apply the cart rule when a user connects to the site through a specific URL. I need to do this because of a partnership with a marketing site. EDIT: I can use also catalog price rules. What I'm interested mainly is to apply it only reading GET parameters in the URL.
  8. Hi, I'm really new to Prestashop. I am a PHP developer. I am trying to understand how apply a cart rules using a URL (with GET parameters). Should I create a module or there is a simpler method? Which hook should I use?
  • Create New...