shorty883 Posted December 30, 2012 Posted December 30, 2012 I am running a template on osc 2.3.1 and it shows the shopping cart the the number of items in your cart but i can not get the number to show the number of items in the cart can anyone please help me out with this problem www.techsonhandstore.net thanks for the help
Guest Posted December 30, 2012 Posted December 30, 2012 @@shorty883 Although templates are not supported here, if you display the contents of the /includes/header.php file, I am sure we can point you to the fix for the issue. Chris
shorty883 Posted December 30, 2012 Author Posted December 30, 2012 ok here is my header file osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2010 osCommerce Released under the GNU General Public License */ if ($messageStack->size('header') > 0) { echo '<div class="grid_24">' . $messageStack->output('header') . '</div>'; } ?> <script type="text/javascript" language="javascript"> function cleartext(arg) { arg.value=''; } function uncleartext(arg) { if (arg.value=='') arg.value='<?php echo TEXT_SEARCH ?>'; } </script> <tr> <td colspan="3" class="top_part"><table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td class="top_shopingcart"><img src="images/design/shopingcart.png" align="absmiddle"/><?php echo SHOPPING_CART_TITLE;?> : <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><?php echo MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY; ?></a></td> <td id="topmenupadding"><a href="#"><img src="images/design/en.png" align="absmiddle"/></a></td> <td class="topmenu"><a href="<?php echo tep_href_link(FILENAME_DEFAULT) ?>" id="topmenupadding"><?php echo HEADER_TITLE_HOME?></a>|<?PHP if (!tep_session_is_registered('customer_id')) { echo '<a href="'.tep_href_link(FILENAME_LOGIN).'">'.HEADER_TITLE_LOGIN.'</a>'; } else { echo '<a href="'.tep_href_link(FILENAME_LOGOFF).'">'.HEADER_TITLE_LOGOFF.'</a>'; } ?>|<?PHP if (!tep_session_is_registered('customer_id')) { echo '<a href="'.tep_href_link(FILENAME_CREATE_ACCOUNT).'">'.HEADER_TITLE_CREATE_ACCOUNT.'</a>'; } else { echo '<a href="'.tep_href_link(FILENAME_ACCOUNT).'">'.HEADER_TITLE_MY_ACCOUNT.'</a>'; } ?> |<a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING)?>"><?php echo HEADER_TITLE_CHECKOUT?></a></td> </tr> </table></td> </tr> <tr> <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td class="toplefthader"> </td> <td class="topcenterhader" id="logo"><a href="<?php echo tep_href_link(FILENAME_DEFAULT) ?>"><?php echo tep_image(DIR_WS_IMAGES . 'store_logo.png', STORE_NAME)?></a></td> <td class="topcenterhader"><form id="currencies" name="currencies" method="get" action="<?php echo tep_href_link(basename($PHP_SELF), '', $request_type, false); ?>"> <?php echo BOXES_CURRENCIES_TITLE;?>: <?php include(DIR_WS_INCLUDES . 'boxes/currencies.php'); ?> </form> <table width="100%" border="0" cellpadding="0" cellspacing="0" class="tablemargen"> <tr> <td class="topmenuleft"> </td> <td class="topmenucenter"><a href="<?php echo tep_href_link(FILENAME_PRODUCTS_NEW)?>"><?php echo HEADER_TITLE_NEW_PRODUCTS?></a><img src="images/design/topmenuleft.png" align="absmiddle"/> <a href="<?php echo tep_href_link(FILENAME_SPECIALS)?>"><?php echo MODULE_BOXES_SPECIALS_TITLE?></a><img src="images/design/topmenuleft.png" align="absmiddle"/> <a href="<?php echo tep_href_link(FILENAME_ABOUT_US)?>"><?php echo HEADER_TITLE_ABOUT_US?></a> <img src="images/design/topmenuleft.png" align="absmiddle"/><a href="<?php echo tep_href_link(FILENAME_CONTACT_US)?>"><?php echo MODULE_BOXES_INFORMATION_BOX_CONTACT; ?></a></td> <td class="topmenuright"> </td> </tr> </table></td> <td class="toprighthader"> </td> </tr> </table></td> </tr> <tr> <td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><?php if(cos_banner_exists('HOME_1')) cos_display_banner('HOME_1'); ?> </td> <td valign="top" class="searchbox"><div id="searchtitle">Quick Search</div> <div class="search"> <form id="quick_find" name="quick_find" method="get" action="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false); ?>"> <input name="keywords" type="text" class="searchbar" id="keywords" value="search..." onfocus="cleartext(this);" onblur="uncleartext(this);" /> <input type="image" name="imageField" id="imageField" src="images/design/searchbutton.png" class="searchbutton" /> </form> <a href="<?php echo tep_href_link(FILENAME_ADVANCED_SEARCH) ?>" class="advancesearch"><?php echo BOXES_SEARCH_BOX_ADVANCED_SEARCH; ?></a></div></td> </tr> </table></td> </tr> <?php if (isset($HTTP_GET_VARS['error_message']) && tep_not_null($HTTP_GET_VARS['error_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerError"> <td class="headerError"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['error_message']))); ?></td> </tr> </table> <?php } if (isset($HTTP_GET_VARS['info_message']) && tep_not_null($HTTP_GET_VARS['info_message'])) { ?> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr class="headerInfo"> <td class="headerInfo"><?php echo htmlspecialchars(stripslashes(urldecode($HTTP_GET_VARS['info_message']))); ?></td> </tr> </table> <?php } ?>
Guest Posted December 30, 2012 Posted December 30, 2012 @@shorty883 Ok, change this: <td class="top_shopingcart"><img src="images/design/shopingcart.png" align="absmiddle"/><?php echo SHOPPING_CART_TITLE;?> : <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><?php echo MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY; ?></a></td> to this: <td class="top_shopingcart"><img src="images/design/shopingcart.png" align="absmiddle"/><?php echo SHOPPING_CART_TITLE;?> : <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>"><?php echo $cart->count_contents() . ' ' .MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY; ?></a></td> Btw. that is a poorly coded header.php file. Chris
shorty883 Posted December 30, 2012 Author Posted December 30, 2012 thanks for the help chris i did that change and now it says Shopping Cart : 2 0 items is it a bad thing that it is coded bad and what do you mean bad
Guest Posted December 30, 2012 Posted December 30, 2012 @@shorty883 I would suspect that the 0 is included with the language definition. Check the /includes/languages/english/shopping_cart.php file for this: MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY If the 0 is included there, remove it. The template is poorly coded, contains redundant script and is just plain messy. Definitely not professionally done. Chris
shorty883 Posted December 30, 2012 Author Posted December 30, 2012 oh i bought the template from a company
shorty883 Posted December 30, 2012 Author Posted December 30, 2012 this is what that file shows define('NAVBAR_TITLE', 'Cart Contents'); define('HEADING_TITLE', 'What\'s In My Cart?'); define('TABLE_HEADING_REMOVE', 'Remove'); define('TABLE_HEADING_QUANTITY', 'Qty.'); define('TABLE_HEADING_MODEL', 'Model'); define('TABLE_HEADING_PRODUCTS', 'Product(s)'); define('TABLE_HEADING_TOTAL', 'Total'); define('TEXT_CART_EMPTY', 'Your Shopping Cart is empty!'); define('SUB_TITLE_SUB_TOTAL', 'Sub-Total:'); define('SUB_TITLE_TOTAL', 'Total:'); define('OUT_OF_STOCK_CANT_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' dont exist in desired quantity in our stock.<br />Please alter the quantity of products marked with (' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '), Thank you'); define('OUT_OF_STOCK_CAN_CHECKOUT', 'Products marked with ' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . ' dont exist in desired quantity in our stock.<br />You can buy them anyway and check the quantity we have in stock for immediate deliver in the checkout process.'); define('TEXT_ALTERNATIVE_CHECKOUT_METHODS', '- OR -'); ?> doesnt show what you told me to look for
shorty883 Posted December 30, 2012 Author Posted December 30, 2012 if possible could you help me with one more thing the recover cart addon is installed but will not work I have one file that is giving me a blank page after i modify the code
♥14steve14 Posted December 30, 2012 Posted December 30, 2012 Try looking in the includes/languages/english.php for the code. If not there you will have to search through the files to find that definition. It must be somewhere. REMEMBER BACKUP, BACKUP AND BACKUP
shorty883 Posted December 30, 2012 Author Posted December 30, 2012 i have looked all over i can't seem to find that code anywhere but the header
Guest Posted December 30, 2012 Posted December 30, 2012 @@shorty883 That's what I meant by a poorly coded template. You will have to search ALL of the files in the /includes/languages/english/ directory for that definition and then check to see if the 0 was added to the text. That's the only way I can think of that they could have fooled you into thinking it worked. The code I supplied DOES work, now you just need to clean up their mess. Perhaps you should contact the template seller for a corrected version of the cart ?????? Chris
shorty883 Posted December 30, 2012 Author Posted December 30, 2012 it could be in anyone of then files because i have checked most of them and nothing
shorty883 Posted December 30, 2012 Author Posted December 30, 2012 Chris can you clean up this template and make that work if so what will it cost me. I am just thinking if they messed up once they may give me somthing like it again this is where i bought it from http://www.complete-oscommerce.com
shorty883 Posted December 30, 2012 Author Posted December 30, 2012 does anyone know where this peice of code would be at <td class="top_shopingcart"> <img align="absmiddle" src="images/design/shopingcart.png"> Shopping Cart : <a href="http://techsonhandstore.net/shopping_cart.php">0 0 items</a> i found it using firebug
Guest Posted December 30, 2012 Posted December 30, 2012 @@shorty883 This: <img align="absmiddle" src="images/design/shopingcart.png"> is in the header.php Once you find the language definition, you will find the 0 that is hard coded in. Chris
multimixer Posted December 30, 2012 Posted December 30, 2012 @@shorty883 The code you posted is probably in file catalog/includes/header.php, but you don't need this What you need is, to find the constant "MODULE_BOXES_SHOPPING_CART_BOX_CART_EMPTY", because that is where the additional "0" comes from. This is what @@DunWeb already suggested to do. Where can this be? For sure not in a file that is called for a specific page only (eg includes/languages/shopping_cart.php), because the text appear on every page. Most possible is that the text is in includes/languages/english.php (as @@14steve14 suggested), so take a look again. Other option is, that it is in one of the boxes language files, they are in includes/languages/english/modules/boxes/ To be honest it could be anywhere, maybe you need to do a side-wide search for the term in question As a general note, looking at your site, best advise would be to delete it and start over. This is some kind of "hybrid" store, supposed to be version 2.3.1 (latest version is 2.3.3 but anyway), and still using the old-fashioned way to create e.g. the columns using a table structure, so I doubt that you can move the boxes in your admin to left or right column. Just an example, not to talk about the general mess. My community profile | Template system for osCommerce - New: Responsive | Feedback channel
Recommended Posts
Archived
This topic is now archived and is closed to further replies.