Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.

  • 21/11/2023 BLACK FRIDAY 23 is coming

    BIG SALE, 35% discount for all our extensions. Use BF23 coupon code. Hurry up the discount is valid till 27 November.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

Filtering the current product in virtuemart
(1 viewing) (1) Guest
Go to bottomPage: 12
TOPIC: Filtering the current product in virtuemart
#55308
Filtering the current product in virtuemart 8 Years, 8 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
The administrator has disabled public write access.
 
#55309
Re:Filtering the current product in virtuemart 8 Years, 8 Months ago Karma: 746
Hello,

Do you want to show orders of currently logged user or for specific product?

Regards,
ARI Soft
The administrator has disabled public write access.
 
#55310
Re:Filtering the current product in virtuemart 8 Years, 8 Months ago Karma: 0
I want show all orders for specific product. So everyone can see prices over time, because prices may change.
The administrator has disabled public write access.
 
#55311
Re:Filtering the current product in virtuemart 8 Years, 8 Months ago Karma: 746
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
The administrator has disabled public write access.
 
#55321
Re:Filtering the current product in virtuemart 8 Years, 8 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)
The administrator has disabled public write access.
 
#55322
Re:Filtering the current product in virtuemart 8 Years, 8 Months ago Karma: 746
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
The administrator has disabled public write access.
 
Go to topPage: 12