Skip to content

Instantly share code, notes, and snippets.

@stuli1989
Last active March 3, 2022 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuli1989/cd0bef9e32763b52f8dda5a546da2c0c to your computer and use it in GitHub Desktop.
Save stuli1989/cd0bef9e32763b52f8dda5a546da2c0c to your computer and use it in GitHub Desktop.
Field Name Variable Used What it gives us
event_type $abandoned Bento specific field, it lets it log that this is an abandoned cart.
id {{ item.entity_id }} Mageplaza retrieves the internal abandoned cart id.
createdAt {{ item.created_at }} When was this abandoned cart created.
total_value {{item.grand_total | times: ‘100’ }} The grand total for the abandoned cart. This represents the final amount that you would be charging the customer. The times 100 helps to create the in cents value that most systems expect when ingesting webhooks.
subtotal {{ item.subtotal | times: ‘100’ }} The value before discounts. The times 100 helps to create the in cents value that most systems expect when ingesting webhooks.
global_currency_code {{item.global_currency_code }} Currency Code.
store_currency_code {{item.store_currency_code }} Currency Code.
base_currency_code {{item.base_currency_code }} Currency Code.
cart_url {{ item.cart_url }} The link they would use to get to their check out. For us it returns a generic Cart URL as we maintain customer carts in case they are logged in and this is enough.
email {{ item.shippingAddress.email }} The email id of the customer that abandoned the cart.
Products Repeated in case of multiple products.
Name {{ product.name | escape }} The name of the product ordered. Escape allows you to make sure that any symbols don't break your code.
product_id {{ product.product_id }} The internal id of the product
product_url {{ product.product_url }} The direct URL of the product
product_image_url https://cdn.artlounge.in/media/catalog/product{{ product.image_url }} The image URL of the product. We added our CDN Url before this as the value returned is only the path not a complete url.
product_smallimage {{ product.image_url }} The path of the image without the complete URL.
qty {{ product.qty_ordered}} The final quantity of the specific product ordered.
sku {{ product.sku }} The sku of the product ordered.
total {{ product.price | times: ‘100’ }} The total price of a single unit of the product.
base_price {{ product.base_price | times: ‘100’ }} The base price of a single unit of the product. We have a tax inclusive price hence in some countries this might work to give you price with and without taxes.
row_total {{ product.row_total | times: ‘100’ }} The total quantity into base price of the product. Doesn't subtract any discounts.
discount_percent {{ product.discount_percent }} The percentage of discount applied to this row of products.
discount_amount {{ product.discount_amount | times: ‘100’ }} The overall amount of discount applied to this row of products.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment