| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
X-Cart offline payment method | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
X-Cart offline payment method
Hello all,
I'm trying to build an X-Cart 5 module that generates a reference and allows the users to pay offline, it's the most used method in Portugal. However I can't override X-Cart workflow and override the final page to show the details I want. I've googled a lot and went through the docs but I can't seem to find it. Does anyone know how to do this? I've already modified invoice through @ListChild but I need something more "programmatic". Thanks in advance.
__________________
X-Cart 5.2.13 |
|||||||
#2
|
|||||||||
|
|||||||||
Re: X-Cart offline payment method
Please provide more information on the desired changes and behavior.
What is a "reference"? Is it a plain text field? Where and when should it show up during checkout?
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#3
|
|||||||
|
|||||||
Re: X-Cart offline payment method
The payment system we're trying to implement takes 3 values (2 from the configuration form and the total price from the order) and returns 3 values also (1 from the configurations, a reference which is calculated using the value and the final value).
All fields can be strings. Here's an example of what the module should return: Entity: 99999 Reference: 999 000 229 Value: 923€ I want this to be displayed in the last step which is, I think, the invoice.
__________________
X-Cart 5.2.13 |
|||||||
#4
|
|||||||||
|
|||||||||
Re: X-Cart offline payment method
You should look into creating a custom payment method extended from \XLite\Model\Payment\Processor\Offline and use \XLite\Model\Payment\Processor\Check as an example (if you want some data to be entered by customers during checkout).
I believe you should add the extra order fields that will store the data, fill the fields from your offline payment method processor and display the fields in invoices with the help of @ListChild directive.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
#5
|
|||||||
|
|||||||
Re: X-Cart offline payment method
Thanks.
What is the best way to retrieve the settings from the module stored in the database?
__________________
X-Cart 5.2.13 |
|||||||
#6
|
|||||||||
|
|||||||||
Re: X-Cart offline payment method
Please check this article:
http://kb.x-cart.com/display/XDD/Step+4+-+working+with+settings
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#7
|
|||||||
|
|||||||
Re: X-Cart offline payment method
Is there any chance to get the value of the settings on the PHP side instead of the TPL file?
When I try \XLite\Core\Config::getInstance()-><ID>-><Module>-><variable> returns null
__________________
X-Cart 5.2.13 |
|||||||
#8
|
|||||||||
|
|||||||||
Re: X-Cart offline payment method
Er... You must get the value in PHP, it won't work in template files
If you need the value in a template, you should edit the widget class that is linked with the template and declare there a method retrieving the setting. And then use that method name in the template.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
#9
|
|||||||
|
|||||||
Re: X-Cart offline payment method
But in the link that you sent me you call the
PHP Code:
Edit: I managed to understand you meant. The problem here is: The example you showed me uses \XLite\Core\Config for settings, I'm using \XLite\Model\Payment\Method. How can I access my module settings like this?
__________________
X-Cart 5.2.13 |
|||||||
#10
|
|||||||||
|
|||||||||
Re: X-Cart offline payment method
You should use \XLite\Model\Payment\Method::getSetting($name) method.
If you have a transaction model in the $transaction variable, you can get the setting from this object as follows: $transaction->getPaymentMethod()->getSetting($name); So, basically you need the payment method model to get values of its settings.
__________________
Alex Solovev, Qualiteam --- User manual Video tutorials X-Cart FAQ You are welcome to press "Thanks" button if you find this post useful Click here to learn how to apply patches X-Cart Extensions |
|||||||||
|
|||
X-Cart forums © 2001-2020
|