Jump to content

Location Question


laide234

Recommended Posts

I'm a newbie, so this could be really simple...

I have an onClick event attached to my "Add To Cart" button that adds a product to a shopping cart.

onClick="window.location.href='<?php echo $cart_url; ?>';"

where [b]$cart_url[/b] is [b]cart.php?action=add&p=72[/b]

I would also like, when the item has been added to the cart, to go to the parent category page of that item.
i.e. when you add a basketball to the cart (from index.php?c=300&p=72) it goes to to the list of sporting goods page (index.php?c=300)

onClick="window.location.href='<?php echo $_SERVER['PHP_SELF'] . "?c=" . $catId; ?>';"


...How can I have that one button accopmlish both these tasks?? Please help.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.