Jump to content

Custom message on complete.tpl


cyben76

Recommended Posts

1 hour ago, cyben76 said:

I was wondering how i could display a custom message for first time orders when it is paid. 

Is there an if statement i could use within the {if $ispaid} ... {/if} in complete.tpl?

my inclination would be to use a ShoppintCartCheckoutCompletePage action hook - especially if what you want to do depends on determining whether this is a user's first order (which I imagine would require getting their client ID and seeing if there is more than 1 order assigned to them in the database)...

Link to comment
Share on other sites

On 12/3/2018 at 11:31 PM, brian! said:

my inclination would be to use a ShoppintCartCheckoutCompletePage action hook - especially if what you want to do depends on determining whether this is a user's first order (which I imagine would require getting their client ID and seeing if there is more than 1 order assigned to them in the database)...

Hi brian! 

I noticed under ShoppingCartValidateCheckout there is a variable custtype with Possible values are new or existing, could that be of use for me.. 

Link to comment
Share on other sites

17 hours ago, cyben76 said:

I noticed under ShoppingCartValidateCheckout there is a variable custtype with Possible values are new or existing, could that be of use for me.. 

"new" and "existing" in this context basically relates to whether they are already logged in - if they are logged in, they are an "existing" customer; if not, they're classed as "new".

i'm not sure that it would be of use for two reasons - firstly, because it returns an error message if the cart is invalid... it's not going to return an error message if the cart is valid and in any event, you want to show a custom message on the complete page, which is after the validatecheckout hook would run.

the second reason goes back to this new/existing issue... let's say that you have "Allow Client Registration" feature enabled in general settings -> other... that would allow users to register without ordering... so I could have registered a week ago, never made an order and then login today and make an order... i'd be classed as an "existing" customer, but i've never made an order previously, so if you were basing the custom message trigger purely on my loggedin status, I wouldn't see your custom message even though I should.

Link to comment
Share on other sites

On 12/8/2018 at 12:23 AM, brian! said:

"new" and "existing" in this context basically relates to whether they are already logged in - if they are logged in, they are an "existing" customer; if not, they're classed as "new".

i'm not sure that it would be of use for two reasons - firstly, because it returns an error message if the cart is invalid... it's not going to return an error message if the cart is valid and in any event, you want to show a custom message on the complete page, which is after the validatecheckout hook would run.

the second reason goes back to this new/existing issue... let's say that you have "Allow Client Registration" feature enabled in general settings -> other... that would allow users to register without ordering... so I could have registered a week ago, never made an order and then login today and make an order... i'd be classed as an "existing" customer, but i've never made an order previously, so if you were basing the custom message trigger purely on my loggedin status, I wouldn't see your custom message even though I should.

Ok noted, guess I'll have to do like what you said earlier. Get the client ID and check if there is any orders, if no orders add a line in complete.tpl with custom message

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated