Jump to content

Archived

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

bsaul

WooCommerce product navigation (Next product, Last product option)

Recommended Posts

bsaul    1
bsaul

Hello

 

Has anyone managed to get product navigation going on their shop? I want a simple "Next Product" "Last Product" option.

 

Thank you

 

Babs

Share this post


Link to post
Share on other sites
ellenmva    112
ellenmva

Hi Babs,

 

I was going to suggest using the PostNav Section but that doesn't work with custom post types, just for blog posts. So, I looked and if you are using a child theme or the Pagelines Customize Plugin you can add this code to get pagination -- it will show the product name with an arrow next to it.

add_action( 'woocommerce_after_single_product', 'woocommerce_productnav');
function woocommerce_productnav() {
?>
<div class="post-nav fix">
	<span class="previous"><?php previous_post_link('%link') ?></span>
	<span class="next"><?php next_post_link('%link') ?></span>
</div>
<?php
}

If you want the pagination to show above the product, change woocommerce_after_single_product to woocommerce_before_single_product

 

Hope that helps.

 

Ellen


Ellen Moore

Pagelines Developer

www.elsue.com www.betterdms.com

Share this post


Link to post
Share on other sites
Jenny    33
Jenny

If you still need assistance, please let us know. Otherwise this topic will be closed in 7 days. Thanks! :)


Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites
thebastion    20
thebastion

ellenmva"] @[member="Jenny I tried the code by inserting it into "content-single-product.php" in my child theme but all I get is errors, also the code does not look like it is even formatted correctly? I also tried adding it into my functions.php but thats even worse.

 

Could you expand please and maybe suggest where this should go.

 

Much appreciated.

Share this post


Link to post
Share on other sites
ellenmva    112
ellenmva

thebastion The code goes in your child theme functions.php file. Make sure you copied all the code. Then, if you are getting an error, take a screenshot and post it. 


Ellen Moore

Pagelines Developer

www.elsue.com www.betterdms.com

Share this post


Link to post
Share on other sites

  • Similar Content

    • caspersjan
      By caspersjan
      Hello, 
      I am running into problems with the Woocommerce for Pagelines plugin, version 1.3.1. As soon as I activate it, the Shop page is rendered completely blank, even the Editor disappears. I have no other plugins active except Pagelines Updater and DMS Professional Tools. Could I be doing something wrong or is there an incompatibility? I suspect the former because I'm sure Woocommerce for Pagelines must be compatible with Woocommerce... It looks so promising and I'd love to use it! I must say that I am new to Woocommerce in general, but I tried every setting I could think of and work out and simply cannot get it to work with Woocommerce for Pagelines. My site in question is www.knetgut.de.
      I hope you can shed light on this and I appreciate your assistance! Yours faithfully, Jan Caspers.
    • adminuni
      By adminuni
      Hello!
       
      I am having trouble adding variables to a product. Couple of my products contain many variables and noticed that every time I update the product, variables all become default, or the stock quantity and price that I added become blank.
       
      I tried deleting some of these variables and readded them, which I thought was the only solution, but even when these variables work, when I check back later, other variables become blank. It has been very frustrating and time-consuming, is there any solution to this problem?
       
      (I tried deactivation plugins but that did not work, I tried duplicating the product and that did not work as well)
       
      http://main.4cats.com/
      for products: 'Party' and 'Glow in the dark splatter party'
       
      I will send the login info.
       
      Thank you so much in advance!
    • netage
      By netage
      Hi,
       
      How do I style the featured products?
       
      Regards,
      Cait
       
    • outtareach
      By outtareach
      I know this may be simple but seems nothing is working.  I changed columns from 4 to 6 in the shortcode and I still see 4 columns.  I also changed the image sizes to fit with the 6 columns and nothing changed.  cannot find the php code in functions that people are talking about changing.  Anyone know of any way to add more columns thus making the images smaller per line?
    • outtareach
      By outtareach
      My products are not displaying correctly and I cant see the content that is hindering them from working because its just blank data.  I can select it but no text/content displays.  any help would be great because I am finally starting to get this together.
       

×