Jump to content

Plugin Frontend URL


NiteFox

Recommended Posts

Afternoon, 

While diving into the world of plugins, i was just wondering if there is a hook/function or method for plugins to use "pretty" urls on the customer facing side when loading a plugin created page

So instead of "?_a=plugin&plugin=plugin_name" it'd be "plugin/plugin_name" or just "plugin_name" getting added to the store URL

Cheers,

Chris.

 

Link to comment
Share on other sites

Interesting. The 'friendly' URL would have to pass through the web server's rewrite feature to get:
index.php?seo_path=plugin_name

Then, there must be that 'path' in the CubeCart_seo_urls database table. The query must return a 'type' of thing to go looking for. And if there is more than one of that type, the query must return an integer that identifies which one of that type to find.

CubeCart already knows how to process _a=plugin. So, one issue is getting the plugin to insert a record in CubeCart_seo_urls.

As with a product, the friendly path is associated with an item_id value.

The question remaining is, how to differentiate which plugin.

Link to comment
Share on other sites

If the plugin has an ID number. For example, this:
https://www.cubecart.com/extensions/plugins/absolute-matrix-option-prices-price-list-hide-out-of-stock-matrix-options

has a Ref:173/271, which means: Merchant #173, Product #271.

The plugin, when it uses the "class.cubecart.display_content" hook, first checks if it is the matching "item_id" from the database query.

So, I think it's entirely do-able, but the plugin needs to be coded to check for its name or item_id before running.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...