The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Back button from single product page (1 post)

  1. shainanz
    Posted 3 years ago #

    I'm trying to get a back button working from the single product page to its parent category. Right now I'm using JavaScript:
    <a href="javascript:history.go(-1)">&larr; Back</a>

    It works most of the time, but it leaves some room for error. For example, if someone gets the link directly to the product after a Google search, they'd be sent back to Google, not to the parent category. Is there a better way to do this using get_categories or similar? (I'm not very knowledgeable of PHP, so I may be totally off base here.)



Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic