Hi there....
I am trying to fix an error on my newly installed shopping cart..(open cart)
I tried with json but it shows empty tab.
Then I tried with html rather thn json datatype...Code:$.ajax({ url: 'index.php?route=checkout/shipping', dataType: 'json', success: function(json) { if (json['redirect']) { location = json['redirect']; } if (json['output']) { $('#shipping-method .checkout-content').html(json['output']); $('#shipping-address .checkout-content').slideUp('slow'); $('#shipping-method .checkout-content').slideDown('slow'); $('#shipping-address .checkout-heading a').remove(); $('#shipping-method .checkout-heading a').remove(); $('#payment-method .checkout-heading a').remove(); $('#shipping-address .checkout-heading').append('<a><?php echo $text_modify; ?></a>'); } } });
But the output is something wired...as the function is designed for reading json...and it cant read html properly...Code:$.ajax({ url: 'index.php?route=checkout/payment', dataType: 'html', success: function(html) { $('#payment-method .checkout-content').html(html); $('#shipping-method .checkout-content').slideUp('slow'); $('#payment-method .checkout-content').slideDown('slow'); $('#shipping-method .checkout-heading a').remove(); $('#payment-method .checkout-heading a').remove(); $('#shipping-method .checkout-heading').append('<a><?php echo $text_modify; ?></a>'); }, error: function(xhr, ajaxOptions, thrownError) { alert(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText); } });
so the out put is something like
Any help would be really appreciable...HTML Code:{"output":" Please select the preferred payment method to use on this order.<\/p>\r\n \r\n \r\n \r\n <\/td>\r\n Cash On Delivery<\/label><\/td>\r\n <\/tr>\r\n <\/table>\r\nAdd Comments About Your Order<\/b>\r\n<\/textarea>\r\n<br \/>\r\n<br \/>\r\n<div class=\"buttons\">\r\n <div class=\"right\">I have read and agree to the <a class=\"fancybox\" href=\"http:\/\/kettenhemd-mittelalter-shop.com\/index.php?route=information\/information\/info&information_id=5\" alt=\"Terms & Conditions\"><b>Terms & Conditions<\/b><\/a> <input type=\"checkbox\" name=\"agree\" value=\"1\" \/>\r\n <a id=\"button-payment\" class=\"button\"><span>Continue<\/span><\/a><\/div>\r\n<\/div>\r\n<script type=\"text\/javascript\"><!--\r\n$('.fancybox').fancybox({\r\n\twidth: 560,\r\n\theight: 560,\r\n\tautoDimensions: false\r\n});\r\n\/\/--><\/script> \r\n<script type=\"text\/javascript\">\r\n$('.button').button();\r\n<\/script>"}
Please let me know...if u can help.
Thanks
Danish;



Reply With Quote
Bookmarks