Problems, need help? Have a tip or advice? Post it here.
5 posts Page 1 of 1
Hi,
I'm trying to implement some payment options for buyers. (see photo attach)
The idea is that depending on each option selected the "Checkout" button will redirect the user to a different page which will contain the payments details.
I can't define correctly the conditions.

i created a group with the payment options:
<cms:editable name='payment_method' label='Metode de plata' type='group' />
<cms:editable
name='explain_options'
type='message'
group='payment_method'
label='Metode de plata'
/>
<cms:editable
name='pp_options'
label=':'
height='100'
type='textarea'
group='payment_method'
/>


i imagine it has tot do with this part here:
<cms:if k_success >
....................................
</cms:if>

... but i can't make it work.
Can you offer me some guidance?

Thank you!

Attachments

Usually it works like this:
if method = '1' then redirect to page_1
else_if method = '2' then redirect to page_2
else redirect to page_3.

If you search forum for "cms:redirect" you'll find a lot of samples.
https://www.google.com/search?q=%22cms% ... om%2Fforum
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Thank you for your feedback!
I can tell it's not something complicated but i still fail on making it work.

<cms:form method="post" anchor='0' id="">

<cms:if k_success >
<cms:if method = 'Cash on delivery' >
<cms:embed 'sales_email.html' />
<cms:else />
<cms:redirect url="<cms:link 'checkoutpaypal.php' />" />
</cms:if>
</cms:if>


<cms:fieldset >
..................
<cms:input name='method' label='Metoda de plata' opt_values='Cash on delivery | PayPal' type='radio' />
</cms:fieldset>

</cms:form>

i allways get the else page.
what am i doing wrong?
Hi,

Please use 'frm_method' instead of 'method', e.g. as follows -
<cms:if frm_method = 'Cash on delivery' >

As explained in the docs, in the success condition all inputs are prefixed with a 'frm_' to make available their values.

A tip for you - whenever you find yourself not sure of which variable to use, place a <cms:dump /> or <cms:dump_all /> at that place to see for yourself all the available variables. For example, try the following and you can see that the variable is actually frm_method -
Code: Select all
<cms:if k_success >
   <cms:dump />
</cms:if>

Hope it helps.
Yup, that was it ... :)
Thank you very much for helping me out!
5 posts Page 1 of 1