select order_id
from ec_orders
where user_session_id=:user_session_id
and order_state='in_basket'
select count(*)
from ec_items
where order_id=:order_id
select user_id
from ec_orders
where order_id=:order_id
select shipping_address
from ec_orders
where order_id=:order_id
update ec_orders
set shipping_method=:shipping_method,
tax_exempt_p=:tax_exempt_p
where order_id=:order_id
select user_class_id
from ec_user_class_user_map
where user_id=:user_id $additional_user_class_restriction
select default_shipping_per_item, weight_shipping_cost
from ec_admin_settings
select add_exp_amount_per_item, add_exp_amount_by_weight
from ec_admin_settings
select usps_abbrev
from ec_addresses
where address_id=:address_id
select tax_rate, shipping_p
from ec_sales_tax_by_state
where usps_abbrev=:usps_abbrev
update ec_items
set price_charged=round(:price_charged,2), price_name=:price_name, shipping_charged=round(:shipping_charged,2), price_tax_charged=round(:tax_charged,2), shipping_tax_charged=round(:shipping_tax,2)
where item_id=:item_id
update ec_orders
set shipping_charged=round(:order_shipping_cost,2), shipping_tax_charged=round(:tax_on_order_shipping_cost,2)
where order_id=:order_id