How to skip payment step in Prestashop 1.7 - prestashop

I'm using prestashop 1.7.6.8. In my process the client can take the item from the store or get it delivered and the payment will be when receiving the item.
Is there any way to remove payment method step or redirect it to the next step in tpl file?

You have the payment option "cash on delivery" to allow the customer to pay after receiving the order.
It's a native Prestashop payment module. You can install it as any other payment method.
If it's not what you are looking for, you can also override the OrderController class to add or remove a step, but in my opinion, the "payment method" way is much simpler.

Related

PrestaShop hook for standard Refund

what hooks should be used for standard refund in prestaShop?
i used hookActionOrderSlipAdd in partial refund and works good , but got stuck with standard refund
You can consider using actionOrderStatusPostUpdate hook and check if the order status is set to any on the one to be considered as refunded (usually PS_OS_CANCELED / PS_OS_REFUNDED in Configuration table).

How to remove address and shipping checkouts in prestashop 1.7.7

I have been able to remove the two procedures successfully, the detail is that when I try to finish, it recharges the payment part and only the user registers me. Just remove a few lines from the ordercontroller
enter image description here
So, do you want to remove the Address, Shipping Method and Payment step from checkout?
Unfortunately, deleting a few lines from the OrderController is not enough.
The shipping/invoice address is required to place an order, there is no really a way to delete it.
You can delete/disable the Payment step if your product is free, and also you can disable the Shipping method step if your product is a "Virtual Product".
Maybe a workaround for the Address step, if create and address which you assign to each client right after the registration (but this is not the right solution because of the GDPR ).

PrestaShop iframe payment module

I'm developing a payment gateway module for prestashop 1.6.x - 1.7.x versions and this module is iFrame. I mean, when a customer chooses this payment method then he's redirected to an iframe page in prestashop (not redirected to another web page). But I must create an order before payment on this page. If I create the order after payment is done in order-confirmation page (to this page is automatically redirected to in 5 sec by iframe after the payment is done), it's maybe not the correct way for this method. Maybe the customer has left the iframe page in these 5 secs. So, the order is not created.
When I use the validateOrder function for creating an order, it is sending an email to the customer before payment is done. So, I did some changes in this function and it's working fine. But, if this page is refreshed then the order is created over and over again. Also, the validateOrder function is deleting the cart. I duplicate the cart because of this.
I hope everything is ok here. Here are my problems;
I don't want to show duplicated orders to the customer. Maybe these orders can be updated like id_customer = 0. But in this case, the customers can not be seen in the BO order table and I don't know if is it legal.
validateOrder function is not compatible with all of these versions. How can I use this for all versions without sending an email? Actually I want to use core function but I guess there is no way.
What is the best practice in this scenario? What is the way I have to follow?

Prestashop one step checkout programatically change carrier

I'm dealing with an issue, I've been working in a module that does pretty much the same as a cart rule if you have certan type of products and a certain amount in your cart, the module sets a free shipping carrier for you, this can be achieved with discount codes I know that, but the requierement was specific, Do that ... without using discount codes, So, the site has enabled the one step checkout, the module does it well in the 5 step checkout, but the hook DisplayBeforePayment does not work, I know that maybe it isn't working because of ajax call, To keep it simple, What can I do to get my module working with the One step checkout? (order-opc Controller). Thanks in advance!
I think you need to use a different hook. Please have a look at this page.
If you search for "DisplayBeforePayment", you see it's only used in /controllers/front/OrderController.php. The 5 step checkout uses this controller.
The one step checkout uses a different controller: /controllers/front/OrderOpcController.php.
The hook DisplayBeforePayment is not present in that controller, so that's why i think your module doesn't work on the one page checkout.

Easiest way to sell stuff and track inventory

on my website I sell unique items. I have programmed it so that on the selling page, users can select any amount of these items, and it calculates the cost. The key is that I only have 1 of each of these items. So I need the shopping cart system to not allow the payment to go through unless it is available.
I've been searching for a good quick/easy/cheap solution and can't find one. I don't expect this site to make a lot of money (the transactions are a few bucks), so I didn't want to need a ssl certificate.
The only way I know of not needing an ssl certificate would be to use paypal or google checkout. However, I do not think there is a way of using these services and making paypal's server run a script to check how many are available on the site. Any solution?
Thanks
I was thinking about it more, and I think the problem is that once the user gets to the paypal payment screen, I have no control. I guess I could do something like they click the buy it now link, a php script updates it to sold, then they go to the paypal screen, but then they might not continue the purchase...
If you use PayPal Website Payments Standard (using a cart rather than 'Buy Now' Buttons) then you could use IPN or PDT (see the paypal docs here) to get PayPal to call back to you with the status of the payment.
The work flow would then be to set status to reserved when the item is added to the cart, and then wait for the IPN/PDT call to come back with the payment status, and mark the item as sold.
You would still need to check and reset to available any item that had been reserved for longer than say 2 Hours. (You could do this before serving a page to a user so that they have the latest availability and you don't need a cron job or long running process)
If you could provide a little more information about how you have implemented ur shopping card, it would have been more easier for other to assist! If you are using any ecommerce solution then it should be there already in the track inventory section. But Provided that you have implemented d shopping cart manually, why don't you add little bit of codes that checks the inventory status first before letting your customers check out?