Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Trouble Customizing.. help. 
 
OWND
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2009-05-08
Boston, MA
 

We’ve had some customizing done to our site.. but we can’t figure this one little piece out.
When you’re on product page 2 and you click a product it flips the product page back to page 1.
see it in action here..

http://www.getownd.com/index.php/tshirts/

go to page two and then click on a product.

any idea how we can get it to stay on the same page?

if this takes a few hours to do i’m willing to compensate… contact me.
thanks.

 
Magento Community Magento Community
Magento Community
Magento Community
 
ckosny
Guru
 
Total Posts:  349
Joined:  2009-02-28
Luxembourg
 

Well the links of the tshirts do not contain the current page number, so how is poor magento to know that it should display page two of the product listing?
Of course one could fetch all products and then check on which page the current product is, but this can be quite resource intensive and can be done much easier by simply adding the page number as a get parameter to each product link in the listing. So a link to e.g. the razor black tshirt would look like this:
http://www.getownd.com/index.php/tshirts/razor-black.html?p=2

I can’t tell you how that works exactly because this depends on your theme, but AFAIK this should really easy to do.

Good luck

Claudia

 
Magento Community Magento Community
Magento Community
Magento Community
 
OWND
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2009-05-08
Boston, MA
 

Oh, I’m definitely not blaming it on Magento..
But where in would I go to add that parameter?

 
Magento Community Magento Community
Magento Community
Magento Community
 
OWND
Jr. Member
 
Avatar
Total Posts:  4
Joined:  2009-05-08
Boston, MA
 

when i add ?p=2 to the url of all the products on page 2 now it won’t let me navigate back to page 1
:(
anyone?

 
Magento Community Magento Community
Magento Community
Magento Community
 
ckosny
Guru
 
Total Posts:  349
Joined:  2009-02-28
Luxembourg
 

Hi there

Instead of always adding page 2 to the detail url of a product you have add the page number that is in the get parameters (meaning in the url) of the overview page. And if there is no page number in the url, then the page is 1 or you leave the entire ?p=....

Unfortunately I don’t know enough about Magento templating yet that I could give you any precise hints on how exactly to achieve that.

In general PHP I would do something like this to get the page number and then I would add this page number to the links that point to the detail pages of the listed products.

$currPageNum = !empty($_GET['p']) ? $_GET['p'1;

Good luck

Claudia

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top