Home Forum
Welcome, Guest
Please Login or Register.  Lost Password?

shopping cart link doesn't pull up product info wi
(1 viewing) (1) Guest
Go to bottomPage: 1
TOPIC: shopping cart link doesn't pull up product info wi
#41
shopping cart link doesn't pull up product info wi 1 Year, 6 Months ago  
I've recently purchased and installed PAPs and everything went very smooth. It's a great module!



I'm having an issue when clicking on a product link within my shopping cart. When I add something to the cart it adds the product to the shopping cart box on the site. If I than click the link for that product in the box, or click into my shopping cart and than click the link into the product info of something in my cart, PAPs is no longer there. I've gone into my product info tpl and removed the old image code and replaced it with the PAPs module.



The link to the product with PAPs working properly looks like this...



mydomain.com/index.php?main_page=product...2&products_id=93



The link that appears in the shopping cart when a product is added looks like this...



mydomain.com/index.php?main_page=product...35aaaa333f18b5b2567e



Is this something that has been run into before? I'm hoping it's a quick fix.



Thanks,



Nate
ukelele
Moderator
Posts: 131
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#42
Re: shopping cart link doesn't pull up product info wi 1 Year, 6 Months ago  
Hi Nate



Thanks for the query.



The problem exists because Zen Cart is adding the session_id to the product_id in the URL. This is arguably a security risk, but I have seen it in other stores too.



Anyway, the way to get PAPs to understand that the product_id is actually only the bit before the colon is this:



Open this file:

includes/templates/[YOUR_TEMPLATE]/templates/tpl_modules_paps.php



You then need to find every instance of this:



$_GET['products_id'] (I think it occurs 9 times in the file)



and change it to this:



(int)$_GET['products_id']



That should do the trick. To prevent Zen Cart from outputting the session_id in the first place, and attacking this problem from the other direction, you would find where Zen Cart gets the $product['linkProductsName'] array element in tpl_shopping_cart_default.php and format it as required before adding it to the array.



Hope this helps.



Nick

PAPs
ukelele
Moderator
Posts: 131
graph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
Moderators: ukelele

Copyright © 2012 Product Attribute Pictures. All Rights Reserved.