recently purchased products - magento

How to display recently purchased products on dashboard after login in magento?

for backend you need to make a block that gets the order collection (by status) filtered with date range and iterate over them by getting their item collection and display those. Alternate way would query products and join order information and filter by date
for frontend it is much the same but a filter is needed to strict the orders by customer id

Related

Best approach to get products in order from database ??? based on product properties

I have to show products on my ecommerce website when user search query to My Elasticsearch
And having following features
Order by user previous preference
order by hot products

Is there a way to order my products page by in stock first and out of stock at the end of the page?

I am new to laravel and I am trying to build an ecommerce website, and I was wondering if there is a way to sort my products page by in stock first then out of stock rather than hiding them. In other orders can I get Products from DB based on $quantity?
Simply get all of your orders in descending order as per quantity of items in stocks.
DB::table('Products ')->orderByDesc('quantity ')->get();

Get order_id before submiting order in Magento

I have added a custom field in checkout page at shipping method step in magento. I am able to insert data from this field to my custom table mg_cake_message(msg_id,customer_id,cake_msg). I need another attribute (order_id) to show data for respective orders in admin panel. How can i get order_id before submitting an order?
I have searched in google and some of people suggest to use quote_id instead of order_id. Is quote_id is same as order_id ?
If it's not possible to get order_id before submiting order then how can the two previous step(Billing Information, Shipping Information) is managed?
Please make me a response .....
A quote in Magento is basically an order that hasn't been placed yet. It contains product items (shopping cart), addresses and payment/shipping methods. It is created as soon as you add an item to cart and Magento creates a sales/quote object.. During checkout, billing and shipping data is added to the quote. Finally, when the user clicks place order, the quote object is converted to an order sales/order object.

Magento Product Reviews only by customer who purchased the product

I searched everywhere, but could not find the solution for this. I want to not allow others except the buyers of that product to add review for that particular product, in Magento. Please can anybody help with this.
Initally make the option "Allow Guests to Write Reivews" to "No". Now, you can make this by taking the order collection of a particular product by getProductOrderCollectionById(). From that order collection we can get the list of the customers who purchased it.
In the other hand, you can get the ID of the logged-In customer. If the Order collection list contains the logged In customer ID, then you can allow them to display the review form.

Is there a way to see which items are not categorized in magento?

Is there a way to see which items are not categorized in magneto on the backend? I know I can pull a report but I was wondering if there was anything easier?
You can use the free Enhanced Admin Grids extension, as the github version allows to add a categories column on the products grid, for which it is optionally possible to filter on products that are not assigned to any category.
Not natively in the Magento backend.
You could run a simple SQL query against your database to grab a list of skus that aren't assigned to a category.
Something like this:
SELECT sku FROM catalog_product_entity
WHERE entity_id
NOT IN (SELECT product_id FROM catalog_category_product)
Which will return a list of all skus not assigned to a category. From there you can save the results to a CSV using your SQL program.

Resources