ysns Posted July 28, 2011 Share Posted July 28, 2011 Hello I have an SSL problem in order steps select carrier. SSL works fine but when user click on read link for terms and conditions pop up shows and it gives links with out ssl and cause yellow warning in browser. How can I make this link with ssl. I guess its about $link_conditions but dont know what to change. I am using 1.3.7 In order.php around line 377 $cms = new CMS(3, intval($cookie->id_lang)); $link_conditions = $link->getCMSLink($cms, $cms->link_rewrite); if (!strpos($link_conditions, '?')) $link_conditions .= '?content_only=1&TB_iframe=true&width=450&height=500&thickbox=true'; else $link_conditions .= '&content_only=1&TB_iframe=true&width=450&height=500&thickbox=true'; if (!isset($checked) OR intval($checked) == 0) $checked = intval(Configuration::get('PS_CARRIER_DEFAULT')); $smarty->assign(array( 'checkedTOS' => intval($cookie->checkedTOS), 'recyclablePackAllowed' => intval(Configuration::get('PS_RECYCLABLE_PACK')), 'giftAllowed' => intval(Configuration::get('PS_GIFT_WRAPPING')), 'conditions' => intval(Configuration::get('PS_CONDITIONS')), 'link_conditions' => $link_conditions, 'recyclable' => intval($cart->recyclable), 'gift_wrapping_price' => floatval(Configuration::get('PS_GIFT_WRAPPING_PRICE')), 'carriers' => $resultsArray, 'HOOK_EXTRACARRIER' => Module::hookExec('extraCarrier', array('address' => $address)), 'checked' => intval($checked), 'total_wrapping' => Tools::convertPrice($wrapping_fees_tax_inc, new Currency(intval($cookie->id_currency))), 'total_wrapping_tax_exc' => Tools::convertPrice($wrapping_fees, new Currency(intval($cookie->id_currency))))); Tools::safePostVars(); $css_files = array(__PS_BASE_URI__.'css/thickbox.css' => 'all'); $js_files = array(__PS_BASE_URI__.'js/jquery/thickbox-modified.js'); require_once(dirname(__FILE__).'/header.php'); $smarty->display(_PS_THEME_DIR_.'order-carrier.tpl'); and order-carrier.tpl code is {if $conditions} <h3 class="condition_title">{l s='Terms of service'}</h3> <p class="checkbox"> <input type="checkbox" name="cgv" id="cgv" value="1" {if $checkedTOS}checked="checked"{/if} /> <label for="cgv">{l s='I agree with the terms of service and I adhere to them unconditionally.'}</label> <a href="{$link_conditions}" class="thickbox">{l s='(read)'}</a> </p> {/if} Link to comment Share on other sites More sharing options...
j_rel Posted July 28, 2011 Share Posted July 28, 2011 Not sure if this will help you (I don't have 1.3.7) but there are some places where I see: $domain = (Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$domain; Basically, gets global var whether or not SSL is enabled (in back office) and then decides to prepend http or https accordingly. Maybe this will help you? Link to comment Share on other sites More sharing options...
ysns Posted July 30, 2011 Author Share Posted July 30, 2011 Thanks j-rel but I could not find it. Below the code I need to change from order.php I am using 1.3.7. As you can see $link_conditions get link from cms but this pop up does not include SSL so it gives me warning error. It is quite important since prestashop is e-business shop and ssl management is its core issue. Since 1.4 comes up 1.3 support becames less important it seems. I hope someone give me a hand for this. Thanks $cms = new CMS(3, intval($cookie->id_lang)); $link_conditions = $link->getCMSLink($cms, $cms->link_rewrite); if (!strpos($link_conditions, '?')) $link_conditions .= '?content_only=1&TB_iframe=true&width=450&height=500&thickbox=true'; else $link_conditions .= '&content_only=1&TB_iframe=true&width=450&height=500&thickbox=true'; if (!isset($checked) OR intval($checked) == 0) Link to comment Share on other sites More sharing options...
ysns Posted July 31, 2011 Author Share Posted July 31, 2011 bump Link to comment Share on other sites More sharing options...
ysns Posted August 7, 2011 Author Share Posted August 7, 2011 This is an essential issue for e-commerce and no reply at all. This forum is dead. No reply! no support! nothing! It seems prestashop is bad choice for e-commerce open source solution. Link to comment Share on other sites More sharing options...
drlava Posted October 31, 2013 Share Posted October 31, 2013 (edited) This is an interesting bug, and it appears to go way back a few years, and still exists in the latest version 1.5.6.0. Searching around, I found this solution: http://stackoverflow.com/questions/13888321/prestashop-content-only-link-not-working but then, this reversal of the solution was submitted to the source code tree, breaking the conditions display at https: checkout again: https://github.com/PrestaShop/PrestaShop/pull/330 I think a proper solution would be to edit the following files in controllers\front: OrderOpcController.php and ParentOrderController.php find the line $link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite ); and change it to $link_conditions = $this->context->link->getCMSLink($cms, $cms->link_rewrite, Configuration::get('PS_SSL_ENABLED') ); This will work for both shops with ssl and without. Note: I haven't tested this with the Opc style checkout. Edited October 31, 2013 by drlava (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 31, 2013 Share Posted October 31, 2013 i suppose that problem is realted to latest changes in browsers related to mixed-content filtering, but i think that your solution is the best one i ever seen :-) Link to comment Share on other sites More sharing options...
Out of Karma Posted November 12, 2013 Share Posted November 12, 2013 I have used the above code in drlava's post, however this hasn't worked for my site, www.lfp.uk.com. Browsers are still blocking the non SSL CSM pages. Is there a way of either creating SSL CMS pages, or adding a direct https link to the terms and conditions? Link to comment Share on other sites More sharing options...
vekia Posted November 12, 2013 Share Posted November 12, 2013 have you changed link_conditions variable too? i can't localize this link on your website. field to accept tos doesn't appear - it is disabled? Link to comment Share on other sites More sharing options...
Out of Karma Posted November 12, 2013 Share Posted November 12, 2013 yes, I have put it back on now. Link to comment Share on other sites More sharing options...
vekia Posted November 12, 2013 Share Posted November 12, 2013 what ps version you use? your website still redirects from ssl to non ssl take a look here: https://github.com/PrestaShop/PrestaShop/commit/f0f3679cbd90717a5bdff1a4cab65d7caed4568a 1 Link to comment Share on other sites More sharing options...
Out of Karma Posted November 12, 2013 Share Posted November 12, 2013 Thanks for checking this Vekia. Currently using 1.5.4.1. SSL is working fine its the TOS when on the carrier selection page of the order process (browser blocking non SSL content). I will read through the link you've sent and test that. Link to comment Share on other sites More sharing options...
Out of Karma Posted November 12, 2013 Share Posted November 12, 2013 Hi Vekia, thanks for that link. Just to make sure I am reading it correctly, the lines of code in red (with a - sign) i need to remove and the code in green I need to add into the php? Link to comment Share on other sites More sharing options...
Out of Karma Posted November 12, 2013 Share Posted November 12, 2013 Brilliant, your link worked. I can now see my Terms of Service even though I am on the SSL side of my site. Vektastic! Link to comment Share on other sites More sharing options...
vincent89 Posted July 10, 2014 Share Posted July 10, 2014 prestashop 1.6.0.8 I Found the solution without modify anything in the presta files. enable ssl and force the ssl on all pages but uncheck html purifier library (very important). you could enable it after insert the image. then go on CMS (exemple: about us) the image who's already there when you install prestashop work well even in ssl so you have to copy how they wrote the code. <img title="cms-img" src="../img/cms/cms-img.jpg" alt="cms-img" width="370" height="192" /> replace by your name image <img title="your name image" src="../img/cms/your name image.jpg" alt="your name image" width="370" height="192" /> write this way on the little popup window [insert/edit image] right after uploaded and chose the image from your file manager. source ../img/cms/your name image.jpg image description .... dimensions ... Save it and go to enable the html filter purifier if you done to put new images. Now it should work. your image is here and your page is still SSL. ps: you'll have to disable html purifier library every time you need to add a new picture from your file manager otherwise it will appear this famous question mark instead of the image and your page won't be SSL It tooks 2weeks to found that, I hope you'll appreciate this post. That's the most annoying bug on prestashop, I don't even know why the Presta team didn't fix that so far!!!!???? I still have a problem with the homeslider who's disappear when running on Safari, need to refresh the page every time I come back on the home page!!! if somebody have the Solution I'll appreciate to know it thanks vince Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now