R
R
Roman Yakushev2014-04-22 10:36:04
PHP
Roman Yakushev, 2014-04-22 10:36:04

Where is the place in the code when VirtueMart sends a new order to the database?

I am writing my plugin for AlphaUserPoints. (AUP)
Essence: there is a partner. He has an account on the site, and he advertises his ReferreID to everyone, like a coupon in our store on VirtueMart (VM), i.e. when the customer orders in VM, he enters the coupon code in the cart.
I need to intercept the moment when the order is placed, and there will be a record of it in the database, and sending letters to the user.
at this moment, you need to get the coupon code that he entered, and get the total amount of his order (order amount = number of points that the user will receive).
Well, charge the amount to the user on the coupon.
Well, actually the question itself - where is this moment? In which file, which function? It is very necessary that there be access to both the coupon that the user entered and the amount of his order.
So far I've only found
\components\com_virtuemart\helpers\cart.php
line 841, the confirmDone() function
but there is no order amount in this "VirtueMartCart" class... apparently, this is not the place.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2014-04-22
@cyber-jet

We don’t think it’s logical to do as you said, you need to confirm the order and pay first. In your case, I would suggest writing a script that would run on a schedule and do the right things, but only after the order becomes confirmed or even shipped.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question