Jump to content

Add sub-cat info to product in cart?


Guest

Recommended Posts

Is it possible to add the category/subcategory info in a line above the product name in the shopping cart? I sell t-shirts with different designs and I'm thinking about making master products (t-shirt, sweatshirt, etc) that I could list in each of my design subcategories. Without the category/subcat info, though, I have no way of identifying which design the customer wants. Is this possible?

Thanks.

Link to comment
Share on other sites

Is it possible to add the category/subcategory info in a line above the product name in the shopping cart? I sell t-shirts with different designs and I'm thinking about making master products (t-shirt, sweatshirt, etc) that I could list in each of my design subcategories. Without the category/subcat info, though, I have no way of identifying which design the customer wants. Is this possible?

Thanks.

Since no one has responded, does that mean it's not possible to show the category/subcategory names for each product in the shopping cart?

Thanks.

Link to comment
Share on other sites

If you use a unique product code for each design, problem solved.

Thanks for the reply, Mysty. I thought about doing that, but if I have a different product code for each of the categories I list a product in, then it is no longer a master product. Also, I would have to enter the product code individually, which is what I'm trying to avoid. I have thousands of designs, but they are printed on the same t-shirt, sweatshirt, long-sleeved t-shirt, etc. I can list one t-shirt in thousands of categories instead of having to list them individually if I could just find a way to show the category/subcategory info in the shopping cart. It would also make editing alot easier (editing one product vs. editing thousands of products) in case of changes in size or color availability.

I tried adding {TXT_LINK_HOME} (which I think is what shows the cat/sub info) to the cart.tpl but that didn't do anything. Is there any way to show this info in the cart?

Thanks.

Link to comment
Share on other sites

Yes, there is a way to do this. It requires editing one php file and one template file. Unfortunately, I do not have time to show the coding for you, as I did not have time last night either :D but this is in answer to your question, "can it be done?"

If no one else shows you how to do this I will hope to revisit this thread in the next week and give you the code.

Link to comment
Share on other sites

  • 5 weeks later...

Yes, there is a way to do this. It requires editing one php file and one template file. Unfortunately, I do not have time to show the coding for you, as I did not have time last night either :w00t: but this is in answer to your question, "can it be done?"

If no one else shows you how to do this I will hope to revisit this thread in the next week and give you the code.

Before I give up on this, I thought I'd give it one more shot at getting some help. If no one has time to give a detailed answer, can someone please at least tell me which files I need to edit so maybe I can try to figure it out myself?

Thanks.

Link to comment
Share on other sites

Well, I took a moment to look at this. It shouldn't be terribly difficult, but I don't know enough about writing SQL queries yet to make it work. Sorry I can't post the solution, but I can tell how far I had gotten and maybe you can work it out from there, or someone else may be able to help.

FIRST, in skins/your-skin/styleTemplates/content/cart.tpl ~

About line 128

Find:

:P SECOND, look in includes/content/cart.inc.php: About line 379 is this:

					<td class="{TD_CART_CLASS}">

					{VAL_PRODUCT_NAME}




Replace with:


					<td class="{TD_CART_CLASS}">

					{VAL_CAT_NAME}<br />

					{VAL_PRODUCT_NAME}




Now, you have added the {VAL_CAT_NAME} variable to the template, so you can show the cateory name abover the product name in the cart listing. The trick is to assign the actual category name to {VAL_CAT_NAME} in includes/content/cart.inc.php. This is not as simple as I had hoped, because the inventory table only stores the cat id number, not the cat name, so to get the cat name you will have to join these two tables and access the category name for each product in the loop. While my imagination says that this should not be tto difficult, I do not know enough about SQL queries to actually write it yet 
		if(($val = prodAltLang($product[0]['productId'])) == TRUE){

			

			$product[0]['name'] = $val['name'];

		

		}




And about line 407 is this:


		$view_cart->assign("VAL_PRODUCT_NAME",validHTML($product[0]["name"]));

		$view_cart->assign("VAL_PRODUCT_CODE",$product[0]["productCode"]);

The above show you how {VAL_PRODUCT_NAME} is assigned in this file. In my limited knowledge of the code, I could easily assign the cat id number to show in cart where you want the cat name to show by doing this:

if(($val = prodAltLang($product[0]['productId'])) == TRUE){

$product[0]['name'] = $val['name'];

//Adding Cat ID

$product[0]['cat_id'] = $val['cat_id'];

}

and this:

$view_cart->assign("VAL_PRODUCT_NAME",validHTML($product[0]["name"]));

$view_cart->assign("VAL_CAT_NAME",validHTML($product[0]["cat_id"]));

$view_cart->assign("VAL_PRODUCT_CODE",$product[0]["productCode"]);

which, together with the code given above for the template file, will show the category id above the name in cart list.

Sorry I can't give the complete answer, perhaps someone else will offer to teach us more about how to do this.

Link to comment
Share on other sites

  • 2 weeks later...

Well, I took a moment to look at this. It shouldn't be terribly difficult, but I don't know enough about writing SQL queries yet to make it work. Sorry I can't post the solution, but I can tell how far I had gotten and maybe you can work it out from there, or someone else may be able to help.

FIRST, in skins/your-skin/styleTemplates/content/cart.tpl ~

About line 128

Find:

:( SECOND, look in includes/content/cart.inc.php: About line 379 is this:

					<td class="{TD_CART_CLASS}">

					{VAL_PRODUCT_NAME}




Replace with:


					<td class="{TD_CART_CLASS}">

					{VAL_CAT_NAME}<br />

					{VAL_PRODUCT_NAME}




Now, you have added the {VAL_CAT_NAME} variable to the template, so you can show the cateory name abover the product name in the cart listing. The trick is to assign the actual category name to {VAL_CAT_NAME} in includes/content/cart.inc.php. This is not as simple as I had hoped, because the inventory table only stores the cat id number, not the cat name, so to get the cat name you will have to join these two tables and access the category name for each product in the loop. While my imagination says that this should not be tto difficult, I do not know enough about SQL queries to actually write it yet 
		if(($val = prodAltLang($product[0]['productId'])) == TRUE){

			

			$product[0]['name'] = $val['name'];

		

		}




And about line 407 is this:


		$view_cart->assign("VAL_PRODUCT_NAME",validHTML($product[0]["name"]));

		$view_cart->assign("VAL_PRODUCT_CODE",$product[0]["productCode"]);

The above show you how {VAL_PRODUCT_NAME} is assigned in this file. In my limited knowledge of the code, I could easily assign the cat id number to show in cart where you want the cat name to show by doing this:

if(($val = prodAltLang($product[0]['productId'])) == TRUE){

$product[0]['name'] = $val['name'];

//Adding Cat ID

$product[0]['cat_id'] = $val['cat_id'];

}

and this:

$view_cart->assign("VAL_PRODUCT_NAME",validHTML($product[0]["name"]));

$view_cart->assign("VAL_CAT_NAME",validHTML($product[0]["cat_id"]));

$view_cart->assign("VAL_PRODUCT_CODE",$product[0]["productCode"]);

which, together with the code given above for the template file, will show the category id above the name in cart list.

Sorry I can't give the complete answer, perhaps someone else will offer to teach us more about how to do this.

Thank you very much! I think I can make this work. I really appreciate your help.

Jan

Link to comment
Share on other sites

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.   Paste as plain text instead

  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...