Guest shickson Posted July 27, 2009 Share Posted July 27, 2009 Hi can someone help me out please? I have the variable {TXT_PRODCODE} which is used in the product page to display the actual code of the product. (this is in viewprod.tpl) However i wish to show this in the category list (viewcat.tpl) but it seems that the variables for each document are defined seperately and are not avaiable across the whole platform. So my question is, how do i use the product code variable to display in my category view page? I'm sure this is easy but just confused why the variables are not avaiable site wide as this would make life so much easier thanks Quote Link to comment Share on other sites More sharing options...
Guest dtmswebmaster Posted August 2, 2009 Share Posted August 2, 2009 Hi can someone help me out please? I have the variable {TXT_PRODCODE} which is used in the product page to display the actual code of the product. (this is in viewprod.tpl) However i wish to show this in the category list (viewcat.tpl) but it seems that the variables for each document are defined seperately and are not avaiable across the whole platform. So my question is, how do i use the product code variable to display in my category view page? I'm sure this is easy but just confused why the variables are not avaiable site wide as this would make life so much easier thanks Ok.. I've figured it out... Open %store%/includes/content/viewCat.inc.php... on/at line 434, look for: $view_cat->assign("BTN_BUY", $lang['viewCat']['buy']); and add this after it: $view_cat->assign("TXT_PRODCODE", $productResults[$i]['productCode']); Repeat for the other else statements within that if statement. Your final code for this should look like this: if ($config['outofstockPurchase'] == true) { $view_cat->assign("BTN_BUY", $lang['viewCat']['buy']); $view_cat->assign("PRODUCT_ID", $productResults[$i]['productId']); $view_cat->assign("TXT_PRODCODE", $productResults[$i]['productCode']); $view_cat->parse("view_cat.productTable.products.buy_btn"); } else if ($productResults[$i]['useStockLevel'] == true && $productResults[$i]['stock_level']>0) { $view_cat->assign("BTN_BUY", $lang['viewCat']['buy']); $view_cat->assign("PRODUCT_ID", $productResults[$i]['productId']); $view_cat->assign("TXT_PRODCODE", $productResults[$i]['productCode']); $view_cat->parse("view_cat.productTable.products.buy_btn"); } else if ($productResults[$i]['useStockLevel'] == false) { $view_cat->assign("BTN_BUY", $lang['viewCat']['buy']); $view_cat->assign("PRODUCT_ID", $productResults[$i]['productId']); $view_cat->assign("TXT_PRODCODE", $productResults[$i]['productCode']); $view_cat->parse("view_cat.productTable.products.buy_btn"); } Save and close file. --------------------------------- Open %store%/skins/%YOURSTYLE%/styleTemplates/content/viewCat.tpl, on line 35, look for: <td class="tdListTitle"><a href="{SORT_NAME}" class="sortLink"><strong>{LANG_NAME}</strong></a> {SORT_ICON}</td> add after <td align="center" class="tdListTitle">Code</td> Then find <div class="txtOutOfStock">{TXT_OUTOFSTOCK}</div></td> and add after <td align="center" class="txtDefault">{TXT_PRODCODE}</td> Save and close file. ---------------------------------- This should provide the desired effect that you are looking for. Hope this helps you! :) Quote Link to comment Share on other sites More sharing options...
Guest gabitech Posted December 11, 2009 Share Posted December 11, 2009 Thanks, I was playing with the same variable and didn't know what I did wrong (I had 0 instead of "i"). This was helpful. Quote Link to comment Share on other sites More sharing options...
Guest gavjof Posted November 3, 2010 Share Posted November 3, 2010 Thanks for taking the time to post this. It works great Really this should have been possible in beginning as it means these changes could potentially be overwrote when patching Cubecart. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.