To post a new support question, click the Post New Topic button below.
Current Version: 4.9.1 | Sytist Manual | Common Issues | Feature Requests
Please log in or Create an account to post or reply to topics.
You will still receive notifications of replies to topics you are part of even if you do not subscribe to new topic emails.
Database Object Keys For Ms_orders And Ms_cart_options
Arron Robles
188 posts
Thu Aug 24, 17 3:11 PM CST
Hi Tim. Can you tell me if there is a Primary or Foreign Key link to the ms_orders to ms_cart_options? I am trying to get the order detail when the customer check out. OR is there and easier query for these table joins. Also are there any indexes on these objects.
Example Query:
SELECT
ct.cart_id,
o.order_id AS order_id_0,
c.co_opt_id,
c.co_cart_id,
o.order_customer AS order_customer_0,
o.order_total AS order_total_0,
o.order_date AS order_date_0,
o.order_email,
o.order_first_name,
o.order_last_name,
o.order_city,
o.order_payment,
c.co_price,
c.co_select_name,
c.co_opt_name,
c.co_id
FROM
ms_orders AS o ,
ms_cart_options AS c,
ms_cart AS ct
WHERE o.order_date >= '2017-08-06'
We have about 550 yearbook orders through the site and i want to query the data to export to our yearbook vendor.
i set it up as a product and added the options to the product page.
https://my.apvisions.com/yearbooks/john-green-yearbooks/
Please let me know if you need to expand on my question. Any Insight would be great
Cheers,
Example Query:
SELECT
ct.cart_id,
o.order_id AS order_id_0,
c.co_opt_id,
c.co_cart_id,
o.order_customer AS order_customer_0,
o.order_total AS order_total_0,
o.order_date AS order_date_0,
o.order_email,
o.order_first_name,
o.order_last_name,
o.order_city,
o.order_payment,
c.co_price,
c.co_select_name,
c.co_opt_name,
c.co_id
FROM
ms_orders AS o ,
ms_cart_options AS c,
ms_cart AS ct
WHERE o.order_date >= '2017-08-06'
We have about 550 yearbook orders through the site and i want to query the data to export to our yearbook vendor.
i set it up as a product and added the options to the product page.
https://my.apvisions.com/yearbooks/john-green-yearbooks/
Please let me know if you need to expand on my question. Any Insight would be great
Cheers,
Arron Robles, Solutions Designer | APVisions.com | Robles365.com
Tim - PicturesPro.com
16,216 posts
(admin)
Fri Aug 25, 17 5:44 AM CST
The ms_cart joins ms_orders on ms_cart.cart_order
Then ms_cart_options on ms_cart_options.co_cart_id
You might want to look at the sy-admin -> export-order-items.php as a guide.
Then ms_cart_options on ms_cart_options.co_cart_id
You might want to look at the sy-admin -> export-order-items.php as a guide.
Tim Grissett, DIA - PicturesPro.com
My Email Address: info@picturespro.com
My Email Address: info@picturespro.com
Arron Robles
188 posts
Fri Aug 25, 17 8:45 AM CST
Thanks Tim, I will check out the export guidelines thank you.
Cheers,
Cheers,
Arron Robles, Solutions Designer | APVisions.com | Robles365.com
Arron Robles
188 posts
Fri Aug 25, 17 3:27 PM CST
A little different than SSMS and SQL Server but pretty close. Thanks again for your help! This is the resolution the business requirements about for those of you looking for this query.
SELECT
ms_orders.order_id,
ms_cart_options.co_cart_id,
ms_orders.order_date,
ms_orders.order_sub_total,
ms_orders.order_total,
ms_orders.order_email,
ms_orders.order_first_name,
ms_orders.order_last_name,
ms_cart_options.co_opt_name,
ms_cart_options.co_select_name,
ms_orders.order_city,
ms_orders.order_state,
ms_orders.order_zip,
ms_orders.order_address
FROM ms_orders
JOIN ms_cart ON ms_orders.order_id = ms_cart.cart_order
JOIN ms_cart_options ON ms_cart_options.co_cart_id = ms_cart.cart_id
WHERE ms_orders.order_date >= '2017-08-06'
Cheers,
SELECT
ms_orders.order_id,
ms_cart_options.co_cart_id,
ms_orders.order_date,
ms_orders.order_sub_total,
ms_orders.order_total,
ms_orders.order_email,
ms_orders.order_first_name,
ms_orders.order_last_name,
ms_cart_options.co_opt_name,
ms_cart_options.co_select_name,
ms_orders.order_city,
ms_orders.order_state,
ms_orders.order_zip,
ms_orders.order_address
FROM ms_orders
JOIN ms_cart ON ms_orders.order_id = ms_cart.cart_order
JOIN ms_cart_options ON ms_cart_options.co_cart_id = ms_cart.cart_id
WHERE ms_orders.order_date >= '2017-08-06'
Cheers,
Arron Robles, Solutions Designer | APVisions.com | Robles365.com
Please log in or Create an account to post or reply to topics.
Loading more pages