Wp E-commerce Categories

resolved (12 posts) (3 voices)

  1. yellow6
    Member

    Hi I'm having some trouble getting my product categories to work. I used the code below and added it to my core.php --> lib/functions/core.php this fixed my issue some what. My product categories are now displaying but I have lost my main navigation.

    function mysite_custom_search($query)
    {
    $query->set('post_type', 'any');
    }
    add_filter('pre_get_posts','mysite_custom_search');

    Posted 5 years ago #
  2. Hi!

    Actually this code is being added by default in our themes. Have you updated your inFocus to latest version?

    []'s

    Posted 5 years ago #
  3. yellow6
    Member

    Hi Rochester thanks for getting back to me.

    I just checked what version I have and am running the most recent version of inFocus 2.9. In my core.php at the bottom it using this code which doesn't fix my categories for my product pages.

    function mysite_custom_search( $query ) {
    if ( $query->is_search )
    $query->set( 'post_type', 'any' );

    return $query;

    If I use this it resolve the category issue but I loose my main navigation.

    function mysite_custom_search($query)
    {
    $query->set('post_type', 'any');
    }
    add_filter('pre_get_posts','mysite_custom_search');

    Thanks in advance,
    Rey

    Posted 5 years ago #
  4. Elliott
    Support

    All that code does is change the search queries to display all post types. It doesn't have anything to do with your products unless you want them to display in the search results.

    Send us a link to one of your products so we can get a better idea of what's going on.

    Posted 5 years ago #
  5. yellow6
    Member

    Here's a link --> http://reyochoa.info/bd2/products-page/lamo-sheepskin/.
    Anywhere there's a page using the product category shortcode the pagination breaks. I have also have tried using [raw] [/raw] which fixed my checkout page but not the category pages.

    The main product page and pagination works fine --> http://reyochoa.info/bd2/products-page/

    If I change the core.php and use the code below my category pagination works but then I loose my main navigation. Would you like me to change the code to reflect the category section that works without navigation or keep it the way it is without the category page working?

    function mysite_custom_search($query)
    {
    $query->set('post_type', 'any');
    }
    add_filter('pre_get_posts','mysite_custom_search');

    Posted 5 years ago #
  6. Elliott
    Support

    So you have your main product page setup here, http://reyochoa.info/bd2/products-page/.

    And then you have a child page setup and your using the product category shortcode on it here, http://reyochoa.info/bd2/products-page/lamo-sheepskin/, and the pagination isn't working correctly?

    Does work okay when using the default theme?

    Posted 5 years ago #
  7. yellow6
    Member

    Sorry about that I feel so stupid. I didn't realize this page had a parent page. Thanks for pointing that out, the store now functions the way it supposed too.

    Thanks for all the advice

    Posted 5 years ago #
  8. yellow6
    Member

    Okay thought the issue was corrected but it doesn't look like it is. My category pagination still doesn't work due to permalink issues. I have made sub-categories in Wp e-commerce store. Lamo --> Women. The url is http://reyochoa.info/bd2/store/women/ which should bring up the women category of my store but it doesn't.

    When i disable the theme and use the default Twenty Eleven theme the links work fine. Attached are 2 images one of what I get when using the inFocus theme and one of what I of what I get using the Twenty Eleven theme.

    Thanks again

    Attachments

    1. Screen-Shot-2012-05-01-at-10.40.jpg (34.8 KB, 1 downloads) 5 years old
    2. Screen_Shot_2012-05-01_at_10.36.07_PM..png (128 KB, 2 downloads) 5 years old
    3. Screen_Shot_2012-05-01_at_10.36.07_PM..png (128 KB, 2 downloads) 5 years old
    Posted 5 years ago #
  9. Elliott
    Support

    I just updated to the latest WP e-Commerce. Not sure what's going on there but you should be able to fix it by adding this in your functions.php file,

    function mysite_asdf_search($query)
    {
    	$query->set('post_type', 'any');
    }
    add_filter('pre_get_posts','mysite_asdf_search');

    Have you considered using Jigoshop? We have a child theme which is almost complete for it.

    Posted 5 years ago #
  10. yellow6
    Member

    Thanks, same thing as before now the the store displays correctly but I loose my main navigation. I think it has to do something with the javaScript. I tried changing jqueryslidemenu to position: absolute; but it didn't help. I did consider jigoshop but my client requested I use wp E-commerce.

    Here's link utilizing the modification you suggested --> http://reyochoa.info/bd2/store/women/

    Thanks for the help,
    I hope we can get resolved soon.

    Thanks again,
    Rey

    Posted 5 years ago #
  11. Elliott
    Support

    It's working fine on my XAMPP setup, not sure what's going on there. Try downloading a fresh copy of the theme and do the edits again. Also be sure to deactivate all plugins while testing, except wp e-commerce of course.

    Posted 5 years ago #
  12. yellow6
    Member

    Thanks for all the help, I was able to fix it in the core.php. If any ones running into the same problem here's how I fixed it. You need to modify core.php which is located in inFocus/lib/functions/core.php.

    Add this line of code to line below line 1110

    %archive%' => ( is_archive() ? esc_attr( get_search_query() ) : '' ),

    now scroll to very bottom and you see this function
    function mysite_custom_search($query)
    {
    if ($query->is_search) { $query->set('post_type', 'any'); } return $query;
    }
    add_filter('pre_get_posts','mysite_custom_search');

    function mysite_custom_adsf($query)

    Right below this add this

    function mysite_custom_adsf($query)
    {
    if ($query->is_archive) { $query->set('post_type', 'any'); } return $query;
    }
    add_filter('pre_get_posts','mysite_custom_adsf');

    Your code should now look like this

    function mysite_custom_search($query)
    {
    if ($query->is_search) { $query->set('post_type', 'any'); } return $query;
    }
    add_filter('pre_get_posts','mysite_custom_search');

    function mysite_custom_adsf($query)
    {
    if ($query->is_archive) { $query->set('post_type', 'any'); } return $query;
    }
    add_filter('pre_get_posts','mysite_custom_adsf');

    This should do the trick.

    Posted 5 years ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme