zen Posted January 11, 2018 Posted January 11, 2018 Hello, I just migrate an old 1.5 Presta website into a TB 1.0.3, this is for B2B only. On previous version we used a module that makes a 1% discount coupon if customer choose to pay by CB (CMCIC French Bank), it workd good. On Presta 1.6 and TB, that is going to be more difficult, in fact the developper of the previous module did not work on it for 1.6.. so I bought a module on addons for that.. Module did not work, refund was accepted 20mn later... One more module bought that seems by looking at screenshots that it might do the job.. but unfortunatly it is also not working for CB payment, in the code it seems that dev include special method for alipay only.. and if module is not cheque or bankwire it will not work. I need help on this to find a module that can work with TB and CB payments modules (no Paypal), if you guys have any info on this or have been working on a dedicated module or modifications on the payment module itself.. please answer here then. Best regards, Nicolas
bzndk Posted January 11, 2018 Posted January 11, 2018 Just send you a chat message, i dont wanna post links to modules out side of TB on the forum :)
30knees Posted April 14, 2021 Posted April 14, 2021 I'm looking for the possibility to give a discount if a certain payment method is used. Did you find a solution?
datakick Posted April 14, 2021 Posted April 14, 2021 32 minutes ago, 30knees said: I'm looking for the possibility to give a discount if a certain payment method is used. Did you find a solution? That's hard to do, because in thirtybees payment option is not part of the cart price calculation. It can be done with some overrides, but you will definitely encounter some problems, especially if you use OPC checkout -- the right / final price will probably not be displayed there. 1
30knees Posted April 14, 2021 Posted April 14, 2021 I see. And would a hack be possible where you give a discount code that is tied to specific payment method? I see that cart rules can be tied to a carrier.
datakick Posted April 15, 2021 Posted April 15, 2021 6 hours ago, 30knees said: I see. And would a hack be possible where you give a discount code that is tied to specific payment method? I see that cart rules can be tied to a carrier. Thirtybees payment processing is very weird. Payment modules use displayPayment hook to inject html code to the checkout page. What is displayed varies significantly from module to module. It can be simple link to the external payment gateway. It can be iframe and bunch of javascript code to display payment popup. It can be form that post data to thirtybees controller, or it can be form that posts data to third party server.It can be whatever, really. Most importantly, there is no event that is emitted when some payment method was selected. What payment option was used is known only after the payment is processed and finalised. And it is too late to modify cart price at this point, since the payment is (can) be already processed. The root of the problem is that the payment modules have too much freedom (and responsibility) on checkout page. AEUC module changed this a little bit. It introduced new hook displayPaymentEU. Instead of returning html code, modules can use this hook to return structured information about their intent. Basically, they ask thirty bees to display payment option with some name, and also say what should happen when user select this option (usually it is redirect to some url, but it can be post form). This hook gives back thirtybees control over checkout flow. Checkout page now manages all payment options itself, and it knows upfront what payment option is selected, etc. But it has its drawbacks as well. The most important one is that payment modules are very restricted with UI they can create. It's no longer possible to display additional input fields on checkout page, simply because there is no way to describe this as a structured data returned by displayPaymentEU hook. For example, you can't have embedded card payment on the checkout page. Another big drawback of this is, well,... not all payment modules support this hook. With checkout pages that use displayPaymentEU hook to collect payment information, it would be possible to implement your requirement, because there exists a point in the flow when we know what payment option was selected, but payment was not performed yet. So if you use AEUC OPC, or modules like chex, it's possible to tweak it, and implement this discount code for payment. But on standard checkout page, it's just not possible to do. There is no single point in the flow that we could hook into and adjust cart price. 1
zen Posted April 15, 2021 Author Posted April 15, 2021 WE still use the same module since years, it works correctly and create a coupon for a specific payement : credit card , 1% reduction and add it to thé customer cart when payment is selected.
30knees Posted April 15, 2021 Posted April 15, 2021 6 hours ago, datakick said: With checkout pages that use displayPaymentEU hook to collect payment information, it would be possible to implement your requirement, because there exists a point in the flow when we know what payment option was selected, but payment was not performed yet. So if you use AEUC OPC, or modules like chex, it's possible to tweak it, and implement this discount code for payment. I use Chex. 🙂 Is anybody in the forum interested in this besides me? I could perhaps fund this if so. 5 hours ago, zen said: WE still use the same module since years, it works correctly and create a coupon for a specific payement : credit card , 1% reduction and add it to thé customer cart when payment is selected. Or this route...what module do you use?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now