News:

Support the VirtueMart project and become a member

Main Menu

List all product bought by the customer

Started by kiwee, November 17, 2016, 10:19:59 AM

Previous topic - Next topic

kiwee

Hi,

Is there a way to display a list of all the products a customer bought ? Something like
Product I bought :
product XX : image / link to the order
product YY : image / link to the order
...

I know this is very specific, but if someone has even the beginning of an idea it would be great :D

Thanks

GJC Web Design

u need to write a module,

do a query in orders  using the logged in userid

display results
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

kiwee


Studio 42

Hi,
The module exist already in my shop :
http://shop.st42.fr/en/products/products-any-ways.htm
This permit to display product in cart,product ordered .... in many ways.

Regards,
Patrick

Note that i don't test release with obselete Virtuemart 2.x releases

Ghost

In order list view you can add something like this to get all your orders with details (including products bought).

$orderModel = VmModel::getModel('orders');
foreach($this->orderlist as $order)
{
$orders[] = $orderModel->getMyOrderDetails($order->virtuemart_order_id);
}


The rest depends on how you want them displayed.

Studio 42

Ghost,
it only work for 1 order, not for all products

Ghost

#6
Works with all user's orders. $this->orderlist already contains orders but only basic information. For each order use getMyOrderDetails to get detailed information.

Studio 42

Yes, but it's not the product list, but the order details products, so the customfield for eg. are this from user and you cannot add a add to cart, or you need to recall using the producti id.
And of course, adding code to get right display ...
My module is not to see the list of product as order details, but to display list of products brought but with the possibility to add to cart for eg.
Si this depend the real need, displaying the product in the orders(for eg. if you have donwload links) or permit user tu buy same product again.