WordPress.org

Ready to get started?Download WordPress

Forums

MarketPress - WordPress eCommerce
[resolved] how to fully customize url? as stated as feature inside desc page (7 posts)

  1. cyngate
    Member
    Posted 1 year ago #

    how to skip the /store/,
    because its a revamp from old website that already contain old url,
    which i dont want to force redirection to the new link.

    or its there a way to output it to single.php. which i only need the add to cart button and shopping-cart->checkout page

    http://wordpress.org/extend/plugins/wordpress-ecommerce/

  2. waila7
    Member
    Posted 1 year ago #

  3. cyngate
    Member
    Posted 1 year ago #

    thanks

  4. cyngate
    Member
    Posted 1 year ago #

    hi i manage to change the product category to
    http://localhost/products/category/office/seating
    but my product is showing
    http://localhost/products/product-name

    how can i make it to show
    http://localhost/products/parent-category/category/product-name
    that i assign the product to??

    for example
    office
    - seating
    - productA

    how can i make it to show
    http://localhost/products/office/seating/productA

    thank you for your help

  5. cyngate
    Member
    Posted 1 year ago #

    wordpress.stackexchange.com/questions/39500/how-to-create-a-permalink-structure-with-custom-taxonomies-and-custom-post-types

    tried this method,but still not working

  6. waila7
    Member
    Posted 1 year ago #

    In functions.php add:

    //rewrite slug
    add_filter('post_type_link', 'waila7_permalink', 10, 3);
    
    function waila7_permalink($permalink, $post_id, $leavename) {
        if (strpos($permalink, '%product_category%') === FALSE) return $permalink;
    
            // Get post
            $post = get_post($post_id);
            if (!$post) return $permalink;
    
            // Get taxonomy terms
            $terms = wp_get_object_terms($post->ID, 'product_category');
            if (!is_wp_error($terms) && !empty($terms) && is_object($terms[0])) $taxonomy_slug = $terms[0]->slug;
            else $taxonomy_slug = 'product-category-missing';
    
        return str_replace('%product_category%', $taxonomy_slug, $permalink);
    }

    In marketpress.php register_post_type('product'..) change rewrite slug :

    'rewrite' => array('slug' => '%product_category%', 'with_front' => true),
  7. cyngate
    Member
    Posted 1 year ago #

    thank you for your help
    solve my problem

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.