Forums / General Questions / Problem loading custom product_info templates from shopping cart default page

Problem loading custom product_info templates from shopping cart default page

Views: 1,334

Results 1 to 9 of 9
7 Jan 2014, 8:47 PM
#1
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Problem loading custom product_info templates from shopping cart default page

Hi,
i've created a custom product_info template for each product category in my clients ZC store.

they load them no problem if the modules/pages/product_info/main_template_var.php file loads.

but the problem is, from the shopping cart page, if clicking on a product link this file doesn't get called. the difference in the product display URLs are shown below.

index.php?main_page=product_info&cPath=3_6&products_id=15
index.php?main_page=product_info&products_id=15

can anyone describe how i might be able get the cPATH info into the product links for the shopping cart page? or how to get that into the $products array var?

8 Jan 2014, 5:17 PM
#2
picaflor_azul avatar

picaflor_azul

Totally Zenned

Join Date:
Jul 2009
Location:
picaflor-azul.com
Posts:
6,940
Plugin Contributions:
28

Re: Problem loading custom product_info templates from shopping cart default page

tcarden:

Hi,
i've created a custom product_info template for each product category in my clients ZC store.

they load them no problem if the modules/pages/product_info/main_template_var.php file loads.

but the problem is, from the shopping cart page, if clicking on a product link this file doesn't get called. the difference in the product display URLs are shown below.

index.php?main_page=product_info&cPath=3_6&products_id=15
index.php?main_page=product_info&products_id=15

can anyone describe how i might be able get the cPATH info into the product links for the shopping cart page? or how to get that into the $products array var?

Why don't you just use different product types? or just use one tpl_product_info_display.php file and customize using per category css?

Thanks,

Anne

8 Jan 2014, 6:48 PM
#3
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Re: Problem loading custom product_info templates from shopping cart default page

thanks, i have never really looked at product types, i will try that.

8 Jan 2014, 7:48 PM
#4
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Problem loading custom product_info templates from shopping cart default page

How different are the different category product displays? is it mostly a matter of style/layout, or are there significant structural or programmatic differences? The answer to this will indicate your probable best course of action. A CSS solution is likely to be far easier than others.

8 Jan 2014, 7:51 PM
#5
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Problem loading custom product_info templates from shopping cart default page

If programmatic differences are required, it may be easier to add tests for categories and choices based on that to the one tpl_product_info_display.php, similar to what happens in product_listing.php with the Column Grid mod.

8 Jan 2014, 8:00 PM
#6
tcarden avatar

tcarden

Zen Follower

Join Date:
Oct 2012
Posts:
282
Plugin Contributions:
0

Re: Problem loading custom product_info templates from shopping cart default page

thanks for the response gjh42, i don't know what you mean by add tests,

i doubt CSS only will work, there's been some extreme customizing but for good reasons.

one product line is Belts (over 1000!) so the image fills the space horiz completely,

maybe i'll just remove the link from shopping cart..?

8 Jan 2014, 8:59 PM
#7
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: Problem loading custom product_info templates from shopping cart default page

tcarden:

Hi,
i've created a custom product_info template for each product category in my clients ZC store.

they load them no problem if the modules/pages/product_info/main_template_var.php file loads.

but the problem is, from the shopping cart page, if clicking on a product link this file doesn't get called. the difference in the product display URLs are shown below.

index.php?main_page=product_info&cPath=3_6&products_id=15
index.php?main_page=product_info&products_id=15

can anyone describe how i might be able get the cPATH info into the product links for the shopping cart page? or how to get that into the $products array var?

There is a block of code that assembles the cpath. Either your link is not providing the value or the function is not being called when the link is clicked. PM or post a link so I can see the code in action please?

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

8 Jan 2014, 10:39 PM
#8
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Problem loading custom product_info templates from shopping cart default page

tcarden - I was responding to Anne's response and forgetting your original request. There is a function to fetch a product's master category id given the product id, and another to get the full cPath from a category id. You could chain those to recreate the correct cPath for each product in the cart, and insert it into the link.
I don't get a cPath in the link when I try a product in my shopping cart.

8 Jan 2014, 10:44 PM
#9
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Problem loading custom product_info templates from shopping cart default page

I think the reason the cPath is not in the link is because there is not a record of which category the product was added to cart from; in the case of a linked product, that would be unknown, so the link here defaults to the basic product page without reference to a category.

If a product is in one category only, as yours likely are, there is no downside to including the cPath.