WordPress.org

Ready to get started?Download WordPress

Forums

WP Catalogue
[resolved] Product urls (13 posts)

  1. christa575
    Member
    Posted 1 year ago #

    Hi,
    Thanks for a great plugin!
    Is it possible to change the permalinks so that the urls don't include /wpccategories/ or /wpccategories/?

    ie- Instead of my url being http://example.com/wpcategories/chairs, I would rather it say http://example.com/inventory/chairs.

    I have access to the code files, just not sure where to change this or if its possible.

    Thanks!
    Christa

    http://wordpress.org/extend/plugins/wp-catalogue/

  2. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Um... no it wouldn't be a super easy adjustment. The plugin uses custom post types so the premalink structure is governed a bit by that. However I have seen other plugins that do it (eg NextGEN) so there would definitely be a way to do it... probably something I'd have to look into in more detail, not something I can quickly do straight away.

    I will check into it for you and report back here...

  3. christa575
    Member
    Posted 1 year ago #

    Thanks so much! Definitely not a deal breaker, your urls are clean enough as is.

  4. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Nah it's a good idea. I'll integrate it and release an update with this and few other improvements (also the next/previous from your other thread) in a few days.

    Thanks for your input - always good to get feedback from real users.

  5. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Hello... just wanted to report back on this feature....

    I worked very hard to include this in v1.4 (just released) but I ran into the problem that although I could make taxonomy customisable, it required user to reset the site permalink structure, and also it had to be set BEFORE adding products and categories. Changing taxonomy later broke the categories (products still there but categories had to be recreated and then products had to be re-assigned to said categories)

    Very frustrating....

    I made the decision that it is better not to release this feature in current state with the problem above because I think it would cause more trouble than it is worth....

    Sorry I couldn't find a solution to this for you.

  6. van-knowmad
    Member
    Posted 1 year ago #

    If we are just starting out using this plugin, would it be possible to change the CTP name in the file products/wpc-product.php from its original value "wpcproducts" here:

    function wpt_wpcproduct_posttype() {
        register_post_type( 'wpcproducts',
                     array(...

    to just "products", like this:

    register_post_type( 'products',

    so that the URLs have ".../products/<name>" instead of "wpcproducts..." ?

    I know we would need to make this change after every upgrade, but is it just this easy if we are starting out?

  7. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    Yes that would work. Although actually I think it appears in a couple of other places too so check through all the files.... but yeah keep in mind you'll need to reset your permalinks, and you may run into problems on upgrade...

  8. van-knowmad
    Member
    Posted 1 year ago #

    @Maeve,

    Thanks for the sanity check.

    I may have found another workaround that you may be able to incorporate into your next version. I was reading up on custom post types for another little project and came across this:

    http://codex.wordpress.org/Post_Types#URLs_of_Namespaced_Custom_Post_Types_Identifiers

    It looks like you are already using the the suggested pretty-URL method, so wouldn't it just require changing:

    'rewrite' => array("slug" => "wpcproduct"), // Permalinks format

    to:

    'rewrite' => array("slug" => "products"), // Permalinks format

    and leaving all the internal IDs as "wpcproduct" for namespacing?

    However, I tried this on our development site, and the shortcode is generating links to individual products in that format, but when I click on them, I get a 404 page.

    I thought that maybe there was some hardcoding somewhere, but a cursory look didn't find it. Also, if I manually change the URL back to the old slug of "/wpcproduct/...", it gets re-written to "/products/..." and then still 404's out!

    Any idea where this obstacle may be in the code?

  9. ilovebunny
    Member
    Posted 1 year ago #

    Don't forget to reset your permalinks from the settings section. :)

  10. van-knowmad
    Member
    Posted 1 year ago #

    @ilovebunny,

    I reset the permalinks, and even deactivated/reactivated the plugin. Still not working.

  11. van-knowmad
    Member
    Posted 1 year ago #

    @Maeve,

    In trying to track this down, I found the following in the debug.log:

    [09-Apr-2013 16:22:50 UTC] PHP Notice:  Undefined index: post_type in /home/example/public_html/wp-content/plugins/wp-catalogue/index.php on line 106

    I switched the slug back to 'wpcproduct', but I was still gettting a 404 error on individual products, although I could see them in the admin list because they were being pulled by post number.

    I tried refreshing the permalinks, but no luck. I ended up deactivating and deleting the plugin, and then reinstalling it. After one more permalink rebuild, the products came back, but now I'm back to square 1.

  12. Maeve Lander
    Member
    Plugin Author

    Posted 1 year ago #

    @van-knowmad
    Would it be helpful if I sent you the development version of this plugin where I implemented functionality to customise the taxonomy structure? That way you can see how it works and identify the relevant places where wpcproduct appears? Feel free to email me privately at info@enigmaweb.com.au and I can send you a copy. It's not perfect - and it will have some bugs in it which existed in earlier releases when I was working on this... but ultimately it does achieve the functionality you're after....

  13. van-knowmad
    Member
    Posted 1 year ago #

    One more thing: I am installing the plugin on a Multi-Site install, but only activating it on the site I need it for.

    Just to make sure, it's not that, I installed it on my personal blog. Changed the slug, activated plugin, added dummy product, and got 404 error trying to view individual page.

    Deactivated but left installed, changed the slug back to 'wpcproduct', re-activated, and the individual page worked again.

    (Rebuilt permalinks at every step, just to be safe.)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.