• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

nucoplus_adam
#1 Posted : Monday, July 30, 2018 10:11:42 AM(UTC)
nucoplus_adam

Rank: Member

Joined: 7/24/2018(UTC)
Posts: 2

Thanks: 1 times
Here's the situation: I'm working on a BVCommerce cart that we're trying to upgrade from BVC 5.4 to BVC 2018 SP1. The original cart has some custom code that was added to the BVSoftware.BVC5.Core.Order.ReplacementTags function and used to generate a pair of order emails (one to the admin, one to the customer). The code contained custom replacement tags

I want to be able to use those custom replacement tags in BVC 2018, and I'm trying to avoid editing/customizing the Orders/Order.vb file if at all possible. I'd like to create classes within App_Code that extend the classes and that will allow me ReplacementTags/ConvertToEmailTemplate/Email Order Execute functions, etc. to be able to utilize the custom replacement tags. I'm trying to figure out whether I can do that, whether I can create a custom workflow item to utilize the custom emails, or whether I'll need to copy/paste the appropriate functionality into classes and send the emails outside of the workflow to accomplish what I want.

Is there a way to extend those classes and/or create a custom workflow item with code without editing the BVSoftware.BVC5.Core files, or do I have to create my own code outside of the Order workflow completely?
Aaron
#2 Posted : Tuesday, July 31, 2018 8:07:14 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Originally Posted by: nucoplus_adam Go to Quoted Post
I want to be able to use those custom replacement tags in BVC 2018, and I'm trying to avoid editing/customizing the Orders/Order.vb file if at all possible. I'd like to create classes within App_Code that extend the classes and that will allow me ReplacementTags/ConvertToEmailTemplate/Email Order Execute functions, etc. to be able to utilize the custom replacement tags.

Unfortunately there is no way to do this as there is no plugin architecture for replacement tags, though this is something that we've discussed internally. Further, classes in App_Code are only accessible from the website project, not any of the compiled assemblies, like the Core.

Originally Posted by: nucoplus_adam Go to Quoted Post
I'm trying to figure out whether I can...create a custom workflow item to utilize the custom emails...

Originally Posted by: nucoplus_adam Go to Quoted Post
Is there a way to...create a custom workflow item with code without editing the BVSoftware.BVC5.Core files...

You can absolutely create a custom workflow step to handle this, and that workflow step class can live in App_Code. The only real downside to this approach is that only the email that your workflow step uses can leverage your custom replacement tags (since the workflow step is where the replacement tags are processed). This might be fine for your situation, but just remember that any other order email that the system sends will have no knowledge of your custom replacement tags. Assuming that works for you I believe this is the best approach since it keeps your custom code isolated.

Some sample code you could review is in the /BVModules/Controls/ProductReviewDisplayInline.ascx.vb control. While this isn't a workflow step, the SendEmail function implements some custom replacement tags. You could do something similar in your workflow step.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
 1 user thanked Aaron for this useful post.
nucoplus_adam
#3 Posted : Tuesday, July 31, 2018 8:57:39 AM(UTC)
nucoplus_adam

Rank: Member

Joined: 7/24/2018(UTC)
Posts: 2

Thanks: 1 times
Thanks, Aaron. I appreciate the reply.

Originally Posted by: Aaron Go to Quoted Post
Unfortunately there is no way to do this as there is no plugin architecture for replacement tags, though this is something that we've discussed internally. Further, classes in App_Code are only accessible from the website project, not any of the compiled assemblies, like the Core.


As a customer, I'd like to see a continuation of these conversations, please. I've created and used custom tags for other non-order email templates using the BVC architecture and they've come in handy, so it would be nice to see it worked into the architecture in future releases.

Housing the code within App_Code is fine. I'm only customizing order emails within one project, so that works for me.

Originally Posted by: Aaron Go to Quoted Post

You can absolutely create a custom workflow step to handle this, and that workflow step class can live in App_Code. The only real downside to this approach is that only the email that your workflow step uses can leverage your custom replacement tags (since the workflow step is where the replacement tags are processed). This might be fine for your situation, but just remember that any other order email that the system sends will have no knowledge of your custom replacement tags. Assuming that works for you I believe this is the best approach since it keeps your custom code isolated.

Some sample code you could review is in the /BVModules/Controls/ProductReviewDisplayInline.ascx.vb control. While this isn't a workflow step, the SendEmail function implements some custom replacement tags. You could do something similar in your workflow step.


The /BVModules/Controls/ProductReviewDisplayInline.ascx.vb is exactly what I had in mind, and utilizing custom replacement tags within App_Code is fine (again, it's only for one project). The only part that I can't figure out is how to implement a custom workflow step. There doesn't appear to be any documentation for it, although I did find this forum post:

http://www.bvcommerce.co...oding-Customization.aspx

Do these steps still apply in 2018 SP1?

Aaron
#4 Posted : Tuesday, July 31, 2018 10:32:06 AM(UTC)
Aaron

Rank: Administration

Joined: 4/2/2004(UTC)
Posts: 2,381
United States
Location: Hummelstown, PA

Thanks: 6 times
Was thanked: 163 time(s) in 158 post(s)
Originally Posted by: nucoplus_adam Go to Quoted Post
The /BVModules/Controls/ProductReviewDisplayInline.ascx.vb is exactly what I had in mind, and utilizing custom replacement tags within App_Code is fine (again, it's only for one project). The only part that I can't figure out is how to implement a custom workflow step. There doesn't appear to be any documentation for it, although I did find this forum post:

http://www.bvcommerce.co...oding-Customization.aspx

Do these steps still apply in 2018 SP1?


Yes, this is still current.
Aaron Sherrick
BV Commerce
Toll-free 888-665-8637 - Int'l +1 717-220-0012
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012