Jump to content

Abort Composition


Recommended Posts

I know this should go under the MarcomCentral area, but I put in a request to join a couple weeks ago and haven't been granted access yet - my apologies for posting here.

 

In a MarcomCentral site I have price tags setup as a variable item. The buyer enters their pricing information as well as the product SKU number. The SKU number is checked against an external data file. If it exists, then FusionPro pulls in PDF art for that specific tag. If it doesn't exist, it pulls in an error page with the word 'ERROR' written in big red text. The problem is that buyers are still placing orders for tags that do not exist.

 

I did a little research and found the FusionPro.Composition.Abort() function and added it to my programming. It works wonderful and prevents buyers from ordering tags that don't exist. My only issue is that I would like to customize the error message and so far I haven't been able to. Below is the code I'm using. Is it formatted correctly? Is there away to return a custom error message?

 

FusionPro.Composition.Abort(["Please check and make sure the Item Number was entered correctly." , false]);

Link to comment
Share on other sites

I know this should go under the MarcomCentral area, but I put in a request to join a couple weeks ago and haven't been granted access yet - my apologies for posting here.

I just added you to the MarcomCentral group.

If it doesn't exist, it pulls in an error page with the word 'ERROR' written in big red text.

Okay, great. I assume you're doing this in OnRecordStart. This is already part way to what you ultimately want to accomplish, in that you already have a mechanism to show the user of MarcomCentral an error message, on the output Preview.

My only issue is that I would like to customize the error message and so far I haven't been able to. Below is the code I'm using. Is it formatted correctly?

Yes, and in fact, I think you have been customizing the error message. But it seems that you're confused about exactly where the error message appears.

The message actually gets written to the composition log (.msg) file. Unfortunately, the MarcomCentral application doesn't make it easy to find the .msg file. The way to find it is to open the Preview PDF in a new browser window, copy the URL, change the .pdf extension at the end of the URL to .msg, then copy that new URL into a new browser window's address bar.

Is there away to return a custom error message?

So when you say "return" here, I think what you're really asking is, "Is there a way to display the custom error message to the end user of the MarcomCentral application?" The answer to that is Yes, and you have already figured out part of it, in that you're showing the user the word "ERROR" in big red text. So what you want to do instead is change that word "ERROR" to a variable (with a name like "ErrorMessage"), then, in the code that's activating that page, you also want to set the value of that variable to your custom error message, something like this:

FusionPro.Composition.AddVariable("ErrorMessage", "Please check and make sure the Item Number was entered correctly.");

Note that you don't need to actually call FusionPro.Composition.Abort at all; in fact, that might make the composition error out completely, and not show your big red error at all. (Of course, there's nothing to stop the user from ordering the output with the big red error on it, but if they do that, they kind of get what they deserve.)

Link to comment
Share on other sites

Yes, they are placing orders with "Error" on the page. Repeatedly. Unfortunately, when this happens I'm tasked with contacting the buyer and explaining that the tags don't exist and we are cancelling their order.

 

The good thing about FusionPro.Composition.Abort is that it prevents the buyer from buying the non-existing tags. I think I will stick with it and just include extensive instructions above the form about what to do if they get the error message.

 

Thanks for the feedback!

Link to comment
Share on other sites

Yes, they are placing orders with "Error" on the page. Repeatedly. Unfortunately, when this happens I'm tasked with contacting the buyer and explaining that the tags don't exist and we are cancelling their order.

 

The good thing about FusionPro.Composition.Abort is that it prevents the buyer from buying the non-existing tags. I think I will stick with it and just include extensive instructions above the form about what to do if they get the error message.

Okay, that sounds sensible. Though I still think that if you make the preview show "Invalid SKU number entered" in big red text, that that should be enough communication to the end user as to what they did wrong; but I've also learned that people have an amazing capacity to not read error messages.

Thanks for the feedback!

No problem.

 

A couple other thoughts here, though I'm not really an expert on the MarcomCentral application:

 

First, there could, and probably should, be a better mechanism for FusionPro templates to return custom error messages like this to end users of MarcomCentral. I would put in a request to your CPM or Support person for this, though I can't make any promises at all as to when such new functionality would be available. But asking for it is the first step!

 

Also, I would think that, instead of having a free-form edit field for the user to type in the SKU number in MarcomCentral, and the possibility of entering a bad SKU that that entails, that you could instead provide a drop-down list of possible SKUs, which I think is possible to program into your store with the current MarcomCentral application. There may be a way to do some kind of custom validation on the form itself, before the FusionPro composition is even invoked; that's also something to ask your CPM about.

 

Blue-skying a bit more, I can imagine a custom site that would allow the user to select the item they want, based on a keyword search or something, which would show the picture of the item as well, kind of like how you would order something from Amazon or any other e-commerce site. That's obviously a lot more work for to program your store that way, and possibly requires enhancements to MarcomCentral itself. (Again, I'm not an expert on that.) But something to think about, anyway.

Edited by Dan Korn
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.
Note: Your post will require moderator approval before it will be visible.

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.

×
×
  • Create New...