woo.get
This short code used to call Woocommerce functions.
Requirements – Install Woo-commerce plugin From https://wordpress.org/ or Click here to Download. Once you install activate this plugin.
Here are some shortcodes with their examples:
- Call Woocommerce function
Syntax: [woo.get wc.{woocommerce function-name} /]
Here function-name will be your function name eg.
[woo.get wc.woocommerce_account_edit_account /] [woo.get wc.woocommerce_account_edit_address /]
You can get list of various function from here
- Related To Order
If you want to Get Order Status, use the function get_status
[woo.get order.get_status order_id='{order-id}’ set=”module.order_status” /]
[woo.get order.get_status order_id='{{aw2.get item.ID }}' set="module.order_status" /]
- Create order
In billing section there is information related to user.
line_items section contains the information related to products in cart.
fee_lines contains information related to Convenience fees.
coupon_lines contains information related to coupon available.
[woo.get order.create set='module.order' status="{module.status_product}" customer_id="{module.user_id}"]
{
"apply_tax": "[aw2.get module.apply_tax /]",
"billing": {
"first_name": "[aw2.get request.billing_first_name /]",
"last_name": "[aw2.get request.billing_last_name /]",
"address_1": "[aw2.get request.billing_address_1 /]",
"address_2": "[aw2.get request.billing_address_2 /]",
"city": "[aw2.get request.billing_city /]",
"state": "[aw2.get request.billing_state /]",
"postcode": "[aw2.get request.billing_postcode /]",
"country": "[aw2.get request.billing_country /]",
"company": "[aw2.get request.billing_company /]",
"email": "[aw2.get request.billing_email /]",
"phone": "[aw2.get request.billing_phone /]"
},
"line_items": [
{
"product_id": "[aw2.get request.pid /]",
"quantity": 1,
"subtotal":"[aw2.get module.subtotal.math /]",
"total":"[aw2.get module.discount.discounted_price /]",
"meta": {
"Booking Duration":"{{aw2.get module.dur}}",
"Booking Start Date":"{{aw2.get module.required_on}}",
"Booking Start Time":"{{aw2.get module.starting_from}}",
"Booking End Date":"{{aw2.get module.required_till}}",
"Booking End Time":"{{aw2.get module.ending_at}}",
"_sla_timeout":"{{aw2.get module.final_sla_timestamp}}",
"Identification Document":"{{aw2.get request.identi_doc}}"
}
}
],
"fee_lines": [
{
"name":"Convenience Fees",
"tax_class":"",
"tax_status":0,
"total":"[aw2.get module.fees.math /]",
"total_tax":0
}
],
"coupon_lines": [
{
"code":"[aw2.get request.discount_coupon /]",
"discount":"[aw2.get request.discount_amount]"
}
]
}
[/woo.get]
- Calculate discount on cart
For calculating discount on cart we can add function called get_discount as:
Need to pass 3 parameters as:
product_id – Id of Item the cart.
total_price – Total amount of the cart.
coupon – Name of coupon.
[woo.get cart.get_discount product_id="{{aw2.get request.pid}}"
total_price="{{aw2.get module.totalamounts.math}}" coupon="{{aw2.get request.discount_coupon}}"
set="module.discount" /]
- Delete the items from the cart
[woo.get cart.empty_cart /]
Other shortcodes
Conditionals (7)
Core (11)
- aw2.run
- aw2.return
- aw2.template
- aw2.module
- aw2.raw
- aw2.get
- aw2.set_array
- aw2.set
- aw2.echo
- aw2.shortcode
- aw2.part
CRM (1)
Database (1)
Design & JavaScript (3)
- aw2.enqueue
- aw2.client
- aw2.spa
E-commerce (1)
Excelsheet (1)
- excel.write_bulk
Form Handling (3)
- aw2.sideload
- aw2.save_form
- aw2.upload
Mailing & SMS (3)
- aw2.subscribe
- aw2.sms
- aw2.wp_mail
PDF (1)
Utility (6)
- aw2.register
- aw2.register_handler
- aw2.reset_password
- aw2.login_handler
- app.restore
- app.backup
Latest Blogs
And there’s one thing I keep noticing: Everyone's obsessed with growth hacks.