-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option for business purchase is missing when using the checkout tag #335
Comments
I fixed this issue for myself, in the services/Checkout.php I changed the following code:
I used the $sessionParams['customer'] outside the automatic Tax block, and added the tax_id_collection parameter. Like this:
Maybe this helps you to implement it ;) |
Hi @tomfischerNL Similar to #334 this is also a great use case to use the beforeCreateSession event: use enupal\stripe\services\Checkout;
use enupal\stripe\events\CheckoutEvent;
use enupal\stripe\Stripe;
use craft\base\Plugin;
use Craft;
class YourPlugin extends Plugin
{
public function init()
{
....
....
Event::on(Checkout::class, Checkout::EVENT_BEFORE_CREATE_SESSION, function(CheckoutEvent $e) {
$isCart = $e->isCart;
$sessionParams = $e->sessionParams;
//overwrite $sessionParams
$sessionParams['tax_id_collection']['enabled'] = true;
if (isset($sessionParams['customer'])) {
$sessionParams['customer_update'] = [
'name' => 'auto',
'shipping' => 'auto'
];
}
$e->sessionParams = $sessionParams;
});
...
...
}
} Please let me know if you have any questions |
Thanks! Maybe you can think of a way to implement the |
Hi @andrelopez, Do you have some more info about this? How can I add the "Business purchase" / VAT number to the checkout tag? |
Any status update on this? |
Hi @tomfischerNL could you please confirm your Craft CMS version? |
Description
When creating a checkout link in Stripe, I have the option to check if a user can select if the purchase is a business purchase.
Then you get 2 more fields in stripe when you pay. Business name and VAT number.
But when creating a checkout link from Enupal, this option is not available.
Can you add this option as well?
The text was updated successfully, but these errors were encountered: