Jump to content

Short Order Routes


Cody

Recommended Posts

Some users have requested shorter URIs for order landing pages. Here are a couple routes you can add to the bottom of your /config/routes.php file to take advantage of shorter URIs:

Router::route("^order/configure/(.+)", "/order/main/configure/$1");
Router::route("^order/id/(.+)", "/order/main/index/$1");

Using the above routes you can link users to:

  • /order/id/ORDER_FORM_LABEL/
  • /order/configure/ORDER_FORM_LABEL/?group_id=1&pricing_id=1

Replace the bold items with the correct values for your setup.

Link to comment
Share on other sites

I can remove the /configure/ and /id/ to just have /order/ORDER_Form_Label/ correct? That will not cause hangups will it?

 

If you did that you could only use the second route. You'd have to delete the first. Regardless, I would advise against it since it could cause conflicts with the default order plugin routes.

Link to comment
Share on other sites

  • 1 year later...

Guys if you add routes for the Support Manager how do you make Blesta use them instead of the default ones? Do you need to edit this:

array(
				'action' => "nav_primary_client",
				'uri' => "plugin/support_manager/client_main/",
				'name' => Language::_("SupportManagerPlugin.nav_primary_client.main", true),
				'options' => array(
					'sub' => array(
						array(
							'uri' => "plugin/support_manager/client_tickets/",
							'name' => Language::_("SupportManagerPlugin.nav_primary_client.tickets", true)
						),
						array(
							'uri' => "plugin/support_manager/knowledgebase/",
							'name' => Language::_("SupportManagerPlugin.nav_primary_client.knowledgebase", true)
						)
					)
				)
			),

Routes I managed to get working but Blesta doesn't link them on the menus etc...

Router::route("^support/tickets/(.+)", "/support_manager/client_tickets/$1");
Router::route("^support/tickets/add/(.+)", "/support_manager/client_tickets/add/$1");
Router::route("^support/knowledgebase/(.+)", "/support_manager/knowledgebase/$1");
Router::route("^support/tickets/reply/(.+)", "/support_manager/client_tickets/reply/$1");
Router::route("^support/tickets/departments/(.+)", "/support_manager/client_tickets/departments/$1");
Link to comment
Share on other sites

 

Guys if you add routes for the Support Manager how do you make Blesta use them instead of the default ones? Do you need to edit this:

array(
				'action' => "nav_primary_client",
				'uri' => "plugin/support_manager/client_main/",
				'name' => Language::_("SupportManagerPlugin.nav_primary_client.main", true),
				'options' => array(
					'sub' => array(
						array(
							'uri' => "plugin/support_manager/client_tickets/",
							'name' => Language::_("SupportManagerPlugin.nav_primary_client.tickets", true)
						),
						array(
							'uri' => "plugin/support_manager/knowledgebase/",
							'name' => Language::_("SupportManagerPlugin.nav_primary_client.knowledgebase", true)
						)
					)
				)
			),

Routes I managed to get working but Blesta doesn't link them on the menus etc...

Router::route("^support/tickets/(.+)", "/support_manager/client_tickets/$1");
Router::route("^support/tickets/add/(.+)", "/support_manager/client_tickets/add/$1");
Router::route("^support/knowledgebase/(.+)", "/support_manager/knowledgebase/$1");
Router::route("^support/tickets/reply/(.+)", "/support_manager/client_tickets/reply/$1");
Router::route("^support/tickets/departments/(.+)", "/support_manager/client_tickets/departments/$1");

 

Kinda unrelated to this thread, but the URI in links are set in the view (.pdt) files. Routes simply control what URIs can be used to access a particular application path. So you would need to update the views to contain the format of the route you define.

You might say, well that kind of suck, and yes, it does. The solution for that would be reverse routing, but the minPHP routing engine doesn't (currently) support it, so Blesta doesn't support it.

Link to comment
Share on other sites

Kinda unrelated to this thread, but the URI in links are set in the view (.pdt) files. Routes simply control what URIs can be used to access a particular application path. So you would need to update the views to contain the format of the route you define.

You might say, well that kind of suck, and yes, it does. The solution for that would be reverse routing, but the minPHP routing engine doesn't (currently) support it, so Blesta doesn't support it.

 

merci mate will try that. 

Link to comment
Share on other sites

  • 2 months later...

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.

Loading...
×
×
  • Create New...