X-Cart is one of the popular software for e-commerce website.X-Cart is a shopping cart software based on PHP Smarty templates and uses MySQL as a database.
In X-Cart, Every user can register and have the own account on the site.Also, Customers can earn bonus points when they purchase products from the store and customer can purchase items from the store by using earned bonus points.
Today I am going to explain how the user will get Rs x amount of bonus point when a customer registered in the store in X-Cart.
For doing this, I have done some customization in X-Cart registration functionality.Let’s have a look into it.
First of all, Open register.php
file into the include
folder of your X-Cart directory.Next find the following line of code into it
Read about : To display message and redirect on xCart
1 2 3 4 5 6 | $newuserid = func_array2insert( 'customers', $profile_values ); |
After the above line of code, place below code:
1 2 3 4 5 | if(!empty($newuserid)){ db_query("INSERT INTO bcse_points (type, login, orderid, points, notes, payment_rate) VALUES ('O', '$uname', '', '100', 'signup bonus', '1')"); } |
Must Read: Enable Console in X-cart
Here, We have applied insert query into the bonus points table with user id so it will fill some specified bonus points into the user account.Above modification in registration is very easy.
Thanks for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.
Comments (1)