reward points as percent from total in opencart 2.1 - sql

I`m new in opencart system, but i allready have a trouble :) i have around 9 000 products in my store, and i want to make a loyal client program in which program every client will get 1 poitn for 10 (depends on the value, for example EURO). It will take a week or more to add the reward points to every single product data page, so im thinking about some kind of SQL query to data base, to add 10 percent to this column(column for the loyal clients reward points) from the column with the price of the product! I hope you understood me, thank you (sorry for my english!)
Regards! :)

Related

How to optimally get sorted records, when the sort column requires computation from a secondary service?

Imagine I'm a bank and I want a dashboard that shows our "top spenders" with data updating throughout the day.
Currently I query the database for all our customer IDs, and pass all those IDs to a service which calculates how much they've spent today. If I have 10,000 customers, it must make 10,000 calculations.
Then I pick the Top 10 and show them in the dashboard. 9,990 calculations were useless, but we can't know which ones until they're complete.
Is there some way to improve the performance? I can't pre-calculate because customers are making new purchases all the time, and the list should be dynamic.
What if the results are very consistent day-to-day? As in, the Top 10 spenders are almost always in yesterday's Top 20. We could store the prior day's top spenders, and only calculate those 20 to find the Top 10, but if someone jumps from #25 to #9, they would be missing from our Top 10 if we use that algorithm.
Any advice is appreciated!
Instead of asking another service for all customers, have this service subscribe to customer created/deleted events from that service, and have it store the customer info in its database. So, it will not need to inefficiently query all the customers every time to compute the top spenders.

Get the Record from Update Column in SQL Server

I want to ask about SQL Server. I have some column Point. With every purchase of something, this point value will increase.
For example: the first serial account 100 has purchased MILK, then Point goes from 50 to 75.
The problem is, can I get the record from update Point column if first 50 become to 75 with trigger then will write to new column, like PointLog?
Thanks in advance and sorry for my bad English..

Calculating Capacity in Rally

Can anyone explain to me how to calculate your capacity in Rally. I am new to Rally and I am trying to figure out how most of the functions work.
There is a capacity column next to each developer with a pencil where you can type in your capacity. I am assuming it's number of working days in the Sprint * hours of work you are currently assigned or some sort.
Any help is appreciated!
Thanks
Yes, that is correct.
The capacity you find on the Track->Team Status per person is the number of available hours in the selected iteration.
What you need to decide is, how many "productive" hours do each person have per work day.
You can find the help documentation here: https://help.rallydev.com/view-team-member-capacity

Product pricing based on price zones for a store-pickup grocery chain website

I am in the process of building a e-commerce website for a small local grocery chain to allow their customers to order online and pickup at store. I will be integrating with the in-store POS system to pull the category & product data and push back the order data.
As I am new to Prestashop I am wondering if the following setup is possible out-of-the-box:
The POS system uses price zones which can be shared by stores (e.g. price_zone_1 is used by the 3 stores in San Francisco for pricing, price_zone_2 is used by 2 stores in Los Angeles for pricing).
The POS system have a pricezone_productprice table
product_id pricezone_id price
1 1 14
1 2 12
Then there is store_stock table
product_id store_id stock
1 1 98
1 2 45
And the store table has a pricezone foreign key that ties everything together
store_id pricezone_id
1 2
2 1
I need to have a similar setup on the Prestashop side to exchange data and display correct pricing and stock information for different stores.
Is such a structure/feature available out-of-the-box? If not are you aware of any module that might help with this? And finally if nothing is available how feasible do you think this is to develop under prestashop?
I explored multistore feature but as far as I understand that would not do what I am looking for as it separates order history, etc. I want customers to be able to see their order history from different stores in one page.
This might deserve an entire Override for Product Class with a Module. But honestly, you should better do a multishop website based on the zone you want to deliver, then ask the client when he enters the website.
It will cost you 10 minutes and fine tuning instead of hours of dev and lot's of debug.
If you still want to use a Module, just overide Product class and following methods : getPriceStatic and getProductPrice
NB : Another idea would be to consider price by ... country and tell each as a separate one. But this can be dangerous :).

Data Model to represent Flat and Variable rate

I am designing a database for an app to sell parking spot use. Customer can order n number of uses of parking spot uses or pay a flat rate and use it for monthly/weekly or yearly. They can do mix of those also. Like they can buy 9 parking spot uses and later decide they will pay for the whole month - in which case their charges are kind of pro-rated.
For this, I have a Customer table, an Order Table and then an order type table. However, I am having a slightly hard time with the order-type table.
Can some one please shed light on how to model the rate and get available spot-uses for a customer?