prestatent Posted July 7, 2014 Share Posted July 7, 2014 (edited) Fixed it now. Added to product.js on theme the following line beginning with $('a style="color: if (!selectedCombination['unavailable']) { $('#availability_value').text(doesntExistNoMore + (globalQuantity > 0 ? ' ' + doesntExistNoMoreBut : '')).addClass('warning_inline'); $('<a style="color: #ee7624; text-decoration: underline;" href="/stores">here</a>').appendTo('#availability_value'); } else { $('#availability_value').text(doesntExistNoMore).addClass('warning_inline'); $('#oosHook').hide(); } Prestashop 1.5.4.1 Hi I'm trying to do something which in theory should simple. I want to add a link into the message on the product page when a product is out of stock. For example the text of the current message shows the following: "This product is no longer in stock with those attributes but is available with others". I would like to change this to: "This product is no longer in stock with those attributes but is available from our stockists here .http://www.mysite.com/stockists" It would be great if anyone can help out. Thanks. Edited July 8, 2014 by prestatent (see edit history) Link to comment Share on other sites More sharing options...
Dh42 Posted July 7, 2014 Share Posted July 7, 2014 You can just use {$variable1}{$variable2} Link to comment Share on other sites More sharing options...
prestatent Posted July 8, 2014 Author Share Posted July 8, 2014 Thanks for your reply. I have tried this but unfortunately can't get this to work. The code before changing is: var doesntExistNoMoreBut = '{l s='with those attributes but is available with others' js=1}'; How can I add this variable: var stocklink = '<a href="{$base_dir}/stockists">here</p>'; to the above variable "doesntExistNoMoreBut". I've tried this: var doesntExistNoMoreBut = '{l s='with those attributes but is available with others' js=1}' '{$stocklink}'; but no joy. Any ideas? Link to comment Share on other sites More sharing options...
bellini13 Posted July 8, 2014 Share Posted July 8, 2014 There is no need to use smarty to join those 2 javascript variables You are fine with your new statement to define your stock link var stocklink = '<a href="{$base_dir}/stockists">here</p>'; Then just add a second line that joins your 2 javascript variables doesntExistNoMoreBut = doesntExistNoMoreBut.concat(stocklink); Link to comment Share on other sites More sharing options...
prestatent Posted July 8, 2014 Author Share Posted July 8, 2014 Thanks Bellini Almost there with this. This works but doesn't convert my "stocklist" variable to an actual link which I should also have asked. Apologies. Link to comment Share on other sites More sharing options...
prestatent Posted July 8, 2014 Author Share Posted July 8, 2014 (edited) Fixed it now. Added to product.js on theme the following line beginning with $('a style="color: if (!selectedCombination['unavailable']) { $('#availability_value').text(doesntExistNoMore + (globalQuantity > 0 ? ' ' + doesntExistNoMoreBut : '')).addClass('warning_inline'); $('<a style="color: #ee7624; text-decoration: underline;" href="/stores">here</a>').appendTo('#availability_value'); } else { $('#availability_value').text(doesntExistNoMore).addClass('warning_inline'); $('#oosHook').hide(); } Edited July 8, 2014 by prestatent (see edit history) 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