Hi.
Couldn't really fit in a descriptive title, so here goes:
Basically, I would like to be able to run a specific bit of code upon order completion, depending on the product purchased, as the code is not applicable to all products..
Does something like that sound possible? Some sort of conditional statement according to whether a product is in a certain category?
Thanks in advance for any help.
You can be able to update the product module to have a flag (checkbox) to run your piece of code. More in the lines of our module Per-product-fee (http://www.kedgegroup.com/store/OpenCar ... Fee_Module). Should not be that difficuilt i suppose. I believe you may have more control on the product level compared to category.timkirtley wrote: Basically, I would like to be able to run a specific bit of code upon order completion, depending on the product purchased, as the code is not applicable to all products..
Does something like that sound possible? Some sort of conditional statement according to whether a product is in a certain category?
Hi,
Thanks for your reply.
How exactly would the approach you mention work? You would add a custom variable to the required products - how would the code that completes an order be able to pick up on that flag/variable?
Thanks for your reply.
How exactly would the approach you mention work? You would add a custom variable to the required products - how would the code that completes an order be able to pick up on that flag/variable?
Not sure I understand your question. "How would the code that completes and order" - Are you saying your code completes the order not the opencart?timkirtley wrote:How exactly would the approach you mention work? You would add a custom variable to the required products - how would the code that completes an order be able to pick up on that flag/variable?
I would say based on the flag you have to run the code some where during the checkout process, you can get the variables from the cart. Care to mention whats the code you want to run ?
Okay sorry, to clarify:
No there's no special code completing the order, I mean the Opencart code that completes the order - adds it the db, sends confirmation emails, displays success message.
Basically, some products when purchased need to be automatically registered for a Warranty, some but not all products.
The code to register for a warranty, simply adds the details to a newsletter mailing list, its about 15 lines of php.
I need to be able to run this code when a successful order goes through for an applicable product.
No there's no special code completing the order, I mean the Opencart code that completes the order - adds it the db, sends confirmation emails, displays success message.
Basically, some products when purchased need to be automatically registered for a Warranty, some but not all products.
The code to register for a warranty, simply adds the details to a newsletter mailing list, its about 15 lines of php.
I need to be able to run this code when a successful order goes through for an applicable product.
You should hunt down the code that triggers after the sucessful order and add the code there. You can check the products in the cart and based on condition that the flag we discussed exists manuplate the code to run or no-run
Hope that helps
Cheers.
Hope that helps
Cheers.
Who is online
Users browsing this forum: No registered users and 6 guests