Creating An If Statement Using The Document Editor

Hi everyone!!!

I am trying to edit our packing slip so that if a customer specifies a different shipping address email to the email they use to place the order, it is displayed instead of the main email address on our packing slips.

So effectively I would like a statement to say - IF s_shipping_email field is used during checkout then display that field on the packing slip. If that field is left blank then use email instead.

Would someone be able to help with this at all?

Thank you ever so much in advance :grin:

Looks like it is required to extend document editor at first to use your custom profile field in the list of available variables

Looks like it is required to extend document editor at first to use your custom profile field in the list of available variables


I don't think it's necessary.

A profile field’s identifier (Field name) will appear among available variables only if the profile field appears on the checkout page. To show a profile field on the checkout page or make it required there, go to Design → Layouts and switch to the Checkout tab. You’ll be able to add them in the settings of blocks, such as Address and Customer information.

I don't think it's necessary.

A profile field’s identifier (Field name) will appear among available variables only if the profile field appears on the checkout page. To show a profile field on the checkout page or make it required there, go to Design → Layouts and switch to the Checkout tab. You’ll be able to add them in the settings of blocks, such as Address and Customer information.

Do you mean that custom fields will be automatically available in the document editor?

Do you mean that custom fields will be automatically available in the document editor?


Yes, as long as you add this field to a block at the checkout page. i've attached a screenshot from http://demo.cs-cart.com.

demo-fields.png

Yes, as long as you add this field to a block at the checkout page. i've attached a screenshot from http://demo.cs-cart.com.

Thank you. I did not know that