| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
xcart5 module intergration | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
xcart5 module intergration
Hi,
I have created a module to recover the abandoned cart in xcart version 4.6.6 gold and xcart4.7.7 gold. Its working fine. Now i'm trying to do the same in xcart 5.3.3.4. I need to put the server side code at the payment page. Earlier in xcart 4 version i have added the code in the path ( >>payment >> payment_offline.php ) and its working. So please help me to find the path to add the code.
__________________
nivetha |
|||||||
#2
|
|||||||||
|
|||||||||
Re: xcart5 module intergration
Coding for X-Cart 5 is completely different than doing the same for X-Cart 4.
Here is the documentation for X-Cart 5 developers: https://devs.x-cart.com/ Also, there are two "abandoned cart reminder" ready-made modules for X-Cart 5. Are you sure that developing a new module from the scratch will cost you less than buying one of these?
__________________
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
|
|||||||
|
|||||||
xcart5 module intergration
in 5.3.3.4
1.I used this script in home page for displaying the siteid(k5BcYFhK) <script data-siteid="k5BcYFhK" src="https://api.domain.com/js/customer-tracking/dev104.trackingdomain.comxcart53x_9d1d6.js" type="text/javascript"> </script> 2.I used this script in cart page for displaying the add to cart products <script type="text/javascript"> //set cart total value _cartstack.push(['setCartTotal', '{{ this.getTotalValue() }}']); </script> <script type="text/javascript"> //loop through items in cart and include here {% for stackcart in this.getCartStack() %} _cartstack.push(['setCartItem', { 'quantity':'{{ stackcart.getAmount() }}', 'productID':'{{ stackcart.getItemId() }}', 'productName':'{{ stackcart.getName() }}', 'productDescription':'{{ stackcart.getDescription() }}', 'productURL':'{{ stackcart.getURL() }}', 'productImageURL':'{{ stackcart.getImageURL() }}', 'productPrice':'{{ stackcart.getPrice() }}' }]); {% endfor %} </script> 3.this is my question ? Here is my code which i had used in xcart 4.6 & 4.7 version payment section. Please help me , where i need to use the code in xcart 5.3.3.4 version // Setup the URL $emailAddress = $userinfo['email']; // required, get from session or db... $cartTotal = $cart['total_cost']; // optional, more accurate reporting... $url = "https://api.domaiin.com/ss/v1/?key=6cc64f627ae94113&siteid=k5BYYFZK&e mail=".$emailAddress."&total=". $cartTotal; // Initialize cURL... $ch = curl_init(); // Set URL and Return directives... curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Send the request... $jsonResponse = curl_exec($ch); // Close cURL... curl_close($ch); // Handle JSON response... $response = json_decode($jsonResponse, true); // Successful call is response code 100... if ($response['resp'] != "100" { /* Handle error responses, see "Response Codes" above... */ }
__________________
nivetha |
|||||||
#4
|
|||||||||
|
|||||||||
Re: xcart5 module intergration
@nivetha,
What kind of code do you want to put to the payment page? I mean, what is this code supposed to do? Once I grasp the idea, I would be able to suggest about where to put your code in X-Cart 5. Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#5
|
|||||||||
|
|||||||||
Re: xcart5 module intergration
Quote:
When do you want to run this code? Once I know that, I can suggest where to put this code in. Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#6
|
|||||||
|
|||||||
Re: xcart5 module intergration
hi,
In xcart4.7 i use this below code in path ( >>payment >> payment_offline.php ) $emailAddress = $userinfo['email']; // required, get from session or db... $cartTotal = $cart['total_cost']; // optional, more accurate reporting... $url = "https://domain.com/ss/v1/?key=6cc64f627ae9418b820a41891dce6b13&siteid=k 5BYYFZK&e mail=".$emailAddress."&total=". $cartTotal; // Initialize cURL... $ch = curl_init(); // Set URL and Return directives... curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Send the request... $jsonResponse = curl_exec($ch); // Close cURL... curl_close($ch); // Handle JSON response... $response = json_decode($jsonResponse, true); // Successful call is response code 100... if ($response['resp'] != "100" { /* Handle error responses, see "Response Codes" above... */ } it is working in 5.3 where i use this code please mention the file path and give a some guidins
__________________
nivetha |
|||||||
#7
|
|||||||
|
|||||||
Re: xcart5 module intergration
Hi,
Actually, when an order is placed successfully, we want to pass the order ID and order total to our own backend system (We have the API called using CURL method). So, in 4.7.x, we have used it in Payment page when an order is placed successfully and we placed the code and it worked. Pls advise us how to achieve this in Version 5.3.x
__________________
nivetha |
|||||||
#8
|
|||||||
|
|||||||
Re: xcart5 module intergration
Hi,
Please give the update .
__________________
nivetha |
|||||||
#9
|
|||||||||
|
|||||||||
Re: xcart5 module intergration
I believe it is \XLite\Model\Order::processSucceed() that you are looking for.
You should decorate this method from your custom module and put your custom logic after calling the parent's one.
__________________
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
|