bkessler91 Posted July 25, 2013 Share Posted July 25, 2013 When in the "Sale Items" category (/shopping_cart/index.php?_a=saleitems) can not add a product to the basket. I or customers, have to click on the product, then click add to basket. In debugging mode, this is what I get: PHP: [Warning] /home/"usr"/public_html/shopping_cart/includes/lib/smarty/sysplugins/smarty_resource.php:325 - filemtime() [function.filemtime.php]: stat failed for /home/"usr"/public_html/shopping_cart/skins/kurouto/js/common.html Link to comment Share on other sites More sharing options...
bsmither Posted July 25, 2013 Share Posted July 25, 2013 Please ignore that particular warning (Smarty and filemtime for any file), and the one that says "Failed to unlink file <whatever>." This is Smarty's fault and the developers of Smarty know about it. Smarty catches this error before PHP can enter it into the PHP error log. But then, CubeCart's debug catches this before Smarty does. Items from the Sale Items screen not getting placed in the Shopping Basket? Let me check on the codebase for CC515. (CC522 seems to work fine.) Link to comment Share on other sites More sharing options...
bsmither Posted July 25, 2013 Share Posted July 25, 2013 Looking at CC514 with the Nota skin. That skin has no Add to Basket button on the Sale Items list. CC514 with the Kurouto skin works fine. (I'm assuming any "bug" that is manifesting per your experience with CC515 would also be present in CC514.) What skin are you using, and what, if any enhancements have you added to the store? Link to comment Share on other sites More sharing options...
bkessler91 Posted July 26, 2013 Author Share Posted July 26, 2013 Kurouto Grey. Recently, I have not made any modifications. In the past, I have changed things such as background image, header images, and have changed values to allow customers to order fractions of a product (hired third party to make the fraction mod) [i sell fabric by the yard and in 1/4 increments, if you were wondering why I needed customers to order in fractions] This problem may have been existing for a while and customers just did not contact me. It seems that there are different problems with different products, Smither, would it be ok to send you an email with more specifics? Link to comment Share on other sites More sharing options...
bsmither Posted July 27, 2013 Share Posted July 27, 2013 bkessler91 wrote to me: "Go to page 4 of Sale Items and add any product. My homepage shows up where the basket is supposed to be." This is bug #615. Given: Not using SEF URLs (not required, but helps illustrate) Viewing the category 'Sale Items' 'Sale Items' has multiple pages Viewing page 2 or later Submitting "Add to Basket" will replace the Shopping Basket side-box with the site's homepage. This is what the browser POSTs: POST /index.php&page=2?_g=ajaxadd HTTP/1.1 Referer: /index.php?_a=saleitems&page=2 In /js/common.js, in an action near line 370, the string '?_a=saleItems' is removed, but &page=2 is not. Thus, a malformed querystring results. (Any extra parts to the querystring, such as sort order, also comes before '?_g=ajaxadd'.) Somewhere, this malformed querystring is not parsed correctly and thus causes the returned content for the ajax request to be not correct. This javascript action needs to remove everything from the question mark afterwards as it is not required for an ajax request. Near line 376, find: var add = $(this).serialize(); var action = $(this).attr('action').replace('?_a=saleitems', ''); Change just this part: replace('?_a=saleitems', ''); To: replace(/?.*/, ''); Now, an ajax request is created that looks like: POST /shopping_cart/index.php?_g=ajaxadd HTTP/1.1 which is all that is required. This bug goes back as early as CC514 (which is as far as I checked). Link to comment Share on other sites More sharing options...
bkessler91 Posted July 27, 2013 Author Share Posted July 27, 2013 Works great! Thank you! Link to comment Share on other sites More sharing options...
Dirty Butter Posted August 23, 2013 Share Posted August 23, 2013 Checking through posts I've pinned - this is hopefully one that is no longer an issue in 5.2.2. If so, I'll unpin it. Please verify. Link to comment Share on other sites More sharing options...
Al Brookbanks Posted December 16, 2013 Share Posted December 16, 2013 Thanks this JS code change works well and has been rolled into the next 5.2.6 release in GitHub. Link to comment Share on other sites More sharing options...
Recommended Posts