goody974 Posted September 12, 2014 Share Posted September 12, 2014 Hi hope someone can help. I have a module installed which upsells accessories. by this I mean it adds the accessories into a section just below the product price on the product page. The problem here is that this displays above the product options. I would like to move it below the product options. How can I do this? An example can be seen at http://www.scalesworld.co.uk/parcel-scales/2-sw-a15-counting-scale.html Also, when you click on add to cart, a tick appears in the accessory automatically, if you check the cart then the accessory hasnt been added, which is correct, but still this could cause unnecessary confusion. Any way to stop this? Thanks in advance Link to comment Share on other sites More sharing options...
NemoPS Posted September 12, 2014 Share Posted September 12, 2014 Are you hooking that module to displayProductButtons? Try with displayFooterProduct Link to comment Share on other sites More sharing options...
goody974 Posted September 12, 2014 Author Share Posted September 12, 2014 No its hooked into displayrightcolumnproduct all by itself. When i try to transplant it to a different hook it says its not possible. Link to comment Share on other sites More sharing options...
NemoPS Posted September 12, 2014 Share Posted September 12, 2014 Yes, you have to modify the module and change hookDisplayRightColumnProduct to hookDisplayFooterProduct Link to comment Share on other sites More sharing options...
goody974 Posted September 12, 2014 Author Share Posted September 12, 2014 Strange thing is this module makes no mention of this hook in its PHP file... simply:- function install() { if (!parent::install() || !$this->registerHook('extraRight')) return false; return true; } function hookExtraRight($params) { global $smarty, $cookie; if (isset($_GET['id_product'])) { $product = new Product(intval($_GET['id_product'])); $accessories = $product->getAccessories(intval($cookie->id_lang)); if ($accessories) { $smarty->assign(array('p_accessories' => $product->getAccessories(intval($cookie->id_lang)))); } } Link to comment Share on other sites More sharing options...
goody974 Posted September 12, 2014 Author Share Posted September 12, 2014 ok, altered the above function to hookDisplayFooterProduct and I can now transplant the module there, however its not changed anything on the front Link to comment Share on other sites More sharing options...
NemoPS Posted September 13, 2014 Share Posted September 13, 2014 Try clearing cache from advanced parameters, performance Link to comment Share on other sites More sharing options...
goody974 Posted September 15, 2014 Author Share Posted September 15, 2014 Yeah tried that, had cache turned off at the time but still no good. Perhaps more important now is that I dont want the tick box to appear when someone adds a product to their cart, how can I stop this behaviour? Link to comment Share on other sites More sharing options...
NemoPS Posted September 15, 2014 Share Posted September 15, 2014 Hard to tell, as it's triggered by javascript. Try looking for some reference like .product_accessories_description checkbox It's triggering when you click the button, which has the following reference: <a class="exclusive" href="javascript:document.getElementById('add2cartbtn').click();">Add to cart</a> 1 Link to comment Share on other sites More sharing options...
goody974 Posted September 15, 2014 Author Share Posted September 15, 2014 Thanks for the pointer... it appears that this code triggers that in the upsell template:- ajaxCart.overrideButtonsInThePage_orig(); $('body#product p#add_to_cart input').unbind("click").click(function() { ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null); $('#upsellaccessories ul li input[type="checkbox"]:checked').each(function (i,e) { $(e).parent().parent().children("a.hidden").trigger("click"); }) $('#upsellaccessories ul li input[type="checkbox"]').each(function (i,e) { $(e).attr("checked",""); }) return false; }); Removing the following line seems to make it work correctly:- $('#upsellaccessories ul li input[type="checkbox"]').each(function (i,e) { $(e).attr("checked",""); }) Any harm in doing this? Link to comment Share on other sites More sharing options...
NemoPS Posted September 17, 2014 Share Posted September 17, 2014 Unless you see any obvious error, no Link to comment Share on other sites More sharing options...
Recommended Posts