vit320 Posted October 20, 2013 Share Posted October 20, 2013 just modifyed this script to fit into my table..but when i click add product, tha table that is around basket script become a recursive table like attached image. I see the part of script... {foreach from=$CONTENTS item=item} <li> <span class="price">{$item.total}</span> <a href="{$item.link}" title="{$item.name}">{$item.quantity} × {$item.name_abbrev}</a> </li> {/foreach} but i ask this content is inside a <td> why it do this effect? look photo and try on www.pcutile.it to add some product to see recursive table...:-( i want obtain only a table that contain box.basket.php N.B: after adding several product and see recursive table..(it's a sample name ok?) if press F5 it update correctly why? Quote Link to comment Share on other sites More sharing options...
Dirty Butter Posted October 20, 2013 Share Posted October 20, 2013 I looked at the Source Code when I had several boxes, but I don't know if this means anything or not. The first <td> row in this section was in red in FireFox. <tr> <td rowspan="1" colspan="2" width="14" height="96" style="background-image:url(http://www.pcutile.it/images/08SHOP_02_5x4_2x1.jpg)"</td> <td rowspan="1" colspan="1" width="152" height="96" style="background-color:#00b9e8;"> <div id="basket_summary"> <h3>Il tuo carrello.</h3> <p style="text-align: center;">Il Carrello è vuoto.</p> </div> </td> <td rowspan="1" colspan="1" width="15" height="96" style="background-image:url(http://www.pcutile.it/images/08SHOP_02_5x4_2x3.jpg)"></td> </tr> PS: To set code sections off so they are easier to read - use the <> on the Editor ribbon at the top of each post. To set off quotes, there is a comment bubble. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 20, 2013 Share Posted October 20, 2013 Item: Mailing List table, row 2, column 2, unclosed <td> tag. Item: Shopping Basket table, row 2, column 1, unclosed <td> tag. The reason for this effect is because CubeCart returns the entirety of the box.basket.php template -- but, the javascript ajax call will place that content in the <div id="basket_summary"> -- which is only part of the box.basket.php template. In the file, box.basket.php, find: <table width="181" cellspacing="0" cellpadding="0" border="0"> Make it: <table id="basket_summary" width="181" cellspacing="0" cellpadding="0" border="0"> Find: <div id="basket_summary"> Make it: <div> Edit: That may not work. Let me check the javascript. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 20, 2013 Share Posted October 20, 2013 In addition to the above: In the file /js/common.js, find: if ($('div#basket_summary').exists()) { That line, and another nine lines down: var basket = $('div#basket_summary'); Remove just div. Quote Link to comment Share on other sites More sharing options...
vit320 Posted October 20, 2013 Author Share Posted October 20, 2013 seems that the modify on js/common.js it's not necessary. It already work without this modification. it's really necessary or can avoid it? thanks for help. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 20, 2013 Share Posted October 20, 2013 For me, with the javascript at 'div#basket_summary', the ajax returned content -- a complete table -- was put inside the <div id="basket_summary">, which is nested inside the table. So, I got what your posted image looked like. A complete table nested inside a table. A second "add to Basket" and I got another complete table, nested inside the table that is already nested inside a table. Now, after the first edits to box.basket.php, there is 'table#basket_summary'. The javascript, when it does not find 'div#basket_summary', abandons the ajax request and has the browser make a regular POST page request. You might notice that the basket "Vedi Carrello" does not shake anymore? Quote Link to comment Share on other sites More sharing options...
vit320 Posted October 21, 2013 Author Share Posted October 21, 2013 relative to shake and connection with ajax request, this can create problem inside cart transition? or buy procedure work regularly? i don't need that cart button shake. Quote Link to comment Share on other sites More sharing options...
bsmither Posted October 21, 2013 Share Posted October 21, 2013 Updating the HTML node that has id="basket_summary" via ajax is not necessary. CubeCart will handle POSTed requests to add an item to the basket equally well. This affects nothing else. 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.