Filtering the current product in virtuemart 9 Years, 4 Months ago
|
Karma: 0
|
I have a table with sales information of all ordered products, but i want to place it in the Virtuemart product details showing only its own data. (Data will change if i sellect next product)How do i place a filter to show it?
SELECT
OI.created_on,
OI.order_item_sku,
P.product_gtin,
OI.order_item_name,
OI.product_quantity,
OI.product_item_price
FROM
jos_virtuemart_order_items OI LEFT JOIN jos_virtuemart_products P
ON OI.virtuemart_product_id = P.virtuemart_product_id
Thanks
|
|
|
|
|
Re:Filtering the current product in virtuemart 9 Years, 4 Months ago
|
Karma: 760
|
Hello,
Do you want to show orders of currently logged user or for specific product?
Regards,
ARI Soft
|
|
|
|
|
Re:Filtering the current product in virtuemart 9 Years, 4 Months ago
|
Karma: 0
|
I want show all orders for specific product. So everyone can see prices over time, because prices may change.
|
|
|
|
|
Re:Filtering the current product in virtuemart 9 Years, 4 Months ago
|
Karma: 760
|
For example if you want to show orders for product with ID equals to 15, use the following query:
Code: |
SELECT
OI.created_on,
OI.order_item_sku,
P.product_gtin,
OI.order_item_name,
OI.product_quantity,
OI.product_item_price
FROM
jos_virtuemart_order_items OI LEFT JOIN jos_virtuemart_products P
ON OI.virtuemart_product_id = P.virtuemart_product_id
WHERE
P.virtuemart_product_id = 15
|
Regards,
ARI Soft
|
|
|
|
|
Re:Filtering the current product in virtuemart 9 Years, 4 Months ago
|
Karma: 0
|
Thats what i want but not only with one product, with all. If someone click "next", product_id will change.
I dont know if there is a variable in virtuemart to place instead of the "15" that represent the actual product in the frontend.
WHERE
P.virtuemart_product_id = (For example $product)
|
|
|
|
|
Re:Filtering the current product in virtuemart 9 Years, 4 Months ago
|
Karma: 760
|
If a request variable with product id is available on a page, it is possible to use it in the query. For example if name of request variable is ProductId, query will look like:
Code: |
SELECT
OI.created_on,
OI.order_item_sku,
P.product_gtin,
OI.order_item_name,
OI.product_quantity,
OI.product_item_price
FROM
jos_virtuemart_order_items OI LEFT JOIN jos_virtuemart_products P
ON OI.virtuemart_product_id = P.virtuemart_product_id
WHERE
P.virtuemart_product_id = {$REQUEST:ProductId}
|
Regards,
ARI Soft
|
|
|
|
|
|